@@ -2,22 +2,23 @@ import { NgModule } from '@angular/core';
22import { Routes , RouterModule } from '@angular/router' ;
33import { HomeComponent } from './home/home.component' ;
44import { ProtectedComponent } from './protected/protected.component' ;
5- import { AngularFireAuthGuard } from '@angular/fire/auth-guard' ;
5+ import { AngularFireAuthGuard , canActivate , isNotAnonymous } from '@angular/fire/auth-guard' ;
66import { SecondaryComponent } from './secondary/secondary.component' ;
77
88const routes : Routes = [
9- { path : '' , component : HomeComponent , outlet : 'primary' } ,
10- { path : '' , component : SecondaryComponent , outlet : 'secondary' } ,
11- { path : '' , component : SecondaryComponent , outlet : 'tertiary' } ,
9+ { path : '' , component : HomeComponent , outlet : 'primary' , pathMatch : 'prefix' } ,
10+ { path : '' , component : SecondaryComponent , outlet : 'secondary' , pathMatch : 'prefix' } ,
11+ { path : '' , component : SecondaryComponent , outlet : 'tertiary' , pathMatch : 'prefix' } ,
1212 { path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] } ,
13+ { path : 'lazy' , loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) } ,
1314 { path : 'protected-lazy' ,
1415 loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) ,
1516 canActivate : [ AngularFireAuthGuard ] } ,
1617 { path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] , outlet : 'secondary' } ,
1718 { path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] , outlet : 'tertiary' } ,
1819 { path : 'protected-lazy' ,
1920 loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) ,
20- canActivate : [ AngularFireAuthGuard ] ,
21+ ... canActivate ( ( ) => isNotAnonymous ) ,
2122 outlet : 'secondary' } ,
2223] ;
2324
0 commit comments