Angularjs Examples

AJS Examples

AngularJS ng-Change Directive

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


<button ng-change="addFunctionality"> 

AngularJS AngularJS ng-Change Directive Example

<title>My first AngularJS 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