Skip to content

Commit

Permalink
watch scope variables for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
praneethkumarpidugu committed Jul 5, 2016
1 parent bd4585a commit 05c49a4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions section6/lesson1/main.js
Expand Up @@ -28,13 +28,9 @@ app.controller('PersonListController', function ($scope, ContactService) {
$scope.contacts.loadMore();
};

$scope.sensitiveSearch = function (person) {
if ($scope.search) {
return person.name.indexOf($scope.search) == 0 ||
person.email.indexOf($scope.search) == 0;
}
return true;
};
$scope.$watch('search', function(newVal, oldVal) {
console.log(newVal);
})

});

Expand Down

0 comments on commit 05c49a4

Please sign in to comment.