Ng-model-options= "{updateon: ' Blur '}"
Options to apply to the current model. Valid keys are:
updateOn
: string specifying which event should the input is bound to. You can set several events using a space delimited list. There is a special event called that default
matches the default events belonging of the control.
debounce
: integer value which contains the Debounce model update value in milliseconds. A value of 0 triggers an immediate update. If an object was supplied instead, you can specify a custom value for each event. For example:ng-model-options="{ updateOn: ‘default blur‘, debounce: { ‘default‘: 500, ‘blur‘: 0 } }"
allowInvalid
: Boolean value which indicates that the model can is set with values that does not validate correctly instead of the Defau Lt behavior of setting the model to undefined.
-
gettersetter
: Boolean value which determines whether or not to treat functions Bound to ngmodel
as getters/setters.
timezone
: Defines the timezone to being used to read/write the Date
instance in the model for <input type="date">
, <input type="time">
, .... It understands Utc/gmt and the continental US time zone abbreviations, but to general use, use a time zone offset, for ex Ample, ‘+0430‘
(4 hours, minutes east of the Greenwich meridian) If not specified, the timezone of the browser would be us Ed.
<div ng-controller= "Examplecontroller" > <form name= "UserForm" > <label>Name: <input type= "text" name= "userName" ng-model= "user.name" ng-model-options= "{ Updateon: ' Blur '} " ng-keyup=" Cancel ($event) "/> </label><br/> <label > Otherdata: <input type= "text" ng-model= "User.data"/> </label><br/> </form> <pre>user.name = <span ng-bind= "User.Name" ></span></pre></div >
Angularjs Delayed update