Angular - how can I watch a filter result array fo

2019-07-21 15:47发布

问题:

I have a filter that filters with some criteria through a ng-repeat list.

How could I watch the RESULTING array that is made by the filtering service for changes INSIDE the controller?

The full Question and description is here Angular factory filter - Can't get data passed to the filter in the first answer.

回答1:

What about piping your data through a local method like this ?

<li ng-repeat="item in catchData((items|cut:max))">...</li>

I plunked a full example here http://plnkr.co/edit/2L25wdB6S8GG659H4jPw?p=preview