AngularJS $watch function

AngularJS Scope.$watch function can be used to react on a model change to trigger some further actions.

The $watch function itself takes two required arguments and a third optional one:

angular.module("myApp")
.controller("MyController", ['$scope', function($scope) {
$scope.$watch('full_name', function(newVal, oldVal, scope) {
// the newVal of the full_name will be available here
// while the oldVal is the old value of full_name
});
}]);