Angularjs Examples

AJS Examples

AngularJS ng-Change Directive

The ng-change directive is used to execute the expression when input changed.


<p ng-change="yourFunction()"></p> 

AngularJS ng-Change Directive Example

<title>My first AngularJS ng-change Directive code</title>
<Script SRC="">
//Defining Controller Using Standard Javascrip Object Constructor
function CustomerController($scope) {
$scope.presentValue = '';
$scope.changed = function() {
        $scope.changedValue = $scope.presentValue + ' Value Changed';
<div ng-app="">
<div ng-controller="CustomerController"> 

<input type="text" ng-model="presentValue" ng-change="changed()" id="ng-change1" /></br>
Display : {{ changedValue }}

See Live Example