Prev Demo
AngularJS
>
How To Delay Model Updates In Angularjs?
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> </head> <body> <script> var app = angular.module("app", []); app.controller("CustomTriggerController", ["$scope", function ($scope) { $scope.PD = {}; }]); </script> <div ng-app="app" ng-controller="CustomTriggerController"> <form name="myForm"> <p> Username: <input type="text" ng-model="PD.username" required ng-model-options="{updateOn : 'blur', debounce : 400}" /> </p> Address: <input type="text" ng-model="PD.address" required ng-model-options="{updateOn : 'default blur', debounce : {default: 250, blur: 100}}" /> </form> <hr /> <b>Username:</b> {{PD.username}} <br /> <b>Address:</b> {{PD.address}} </div> </body> </html>
Note: We DO NOT save your trial code in our database.
Output