Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS ng-change Event Example
Keywords : Angularjs text input change event example, Angularjs input onchange event example, Angularjs ng-change directive example, Angularjs fire an event whenever input text changes example
Example
<!DOCTYPE html> <html> <head> <title> AngularJs ng-change Event Example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type="text/javascript"> var app = angular.module('ngchangeApp', []); app.controller('ngchangeCtrl', function ($scope) { $scope.count = 0; $scope.getdetails = function () { $scope.count = $scope.count + 1; } }); </script> </head> <body> <div ng-app="ngchangeApp" ng-controller="ngchangeCtrl"> <h2>AngularJs ng-change Event Example</h2> <input type="text" ng-change="getdetails()" ng-model="txtval" /><br /><br /> <span style="color:Red">No. of Times Input Changes: {{count}}</span> </div> </body> </html>
Click Here to See Result
Result
Previous
Next