mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 13:33:03 +00:00
fix AoT issues with store devtools
This commit is contained in:
@@ -45,54 +45,72 @@ export function getMetaReducers(config: GlobalConfig): Array<MetaReducer<AppStat
|
|||||||
return config.debug ? [...metaReducers, ...debugMetaReducers] : metaReducers;
|
return config.debug ? [...metaReducers, ...debugMetaReducers] : metaReducers;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEV_MODULES: any[] = [];
|
const IMPORTS = [
|
||||||
|
CommonModule,
|
||||||
|
SharedModule,
|
||||||
|
HttpClientModule,
|
||||||
|
AppRoutingModule,
|
||||||
|
CoreModule.forRoot(),
|
||||||
|
NgbModule.forRoot(),
|
||||||
|
TranslateModule.forRoot(),
|
||||||
|
EffectsModule.forRoot(appEffects),
|
||||||
|
StoreModule.forRoot(appReducers),
|
||||||
|
StoreRouterConnectingModule,
|
||||||
|
];
|
||||||
|
|
||||||
|
IMPORTS.push(
|
||||||
|
StoreDevtoolsModule.instrument({
|
||||||
|
maxAge: 100,
|
||||||
|
logOnly: ENV_CONFIG.production,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const PROVIDERS = [
|
||||||
|
{
|
||||||
|
provide: GLOBAL_CONFIG,
|
||||||
|
useFactory: (getConfig)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: APP_BASE_HREF,
|
||||||
|
useFactory: (getBase)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: META_REDUCERS,
|
||||||
|
useFactory: getMetaReducers,
|
||||||
|
deps: [GLOBAL_CONFIG]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: RouterStateSerializer,
|
||||||
|
useClass: DSpaceRouterStateSerializer
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const DECLARATIONS = [
|
||||||
|
AppComponent,
|
||||||
|
HeaderComponent,
|
||||||
|
FooterComponent,
|
||||||
|
PageNotFoundComponent,
|
||||||
|
NotificationComponent,
|
||||||
|
NotificationsBoardComponent
|
||||||
|
];
|
||||||
|
|
||||||
|
const EXPORTS = [
|
||||||
|
AppComponent
|
||||||
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
...IMPORTS
|
||||||
SharedModule,
|
|
||||||
HttpClientModule,
|
|
||||||
AppRoutingModule,
|
|
||||||
CoreModule.forRoot(),
|
|
||||||
NgbModule.forRoot(),
|
|
||||||
TranslateModule.forRoot(),
|
|
||||||
EffectsModule.forRoot(appEffects),
|
|
||||||
StoreModule.forRoot(appReducers),
|
|
||||||
StoreDevtoolsModule.instrument({
|
|
||||||
maxAge: 25, // Retains last 25 states
|
|
||||||
logOnly: getConfig().production, // Restrict extension to log-only mode
|
|
||||||
}),
|
|
||||||
StoreRouterConnectingModule,
|
|
||||||
...DEV_MODULES
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
...PROVIDERS
|
||||||
provide: GLOBAL_CONFIG,
|
|
||||||
useFactory: (getConfig)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provide: APP_BASE_HREF,
|
|
||||||
useFactory: (getBase)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provide: META_REDUCERS,
|
|
||||||
useFactory: getMetaReducers,
|
|
||||||
deps: [GLOBAL_CONFIG]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
provide: RouterStateSerializer,
|
|
||||||
useClass: DSpaceRouterStateSerializer
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
AppComponent,
|
...DECLARATIONS
|
||||||
HeaderComponent,
|
|
||||||
FooterComponent,
|
|
||||||
PageNotFoundComponent,
|
|
||||||
NotificationComponent,
|
|
||||||
NotificationsBoardComponent
|
|
||||||
],
|
],
|
||||||
exports: [AppComponent]
|
exports: [
|
||||||
|
...EXPORTS
|
||||||
|
]
|
||||||
})
|
})
|
||||||
export class AppModule {
|
export class AppModule {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user