I'm trying to do this:
- ng-repeat a list of about 50 items
- Filter it based on a text field (
ng-repeat="note in notes|filter:basicFilter"
) - If the basic filter yields no results (or maybe like 5 results), perform an $http call to do a deep search on the database
Is there a way to check what the filter yields after the "basic" filter, so I can perform a $http call back to the server? Is there a "filter" that is built-in to angular that I can call up?
I've tried watching the variable:
$scope.$watch('filtered_notes', function() {
// can't do this
});
Where ng-repeat="note in filtered_notes = (notes | orderBy:['-note_time']|filter:noteFilter|limitTo:limit)"
But, it throws an error: Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!