RackHD/on-web-ui

View on GitHub
src/app/services/core/global-alert.service.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';

@Injectable()
export class GlobalAlertService {
  alertQueue: Subject<any>;
  constructor(){
    this.alertQueue = new Subject<any>();
  }


  putAlertMsg(msg: string, type: string = 'modal'): void{
    this.alertQueue.next({msg: msg, type: type});
  }

  getAlertQueue(): Subject<any>{
    return this.alertQueue;
  }

}