AngularJS ng-change example

AngularJS ng-change expression is evaluated when the user changes the input.

<div ng-app="myApp" ng-controller='MyCtrl'>
  <input type="text" ng-model="name" ng-change="inc()" ng-init="count=0;"><br>
  number of times input changed: {{count}}

<script src="//"></script>
var module = angular.module('myApp', []);
module.controller('MyCtrl', function($scope) {
  $ = function() {
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments