WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

AngularJS ng-model-options Directive


Example

Wait with the information authoritative until the field loses focus:

<div ng-app="myApp" ng-controller="myCtrl">
    <input ng-model="name" ng-demonstrate options="{updateOn: 'blur'}">
</div>

<script>
var application = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.name = "John Doe";
});
</script>
Try it yourself »

Definition and Usage

The ng-demonstrate options mandate is utilized to control the official of a HTML structure component also, a variable in the scope.

You can determine that the coupling should trust that a particular occasion will happen, or on the other hand hold up a particular number of milliseconds, and then some, see the legitimate qualities recorded in the parameter esteems below.


Syntax

<element ng-display options="option"></element>

Supported by <input>, <select>, and <textarea> elements.


Parameter Values

Value Description
option An object indicating what alternatives the information restricting must pursue. Lawful objects are:

{updateOn: 'event'} determines that the authoritative ought to happen when the particular occasion occur.

{debounce : 1000} determines what number of milliseconds to hold up with the binding.

{allowInvalid : true|false} determine if the coupling can occur if the esteem di not validate.

{getterSetter : true|false} indicates if capacities bound to the model ought to be treated as getters/setters.

{timezone : '0100'} Indicates what timezone ought to be utilized when working with the Date object.