summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/components/error/error.component.service.ts
blob: c573d16e970793b20e8a84d3e17099e796820e3f (plain)
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
import {Injectable} from "@angular/core";
import {MessageBoxService } from '../messageBox/messageBox.service';
import {MessageBoxData} from '../messageBox/messageBox.data';
import { SdcUiCommon} from "onap-ui-angular";
@Injectable()
export class ErrorService {
  static showErrorWithMessage(error : ErrorMessage) : void {
    setTimeout(()=>{
        let messageBoxData : MessageBoxData = new MessageBoxData(
          error.title,
          error.text,
          SdcUiCommon.ModalType.error,
          SdcUiCommon.ModalSize.medium,
          [
            {text:"Close", size:"large", closeModal:true}
          ]);
        MessageBoxService.openModal.next(messageBoxData);
      }
      ,500);
  }
}

export class ErrorMessage {
  title : string;
  text : string;
  errorNumber : number;

  constructor( title : string, text : string,errorNumber : number){
    this.title = title;
    this.text = text;
    this.errorNumber = errorNumber;
  }
}