動態設置ng-model
<div class="form-group" >
<label class="col-xs-2 control-label col-xs-offset-1"><span class="red">*</span>系統選擇</label>
<div class="col-xs-9">
<div class="col-xs-3 pl0" ng-repeat="param in params">
<label>
<input ng-show="ls" type="checkbox" name="radioSys" class="checkSysId radioSys" ng-true-value="{{param.sysId}}" value="{{param.sysId}}" ng-trim="false" ng-click="getSysId($parent.conff[$index])" ng-model="$parent.conff[$index]">
</label>
</div>
</div>
</div>
//點擊獲取系統ID
$scope.getSysId = function(t){
u="";
// $("#s1 option").remove();
// $("#s2 option").remove();
t="";
for(var prop in $scope.conff){
if($scope.conff[prop] != false){
t+=$scope.conff[prop];
t=t+‘\,‘;
var k = $scope.conff[prop];
var CoreUrl2 = new coreUrl({"transCode":"B000603","sysId":k});
CoreUrl2.$save(function(objc){
u+=objc.row[0].sysName;
u=u+‘ ‘
$scope.uu = u;
});
}
// if($scope.conff[prop] != false){
// t+=$scope.conff[prop];
// t=t+‘\,‘;
// }
}
t = t.substr(0,t.length-1);
$scope.userSysList = t
};
通過設置索引獲取需要的checked的值
本文出自 “紫楓5966” 博客,請務必保留此出處http://zifeng5966.blog.51cto.com/8763113/1924564
動態設置ng-model