merge from ecomp a88f0072 - Modern UI
[vid.git] / vid-webpack-master / src / app / shared / components / error-msg / error-msg.component.ts
1 import {Component, OnChanges, SimpleChanges} from '@angular/core';
2 import {ErrorMsgService} from "./error-msg.service";
3 import {ErrorMsgObject} from "./error-msg.model";
4
5 @Component({
6   selector: 'error-msg',
7   templateUrl: './error-msg.component.html',
8   styleUrls: ['./error-msg.component.scss']
9 })
10
11 export class ErrorMsgComponent implements OnChanges {
12
13   errorMsgService: ErrorMsgService;
14   constructor(private _errorMsgService: ErrorMsgService) {
15     this.errorMsgService = _errorMsgService;
16     this._errorMsgService.triggerShowError.subscribe((error: ErrorMsgObject) => {
17       this.errorMsgService.errorMsgObject = error;
18     });
19
20     this._errorMsgService.triggerClearError.subscribe(() => {
21       this.errorMsgService.errorMsgObject = null;
22     });
23   }
24
25   ngOnChanges(changes: SimpleChanges): void {
26   }
27 }
28