Ng-Model-Options-6

 

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 Debounce: <select class="form-control" ng-model="UpdateOnBlur" ng-options="p.first as p.first for p in people" ng-model-options="{debounce: 1000}" ></select> <pre>Update on Debounce: <b>{{UpdateOnBlur}}</b></pre> </div> </div> <script> var app = angular.module("myApp", []); app.controller('myController', ['$scope', function ($scope) { $scope.people = [{ first: 'John', last: 'Rambo', actor: 'Silvester' },{ first: 'Rocky', last: 'Balboa', actor: 'Silvester' },{ first: 'John', last: 'Kimble', actor: 'Arnold' },{ first: 'Ben', last: 'Richards', actor: 'Arnold' } ]; }]); </script> </body> </html>
Output