diff --git a/demos/angular-capacitor/src/app/app.module.ts b/demos/angular-capacitor/src/app/app.module.ts index 3a3ccd9..d8c8da2 100644 --- a/demos/angular-capacitor/src/app/app.module.ts +++ b/demos/angular-capacitor/src/app/app.module.ts @@ -1,13 +1,13 @@ -import { NgModule } from '@angular/core'; +import { NgModule, APP_INITIALIZER } from '@angular/core'; import { RouteReuseStrategy } from '@angular/router'; import { HttpClientModule } from '@angular/common/http'; import { BrowserModule } from '@angular/platform-browser'; - import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { CoreModule } from './core/core.module'; +import {AuthService} from "../../../../lib"; @NgModule({ declarations: [AppComponent], @@ -19,7 +19,12 @@ import { CoreModule } from './core/core.module'; CoreModule ], providers: [ - { provide: RouteReuseStrategy, useClass: IonicRouteStrategy } + { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, + { + provide: APP_INITIALIZER, + useFactory: (authService: AuthService) => authService.init(), + deps: [AuthService] + }, ], bootstrap: [AppComponent] })