0

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 1

0

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;
}
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.