I'm building an Angular 2 app and need two layout files. One for the logged out users... (Login/Register views etc) and one for the logged in users to see the actual app itself. How can this be achieved with Angular 2?
Currently I have an app.component.html
that simply has
<main-navbar></main-navbar>
<router-outlet></router-outlet>
But what I need to do is something along the lines of:
<div [ngSwitch]="layout">
<template [ngSwitchCase]="panelLayout">
/* output all the html layout elements for the logged out views */
<router-outlet></router-outlet>
<template>
<template [ngSwitchCase]="appLayout">
/* output all the html elements for the in logged in/app views */
<router-outlet></router-outlet>
</template>
</div>
But I have no idea where or how to set the layout
variable.
I'm presuming this variable would best be set inside the main view component... or is there a better way to do this?