Updating Shell (ApplicationView) based on childView


#1

I am trying something a little different. I am using the ApplicationView to either display the outlet child view or a login page depending on their authentication status. This all works great, except some pages don’t require authentication. I need some method in the ApplicationView to determine if the current child view require authentication and either show the outlet or the login window.

Does this make sense?

-Steve


#2

If you’re still having trouble, can you create a emberjs.jsbin.com that shows what you’re trying to do?


#3

I think you might be going about this the wrong way. You should be thinking of your application in terms of routes, which almost always makes your code more organized and easier to understand.

For example, in my application I handle the login question using routes. I have two base routes in my app, one named LoggedInRoute and another named LoggedOutRoute. The LoggedInRoute has a bit of logic that checks for the current_user and redirects to the login page if the user is not found. This way, any routes that need to be behind a login wall can just extend my LoggedInRoute.

I’m sure you could find a way to update the application view based on a child view, but it will probably result in more frustration in the end.

Good luck, and hope you find a solution!