继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

angularJS动态设置ng-model

慕UI0519722
关注TA
已关注
手记 296
粉丝 85
获赞 267

         

<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">                                   <div class="radio c-radio">                                       <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]">                                           <span  ng-show="ls" class="fa fa-check"></span>`param`.`sysName`                                       </label>                                   </div>                                   </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                    };

利用$index判断获取选中的checkbox


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP