Ng-Model-Options-5

 

Example of Ng-Model-Options

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body ng-app="myApp"> <div ng-controller="myController"> <div class="container"> Update On Blur: <input type="text" class="form-control" ng-model="UpdateOnBlur" ng-model-options="{updateOn: 'blur'}" /> <b>{{UpdateOnBlur}}</b> <br /> Update On Change: <input type="text" class="form-control" ng-model="UpdateOnChange" /> <b>{{UpdateOnChange}}</b> <br /> Update On Debounce: <textarea class="form-control" ng-model="UpdateOnDebounce" ng-model-options="{debounce: 1000 }"></textarea> <b>{{UpdateOnDebounce}}</b> </div> </div> <script> var app = angular.module("myApp", []); app.controller('myController', ['$scope', function ($scope) { }]); </script> </body> </html>
Output