前端之家收集整理的这篇文章主要介绍了
angularJS动态设置ng-model,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<divclass="form-group">
<labelclass="col-xs-2control-labelcol-xs-offset-1"><span
class="red">*</span>系统选择</label>
<divclass="col-xs-9">
<divclass="col-xs-3pl0"ng-repeat="paraminparams">
<divclass="radioc-radio">
<label>
<inputng-show="ls"
type="checkBox"name="radioSys"class="checkSysIdradioSys"
ng-true-value="`param`.`sysId`"value="`param`.`sysId`"
ng-trim="false"ng-click="getSysId($parent.conff[$index])"
ng-model="$parent.conff[$index]">
<spanng-show="ls"class="fafa-check"></span>`param`.`sysName`
</label>
</div>
</div>
</div>
</div>
//点击获取系统ID
$scope.getSysId=function(t){
u="";
//$("#s1option").remove();
//$("#s2option").remove();
t="";
for(varpropin$scope.conff){
if($scope.conff[prop]!=false){
t+=$scope.conff[prop];
t=t+'\,';
vark=$scope.conff[prop];
varCoreUrl2=newcoreUrl({"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
};
利用$index判断获取选中的checkBox
原文链接:https://www.f2er.com/angularjs/146779.html