jeudi 30 juillet 2015

How to disable the checkbox in angularjs

I have a list of checkboxes on view page for to send notifications for different roles.I want to disable some checkboxes in unchecked state initially.

I am working with 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 i disable the checkboxes(in unchecked state) for specific roles in controller using angularjs?




Aucun commentaire:

Enregistrer un commentaire