Hello there dear internet! First of all ng is great, thanks for this amazing frontend technology.
We are currently having a hard time with routes and the app layout structure. How can we implement multiple HomeLayoutComponents and depending on a state (e.g. isLoggedIn) redefine which one to use as a default!?
What we want to achieve is a one page app experience where the user can browse the app (StartComponent), read some infos and once logged in, gets the app presented without having to leave the root url context (route: '').
On logout the user gets to see the LoginComponent as a default again.
App
- Directs the user to either StartHome (route: '') or Dashboard (route: '')
HomeLayoutComponent
- HomeLayoutComponent contains or similar functionality, making possible to have a completely own layout instead of hiding html parts.
- Ohter Components can pass content the HomeLayout without making use of ChildRoutes.
Despite the route, our biggest problem is our or app will have a total different html layout depending on the authentification state. We are aware of some other approaches and they do not work out. Does anyone have a clue on how to do this with the current release or ahead of time?
[3]: Some say on gitter to use the setRoot method dynamically, but no clue how, no example found which would help to implement the requirement described in this question.