Skip to content
Snippets Groups Projects
Commit 9446cea3 authored by mathias.chouet's avatar mathias.chouet
Browse files

Removed unused code

parent c2770dc3
No related branches found
No related tags found
1 merge request!96WIP: Resolve "Simplifier les composants de résultats"
...@@ -8,7 +8,6 @@ import { CdkDragDrop, moveItemInArray } from "@angular/cdk/drag-drop"; ...@@ -8,7 +8,6 @@ import { CdkDragDrop, moveItemInArray } from "@angular/cdk/drag-drop";
import { Observer, jalhydDateRev, jalhydVersion, CalculatorType, Session } from "jalhyd"; import { Observer, jalhydDateRev, jalhydVersion, CalculatorType, Session } from "jalhyd";
import { I18nService } from "./services/internationalisation.service"; import { I18nService } from "./services/internationalisation.service";
import { ErrorService } from "./services/error.service";
import { FormulaireService } from "./services/formulaire.service"; import { FormulaireService } from "./services/formulaire.service";
import { FormulaireDefinition } from "./formulaire/definition/form-definition"; import { FormulaireDefinition } from "./formulaire/definition/form-definition";
import { ServiceFactory } from "./services/service-factory"; import { ServiceFactory } from "./services/service-factory";
...@@ -43,8 +42,7 @@ declare let device: any; ...@@ -43,8 +42,7 @@ declare let device: any;
@Component({ @Component({
selector: "nghyd-app", selector: "nghyd-app",
templateUrl: "./app.component.html", templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"], styleUrls: ["./app.component.scss"]
providers: [ErrorService]
}) })
export class AppComponent implements OnInit, OnDestroy, Observer { export class AppComponent implements OnInit, OnDestroy, Observer {
...@@ -81,7 +79,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -81,7 +79,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
constructor( constructor(
private intlService: I18nService, private intlService: I18nService,
private appSetupService: ApplicationSetupService, private appSetupService: ApplicationSetupService,
private errorService: ErrorService,
private router: Router, private router: Router,
private formulaireService: FormulaireService, private formulaireService: FormulaireService,
private httpService: HttpService, private httpService: HttpService,
...@@ -279,12 +276,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -279,12 +276,10 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
*/ */
ngOnInit() { ngOnInit() {
this.formulaireService.addObserver(this); this.formulaireService.addObserver(this);
this.subscribeErrorService();
this._innerWidth = window.innerWidth; this._innerWidth = window.innerWidth;
} }
ngOnDestroy() { ngOnDestroy() {
this.unsubscribeErrorService();
this.formulaireService.removeObserver(this); this.formulaireService.removeObserver(this);
} }
...@@ -411,17 +406,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -411,17 +406,6 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
return fits; return fits;
} }
/**
* abonnement au service d'erreurs
*/
private subscribeErrorService() {
this.errorService.addObserver(this);
}
private unsubscribeErrorService() {
this.errorService.removeObserver(this);
}
public get enableHeaderDoc(): boolean { public get enableHeaderDoc(): boolean {
return this.currentRoute === "/list" && this._calculators.length === 0; return this.currentRoute === "/list" && this._calculators.length === 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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment