AngularJS ng-value instruction
AngularJS examples
Set value input box:
<Div ng-app = "myApp " ng-controller = "myCtrl">
<Input ng-value = "myVar ">
</ Div>
<Script>
var app = angular.module ( 'myApp', []);
app.controller ( 'myCtrl', function ($ scope) {
$ Scope.myVar = "Hello World!";
});
</ Script>
<Input ng-value = "myVar ">
</ Div>
<Script>
var app = angular.module ( 'myApp', []);
app.controller ( 'myCtrl', function ($ scope) {
$ Scope.myVar = "Hello World!";
});
</ Script>
try it"
Definition and Usage
ng-value command is used to set the input or select element's value property.
grammar
<Input ng-value = "expression "> </ input>
<Input> and <select> elements support this property.
Parameter Value
value | description |
---|---|
expression | Expressions are used to set the value of the property value. |