I am using angular-bootstrap-toggle https://github.com/ziscloud/angular-bootstrap-toggle#demo I am trying to find a way to put it in to a disable state.
1 Answer
If you want to use ng-disable to disable the toggle class from the angular-bootstrap-toggle, then you can check this issue.
Other wise there exist a more hackable way to do this, add ng-class="{disabled : your_condition_here}" in your toogle. Like the code below
<toggle ng-model="toggleValue" ng-change="changed()" ng-class="{disabled : true}"></toggle>
and add below to your css file
toggle.disabled {
cursor: not-allowed;
pointer-events: none;
box-shadow: none;
opacity: 0.65;
}
1 Comment
Hubert Kubiak
It did the job! Maybe it's a hack but still better than editing the library (like suggested in the Github discussion you linked to). In my case this hacky behavior is acceptable.