急,如何动态设置ng-model?
我的select是动态读出来的,请问如何动态添加ng-model呢<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']);
页:
[1]