Latest web development tutorials

AngularJS ng-value instruction

AngularJS Reference Manual AngularJS Reference Manual


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>

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.

AngularJS Reference Manual AngularJS Reference Manual