PhoneGap中文网
标题:
急,如何动态设置ng-model?
[打印本页]
作者:
sistargirl
时间:
2016-5-6 10:49
标题:
急,如何动态设置ng-model?
我的select是动态读出来的,请问如何动态添加ng-model呢
作者:
你懂的
时间:
2016-5-6 14:06
<div ng-controller="TestCtrl">
<select ng-change="change(x)" ng-model="x">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
var app = angular.module('Demo', [], angular.noop);
app.controller('TestCtrl', function($scope){
$scope.change = function(x){
console.log(x);
}
});
angular.bootstrap(document, ['Demo']);
欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/)
Powered by Discuz! X3.2