angular-flexslider
angular-flexslider copied to clipboard
Using filter module
Hi,
It is possible to use this directive with filter options?
Hi there, could you give us a code snippet to explain the use case? thanks!
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>
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.
It is happening only for the first time. After that even though watchCollection is triggered, it is not updating the dom elements :(