AngularJS ng-value Instruction
AngularJS Examples
Set the value of the input field:
<
div
ng-app=
"myApp"
ng-controller=
"myCtrl"
<
input
ng-value=
"myVar"
<
/div
<
scriptvar app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myVar = "Hello World!";
});
<
/script
Try it »
Definition and Usage
ng-value The directive is used to set the value attribute of an input or select element.
Syntax
<
input
ng-value=
"expression"
<
/inputand
AngularJS Reference Manual