How to disable the checkbox in angularjs -


i have list of checkboxes on view page send notifications different roles.i want disable checkboxes in unchecked state initially.

i working following code in view

<div ng-repeat="notification in notificationlist  | filter:{media: item.media}" ng-if="!collapsednotification" ng-class="{'pad-top-4':($first)}" >                                     <label for="notificationlabel" class="col-sm-4 col-md-4 col-lg-4 control-label font-normal" title="{{notification.notificationlabel}}">{{notification.notificationlabel}}</label>                             <div class="col-sm-1 col-md-1 col-lg-1"  style="line-height:35px;">                                 <span  class="col-lg-2 col-md-2 col-sm-2 item-padding ">                                     <span class="default-pointer" ng-checkbox  ng-init="toadmin=false" ng-model='toadmin' ng-click="disableclick()" ng-disabled="toadmin"></input>                                  </span>                              </div>                             <div class="col-sm-1 col-md-1 col-lg-1" style="line-height:35px;">                                 <span  class="col-lg-2 col-md-2 col-sm-2 item-padding ">                                     <span class="default-pointer" ng-checkbox ng-model='notification.tonutritionist'></span>                                                                         </span>                             </div>                             <div class="col-sm-1 col-md-1 col-lg-1"  style="line-height:35px;">                                 <span  class="col-lg-2 col-md-2 col-sm-2 item-padding ">                                     <span class="default-pointer"  ng-checkbox ng-model='notification.topatient'></span>                                                                         </span>                             </div>                                    </div> 

how can disable checkboxes(in unchecked state) specific roles in controller using angularjs?

you can use ng-disabled property.

like example :

<input type="checkbox" ng-click="disable=!disable">  <input type="checkbox" ng-disabled="disable"> 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -