AngularJS ng-value directive
AngularJS instance
Set the value of the input box:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body><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><p>This example demonstrates how to use AngularJS expressions to set the value of the input box. </p></body></html>Definition and usage
The ng-value directive is used to set the value attribute of the input or select element.
grammar
<input ng-value="expression"></input>
The <input> and <select> elements support this property.
Parameter value
| value | describe |
|---|---|
| Expression | Expressions are used to set the value of the value attribute. |
The above is a compilation of AngularJS ng-value instruction information. We will continue to add it later. Thank you for your support for this site!