input[number]的初始值111
修改值后,成功双向绑定
代码示例
<body>
<p>该实例演示了如何使用 AngularJS 表达式来设置输入框的初始值和绑定变化后的值。</p>
<div ng-app="myApp" ng-controller="myCtrl">
<input type="number" ng-value="myVar" ng-model="you">
<p>{{you}}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.myVar = "111";
});
</script>
</body>