I am using Angular 4
project and I have used ngSwitch
to switch multiple layouts based on condition. So, at this time, I am getting error cannot find primary outlet to load Component
. It is because of router-outlet
but what is the best way to solve this ?
Code :
<div [ngSwitch]="isAuthenticated()">
<div *ngSwitchCase="true">
<div id="wrapper">
<navbar></navbar>
<div class="gray-bg">
<router-outlet></router-outlet>
<footer></footer>
</div>
</div>
</div>
<div *ngSwitchCase="false">
<div class="blue">
<router-outlet></router-outlet>
<footer></footer>
</div>
</div>
</div>