diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 364b60d6bb4fc01efd71b9bfa8118c79fa03961d..01ddce6dd0e2eca54c061a0bf6ffee385848b23c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -9,7 +9,6 @@ import { Observer, jalhydDateRev, jalhydVersion, CalculatorType, Session } from import { environment } from "../environments/environment"; import { I18nService } from "./services/internationalisation.service"; -import { ErrorService } from "./services/error.service"; import { FormulaireService } from "./services/formulaire.service"; import { FormulaireDefinition } from "./formulaire/definition/form-definition"; import { ServiceFactory } from "./services/service-factory"; @@ -46,8 +45,7 @@ declare let device: any; @Component({ selector: "nghyd-app", templateUrl: "./app.component.html", - styleUrls: ["./app.component.scss"], - providers: [ErrorService] + styleUrls: ["./app.component.scss"] }) export class AppComponent implements OnInit, OnDestroy, Observer { @@ -84,7 +82,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer { constructor( private intlService: I18nService, private appSetupService: ApplicationSetupService, - private errorService: ErrorService, private router: Router, private formulaireService: FormulaireService, private httpService: HttpService, @@ -277,12 +274,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer { */ ngOnInit() { this.formulaireService.addObserver(this); - this.subscribeErrorService(); this._innerWidth = window.innerWidth; } ngOnDestroy() { - this.unsubscribeErrorService(); this.formulaireService.removeObserver(this); } @@ -409,17 +404,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer { return fits; } - /** - * abonnement au service d'erreurs - */ - private subscribeErrorService() { - this.errorService.addObserver(this); - } - - private unsubscribeErrorService() { - this.errorService.removeObserver(this); - } - public get enableHeaderDoc(): boolean { return this.currentRoute === "/list" && this._calculators.length === 0; } diff --git a/src/app/services/error.service.ts b/src/app/services/error.service.ts deleted file mode 100644 index 25288f4fefb73395bdfa37bf73ca71bf4877382b..0000000000000000000000000000000000000000 --- a/src/app/services/error.service.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Injectable } from "@angular/core"; - -import { Observable } from "jalhyd"; - -@Injectable() -export class ErrorService extends Observable { - // TODO: add explicit constructor - - doAlert(m: string) { - this.notifyObservers(m); - } -}