angular-flexslider icon indicating copy to clipboard operation
angular-flexslider copied to clipboard

Using filter module

Open wojtek1150 opened this issue 10 years ago • 4 comments

Hi,

It is possible to use this directive with filter options?

wojtek1150 avatar Feb 04 '15 23:02 wojtek1150

Hi there, could you give us a code snippet to explain the use case? thanks!

thenikso avatar Feb 18 '15 08:02 thenikso

I'm trying to do the same thing. When the collection is filtered it is not reflected in the slides:

<div ng-init="collection = [1, 2, 3, 4, 5]">
  <input type="text" ng-model="mySearch">

  <ol>
    <li ng-repeat="item in collection | filter:mySearch">{{item}}</li>
  </ol>

  <flex-slider flex-slide="item in collection track by $index | filter:mySearch">
    <li ng-bind="item"></li>
  </flex-slider>
</div>

cboden avatar May 12 '15 16:05 cboden

From that example I'd try to have the expression like so:

flex-slide="item in collection | filter:mySearch track by $index"

That said a $watchColleciton is used to track changes in the collection and it should work with a filter.

thenikso avatar Jul 07 '15 08:07 thenikso

It is happening only for the first time. After that even though watchCollection is triggered, it is not updating the dom elements :(

siva3378 avatar Dec 17 '15 17:12 siva3378