@@ -2,35 +2,32 @@ import {NgModule} from '@angular/core';
22import { BrowserModule } from '@angular/platform-browser' ;
33import { AppComponent } from './app.component' ;
44import { RouterModule } from "@angular/router" ;
5- import { HomePageComponent } from './home-page/home-page.component' ;
65//tag::importAngularSDK[]
76import { FusionAuthModule } from "@fusionauth/angular-sdk" ;
87//end::importAngularSDK[]
9- import { AccountPageComponent } from './account-page/account-page.component' ;
108//tag::importAuthGuard[]
119import { authGuard } from "./auth-guard" ;
1210//end::importAuthGuard[]
1311
1412@NgModule ( {
1513 declarations : [
16- AppComponent ,
17- HomePageComponent ,
18- AccountPageComponent
14+ AppComponent
1915 ] ,
2016 imports : [
2117 BrowserModule ,
2218 //tag::routerConfiguration[]
2319 RouterModule . forRoot ( [
24- { path : '' , component : HomePageComponent , canActivate : [ authGuard ( false , '/account' ) ] } ,
25- { path : 'account' , component : AccountPageComponent , canActivate : [ authGuard ( true , '/' ) ] }
20+ { path : '' , loadComponent : ( ) => import ( './home-page/home-page.component' ) . then ( m => m . HomePageComponent ) , canActivate : [ authGuard ( false , '/account' ) ] } ,
21+ { path : 'account' , loadComponent : ( ) => import ( './account-page/account-page.component' ) . then ( m => m . AccountPageComponent ) , canActivate : [ authGuard ( true , '/' ) ] } ,
22+ { path : 'make-change' , loadComponent : ( ) => import ( './make-change-page/make-change-page.component' ) . then ( m => m . MakeChangePageComponent ) , canActivate : [ authGuard ( true , '/' ) ] } ,
2623 ] ) ,
2724 //end::routerConfiguration[]
2825 //tag::fusionAuthModuleConfiguration[]
2926 FusionAuthModule . forRoot ( {
3027 clientId : 'e9fdb985-9173-4e01-9d73-ac2d60d1dc8e' ,
3128 serverUrl : 'http://localhost:9011' ,
3229 redirectUri : 'http://localhost:4200' ,
33- } )
30+ } ) ,
3431 //end::fusionAuthModuleConfiguration[]
3532 ] ,
3633 providers : [ ] ,
0 commit comments