import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class MessagesService { private error:string; private warning:string; private info:string; private success:string; constructor() { } getError() :string{ return this.error; } pushError(errorText:string){ this.error = errorText; } dismissError(){ this.error=''; } getWarning() :string{ return this.warning; } pushWarning(errorText:string){ this.warning = errorText; } dismissWarning(){ this.warning=''; } getSuccess() :string{ return this.success; } pushSuccess(errorText:string){ this.success = errorText; } dismissSuccess(){ this.success=''; } getInformation() :string{ return this.info; } pushInformation(errorText:string){ this.info = errorText; } dismissInformation(){ this.info=''; } }