mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
feat(doc): move notifivation
This commit is contained in:
47
apps/ngrx/notification/src/app/app.config.ts
Normal file
47
apps/ngrx/notification/src/app/app.config.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
import { provideStore } from '@ngrx/store';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { TeacherEffects } from './teacher/store/teacher.effects';
|
||||
import { StudentEffects } from './student/store/student.effects';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { ROUTES } from './routes';
|
||||
import { APP_INITIALIZER, inject } from '@angular/core';
|
||||
import { FakeBackendService } from '@angular-challenges/ngrx-notification/backend';
|
||||
import { NotificationService } from './data-access/notification.service';
|
||||
import {
|
||||
teacherReducer,
|
||||
teachersFeatureKey,
|
||||
} from './teacher/store/teacher.reducer';
|
||||
import {
|
||||
studentReducer,
|
||||
studentsFeatureKey,
|
||||
} from './student/store/student.reducer';
|
||||
|
||||
const REDUCERS = {
|
||||
[teachersFeatureKey]: teacherReducer,
|
||||
[studentsFeatureKey]: studentReducer,
|
||||
};
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideStore(REDUCERS),
|
||||
provideEffects([TeacherEffects, StudentEffects]),
|
||||
provideRouter(ROUTES),
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
const service = inject(FakeBackendService);
|
||||
return () => service.start();
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
const service = inject(NotificationService);
|
||||
return () => service.init();
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user