简体   繁体   中英

ember issue with template sidebar display

With Ember I have a login page that I do not want to display the header/sidebar navigation for my site. Once isAuthenticated then I want them to show. I can get this to work by checking for session.isAuthenticated in application.hbs. If true I show the header and sidebar if not I do not display them.

This all works but once I login and transition to the default authenticated route the javascript for the sidebar dropdown does not work. When I click the links nothing happens. If I then transition to a different route they work. I'm guessing it's since I am not generating them when I first load the page because I am not authenticated.

Is there a better way to handle this or force a reload of the javascript?

EDIT: Here is a gist of the application.hbs and sidebar.js files:

Gist Files

安装了ember-metismenu,问题消失了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM