0
votes

I'm trying to use filtering and sorting with Angularjs, but my filter only fires once. I have looked at alot of other samples but it is not clear to me why this only fires once.

HTML

Search: <input ng-model="query.$">
From: <input ng-model="query.From">
DepartureTime: <input ng-model="query.DepartureTime">

JS $scope.$watch('query', function (newValue, oldValue) { /* */ }

http://jsfiddle.net/E4V7X/

1

1 Answers

0
votes

You need to deep watch query since you're looking for changes in it's child properties, you do that by passing true as the third argument of $watch

$scope.$watch('query', function (newValue, oldValue) {
//
},true)