Here you can use two-way data binding and see the ng model in the form field for changes
<form method="post"> First name:<input type="text" name="fname" ng-model="user.fname"/><br /> Last name: <input type="text" name="lname" ng-model="user.lname"/><br /> E-mail: <input type="text" name="email" ng-model="user.email"/><br /> Phone: <input type="text" name="phone" ng-model="user.phone"/><br /> Address: <input type="text" name="address" ng-model="user.address"/><br /> </form>
Then inside your angular controller you can do something like this.
angular.module('app', []).controller('AppController', function($scope){ $scope.user = { }; $scope.$watch('user', function(nv, ov){ console.log(nv); }, true); });
In some cases, you may need to process it to prevent multiple requests from being sent, because the $ watch function will fire every time a value in a text field changes.
Here is the fiddle that starts $ watch when some value in the form field changes, whether through auto-completion or manual user input.
source share