Created
July 26, 2020 02:47
-
-
Save changhuixu/a654a11e0ecb839ff469c46227a1d05b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NgModule({ | |
declarations: [], | |
imports: [CommonModule], | |
providers: [ | |
{ | |
provide: APP_INITIALIZER, | |
useFactory: appInitializer, | |
multi: true, | |
deps: [AuthService], | |
}, | |
{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true }, | |
{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: UnauthorizedInterceptor, | |
multi: true, | |
}, | |
], | |
}) | |
export class CoreModule { | |
constructor(@Optional() @SkipSelf() core: CoreModule) { | |
if (core) { | |
throw new Error('Core Module can only be imported to AppModule.'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment