Reputation: 2795
Bootstrap components (model, tab, dropdown) are not working when switching the routes in EmberJs
I have two {{outlet}} in my application.hbs, one for login and other for all other pages.
{{#if isLoggedIn}}
<div class="main">{{outlet}}<div>
{{else}}
<div class="login">{{outlet}}</div>
{{/if}}
Initially the bootstrap components are working fine, If i transition to login and come back to other routes then the components in other routes are not working.
The tabs worked before are not clickable. The dropdown menu are not clickable. The model is not showing up on clicking on button.
If i use same outlet for both routes then it works fine.
Upvotes: 0
Views: 143
Reputation: 1015
On a transition change, ember drastically modifies the DOM. This means on every change in DOM structure you have to reinitialize your bootstrap components.
To solve this issue you got two options.
didInsertElement
hook.I would stick to way 2.
Upvotes: 1