aboutsummaryrefslogtreecommitdiff
path: root/src/app/messages.service.ts
blob: 0d323bb2427d5af7cd3ab5cd29f56b3d629def21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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='';
  }
}