问题
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
来源:https://stackoverflow.com/questions/18775011/angular-how-can-i-watch-a-filter-result-array-for-changes-from-the-controller