怎么修改Angular表单的默认值呢?
我的html部分:
<input name="phone" type="text" class="input bg_phone" placeholder="请输入手机号" ng-model="user.phone" required>
我的js部分:
var Myapp =angular.module("Myapp",[]);
Myapp.controller("Myctrl",function($scope,$http){
$http.get('js/phone.json')
.success(function(response){
$scope.user = response;
});
});
我的json部分:
{
"phone": "12345678901",
"verification": "111111"
}
问题:这个显示的总是12345678901 但是我想他最开始是显示placeholder的,这个是怎么做的呢??求解
Cloness
9 years, 3 months ago