diff --git a/src/app/app.config.ts b/src/app/app.config.ts index e0edaec89324e48efb4369286f98204860704e85..0821e9838e1d4a91cb5a820e1d9ced659336573f 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -2,12 +2,11 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { environment } from '../environments/environment'; import { IAppConfig } from './models/app-config.model'; -import { LocalStorageShareService } from './services/http/local-storage-share.service'; @Injectable() export class AppConfig { static settings: IAppConfig; - constructor(private http: HttpClient, private localStorageShareService: LocalStorageShareService) { + constructor(private http: HttpClient) { } load() { const jsonFile = `assets/config/config.${environment.name}.json`; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ee0157fe4eeac8b4e7458764790230847b041ab5..5d6a2954fb5edf5b7a5064808778d0a6d9e50f25 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -62,6 +62,7 @@ import { SpacyService } from './services/http/spacy.service'; import { QuizNowComponent } from './components/shared/quiz-now/quiz-now.component'; import { JoyrideModule } from 'ngx-joyride'; import { QuillModule } from 'ngx-quill'; +import { LocalStorageShareService } from './services/http/local-storage-share.service'; import 'prismjs'; import 'prismjs/plugins/line-numbers/prism-line-numbers.js'; @@ -152,7 +153,7 @@ export function initializeApp(appConfig: AppConfig) { AppConfig, { provide: APP_INITIALIZER, useFactory: initializeApp, - deps: [AppConfig], multi: true + deps: [AppConfig, LocalStorageShareService], multi: true }, { provide: HTTP_INTERCEPTORS, diff --git a/src/app/services/http/local-storage-share.service.ts b/src/app/services/http/local-storage-share.service.ts index f8e50eb68d3c061b444aa96c1c9f89c99a4443ac..0b2cef8b07a2b9c2c20c4388ca8ba81efa18f3c4 100644 --- a/src/app/services/http/local-storage-share.service.ts +++ b/src/app/services/http/local-storage-share.service.ts @@ -1,12 +1,15 @@ import { Injectable } from '@angular/core'; +import { NotificationService } from '../util/notification.service'; @Injectable({ providedIn: 'root' }) export class LocalStorageShareService { - constructor() { + constructor(private notficiationService: NotificationService) { window.addEventListener('message', this.messageHandler, false); + + this.notficiationService.show("hey"); } messageHandler(event) {