@@ -2,22 +2,23 @@ import { NgModule } from '@angular/core';
2
2
import { Routes , RouterModule } from '@angular/router' ;
3
3
import { HomeComponent } from './home/home.component' ;
4
4
import { ProtectedComponent } from './protected/protected.component' ;
5
- import { AngularFireAuthGuard } from '@angular/fire/auth-guard' ;
5
+ import { AngularFireAuthGuard , canActivate , isNotAnonymous } from '@angular/fire/auth-guard' ;
6
6
import { SecondaryComponent } from './secondary/secondary.component' ;
7
7
8
8
const 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' } ,
12
12
{ path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] } ,
13
+ { path : 'lazy' , loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) } ,
13
14
{ path : 'protected-lazy' ,
14
15
loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) ,
15
16
canActivate : [ AngularFireAuthGuard ] } ,
16
17
{ path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] , outlet : 'secondary' } ,
17
18
{ path : 'protected' , component : ProtectedComponent , canActivate : [ AngularFireAuthGuard ] , outlet : 'tertiary' } ,
18
19
{ path : 'protected-lazy' ,
19
20
loadChildren : ( ) => import ( './protected-lazy/protected-lazy.module' ) . then ( m => m . ProtectedLazyModule ) ,
20
- canActivate : [ AngularFireAuthGuard ] ,
21
+ ... canActivate ( ( ) => isNotAnonymous ) ,
21
22
outlet : 'secondary' } ,
22
23
] ;
23
24
0 commit comments