pcb demo code.
[ealt-edge.git] / example-apps / PDD / frontend-src / src / app / pcb / toast.service.ts
1 import { Injectable, TemplateRef } from '@angular/core';
2
3 @Injectable({
4   providedIn: 'root'
5 })
6 export class ToastService {
7   toasts: any[] = [];
8
9   show(textOrTpl: string | TemplateRef<any>, options: any = {}) {
10     this.toasts.push({ textOrTpl, ...options });
11   }
12
13   remove(toast) {
14     this.toasts = this.toasts.filter(t => t !== toast);
15   }
16   constructor() { }
17 }