UNPKG

@cause-911/core

Version:

Run `npm install @cause-911/core --save` to add this library to your project

56 lines (39 loc) 1.3 kB
# @cause-911/core Run `npm install @cause-911/core --save` to add this library to your project ## To use this library, you need to import the module with specific configuration ``` @NgModule({ imports: [ CoreModule.forRoot({ languages: ['fr', 'en'] } as CoreModuleOptions), ] }); ``` See CoreModuleOptions class for more available options. ## Automatically added by this library - HttpClientModule (@angular/common/http) - TranslateModule (@ngx-translate/core) ## Component - PageNotFoundComponent - Ajouter le path `**` dans le routing ``` { path: '**', component: PageNotFoundComponent, } ``` ## Service - TranslateService - from @cause-911/core is directly the TranslateService form @ngx-translate/core - CoreService - getConfig() : return active configuration - ApiLookupService - ClientInformationService - FullscreenService - NetworkInformationService ## Interceptor implemented by this library - HttpOfflineInterceptor : Catch HttpClient when client is offline - HttpTokenWriterInterceptor : When exist, add "Authorization token" and "CSRF token" on HttpClient - HttpTokenReaderInterceptor : Read "CSRF token" on HttpClient - HttpErrorInterceptor : Catch HttpClient error and in an @angular/snackbar