mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-10 12:53:03 -05:00
fix(ngrx-notification): compilation error
Due to upgrading to Angular 16, `REDUCERS` were in the incorrect file and should have been moved to `app.config.ts` from `main.ts`.
This commit is contained in:
@@ -5,9 +5,23 @@ 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, enableProdMode, inject } from '@angular/core';
|
||||
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),
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
import { appConfig } from './app/app.config';
|
||||
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
import {
|
||||
studentReducer,
|
||||
studentsFeatureKey,
|
||||
} from './app/student/store/student.reducer';
|
||||
|
||||
import {
|
||||
teacherReducer,
|
||||
teachersFeatureKey,
|
||||
} from './app/teacher/store/teacher.reducer';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
const REDUCERS = {
|
||||
[teachersFeatureKey]: teacherReducer,
|
||||
[studentsFeatureKey]: studentReducer,
|
||||
};
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig).catch((err) =>
|
||||
console.error(err)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user