3

I'm trying to use Bootstrap-Toggle in a Angular2 project and I can't get it working.

I did some debugging and I it see properly displaying but after all the initialization occurs it goes back to a normal checkbox.

It appears the problem has to due with Bootstrap-Toggle adding elements directly to the DOM.

How can I get Bootstrap-Toggle working in Angular2?

Bootstrap-Toggle checkbox

1
  • 1
    Hey there, It'd be better if you can add the code that you're writing to make this work. So that we can help. How are you doing that? Commented Sep 17, 2017 at 10:00

1 Answer 1

1

you need to initialize it with java script like that in ngOninit() in your component relative to that template

ngOninit(){
  $("#toggleId").bootstrapToggle();
}
Sign up to request clarification or add additional context in comments.

Comments

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.