Some refactoring
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// angular modules
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector } from '@angular/core';
|
||||
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector,Optional,SkipSelf } from '@angular/core';
|
||||
import { CommonModule, DatePipe } from '@angular/common';
|
||||
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
@@ -137,6 +137,12 @@ export {FolderService,
|
||||
]
|
||||
})
|
||||
export class AppCommonModule {
|
||||
constructor (@Optional() @SkipSelf() parentModule: AppCommonModule) {
|
||||
if (parentModule) {
|
||||
throw new Error(
|
||||
'AppCommonModule is already loaded. Import it in the AppModule only');
|
||||
}
|
||||
}
|
||||
static forRoot(): ModuleWithProviders {
|
||||
return {
|
||||
ngModule: AppCommonModule,
|
||||
@@ -152,19 +158,7 @@ export class AppCommonModule {
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: AccessTokenInterceptor,
|
||||
multi: true
|
||||
},
|
||||
ResumableFileUploadService,
|
||||
EventService,
|
||||
FolderService,
|
||||
UserService,
|
||||
ItemService,
|
||||
TypeaheadService,
|
||||
AuthCallbackGuard,
|
||||
AuthGuard,
|
||||
NavBarGuard,
|
||||
FullScreenGuard,
|
||||
TimespanService,
|
||||
ItemTypeService
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user