mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 22:03:03 -05:00
chore(version): update to version 16
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"rules": {
|
||||
@@ -29,7 +29,7 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nrwl/linter:eslint",
|
||||
"executor": "@nx/linter:eslint",
|
||||
"options": {
|
||||
"lintFilePatterns": [
|
||||
"apps/ngrx-notification/**/*.ts",
|
||||
|
||||
33
apps/ngrx-notification/src/app/app.config.ts
Normal file
33
apps/ngrx-notification/src/app/app.config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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, enableProdMode, inject } from '@angular/core';
|
||||
import { FakeBackendService } from '@angular-challenges/ngrx-notification/backend';
|
||||
import { NotificationService } from './data-access/notification.service';
|
||||
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();
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,18 +1,14 @@
|
||||
import { FakeBackendService } from '@angular-challenges/ngrx-notification/backend';
|
||||
import { APP_INITIALIZER, enableProdMode, inject } from '@angular/core';
|
||||
import { appConfig } from './app/app.config';
|
||||
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { provideStore } from '@ngrx/store';
|
||||
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { NotificationService } from './app/data-access/notification.service';
|
||||
import { ROUTES } from './app/routes';
|
||||
import { StudentEffects } from './app/student/store/student.effects';
|
||||
|
||||
import {
|
||||
studentReducer,
|
||||
studentsFeatureKey,
|
||||
} from './app/student/store/student.reducer';
|
||||
import { TeacherEffects } from './app/teacher/store/teacher.effects';
|
||||
|
||||
import {
|
||||
teacherReducer,
|
||||
teachersFeatureKey,
|
||||
@@ -28,26 +24,6 @@ const REDUCERS = {
|
||||
[studentsFeatureKey]: studentReducer,
|
||||
};
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
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();
|
||||
},
|
||||
},
|
||||
],
|
||||
}).catch((err) => console.error(err));
|
||||
bootstrapApplication(AppComponent, appConfig).catch((err) =>
|
||||
console.error(err)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user