From 5bcb1b97d88cba6431b609ddb83e0ce4dcfa3a1f Mon Sep 17 00:00:00 2001 From: Ronit Jadhav Date: Wed, 10 Jan 2024 10:32:21 +0100 Subject: [PATCH] Fixed null injector error for map-viewer app --- apps/map-viewer/src/app/app.module.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/map-viewer/src/app/app.module.ts b/apps/map-viewer/src/app/app.module.ts index aa85a6b4cc..933ebd3ed3 100644 --- a/apps/map-viewer/src/app/app.module.ts +++ b/apps/map-viewer/src/app/app.module.ts @@ -1,4 +1,4 @@ -import { NgModule } from '@angular/core' +import { importProvidersFrom, NgModule } from '@angular/core' import { BrowserModule } from '@angular/platform-browser' import { AppComponent } from './app.component' @@ -15,6 +15,10 @@ import { EffectsModule } from '@ngrx/effects' import { storeFreeze } from 'ngrx-store-freeze' import { environment } from '../environments/environment' import { provideRepositoryUrl } from '@geonetwork-ui/api/repository' +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { provideGn4 } from '@geonetwork-ui/api/repository/gn4' +import { FeatureAuthModule } from '@geonetwork-ui/feature/auth' +import { FeatureCatalogModule } from '@geonetwork-ui/feature/catalog' export const metaReducers: MetaReducer[] = !environment.production ? [storeFreeze] @@ -24,14 +28,20 @@ export const metaReducers: MetaReducer[] = !environment.production declarations: [AppComponent], imports: [ BrowserModule, + BrowserAnimationsModule, FeatureMapModule, TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG), UtilI18nModule, StoreModule.forRoot({}, { metaReducers }), StoreDevtoolsModule.instrument(), EffectsModule.forRoot(), + FeatureCatalogModule, + ], + providers: [ + importProvidersFrom(FeatureAuthModule), + provideRepositoryUrl('/geonetwork/srv/api'), + provideGn4(), ], - providers: [provideRepositoryUrl('/geonetwork/srv/api')], bootstrap: [AppComponent], }) export class AppModule {