mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
feat(challenge 7): begin ngrx notification work
This commit is contained in:
32
apps/ngrx-notification/src/main.ts
Normal file
32
apps/ngrx-notification/src/main.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { APP_INITIALIZER, enableProdMode, inject } from '@angular/core';
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
import { AppComponent } from './app/app.component';
|
||||
import { PushService } from './app/backend/push.service';
|
||||
import { NotificationService } from './app/data-access/notification.service';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
bootstrapApplication(AppComponent, {
|
||||
providers: [
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
inject(PushService).init();
|
||||
return () => of(true);
|
||||
},
|
||||
},
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
useFactory: () => {
|
||||
inject(NotificationService).init();
|
||||
return () => of(true);
|
||||
},
|
||||
},
|
||||
],
|
||||
}).catch((err) => console.error(err));
|
||||
Reference in New Issue
Block a user