X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=blueprints%2Fcommon%2Feliot-ui%2Ffrontend-src%2Fsrc%2Fapp%2Fdeployments%2Ftoast.service.ts;fp=blueprints%2Fcommon%2Feliot-ui%2Ffrontend-src%2Fsrc%2Fapp%2Fdeployments%2Ftoast.service.ts;h=8cda912dac9ba415af4efa6560ae7f745032c856;hb=5c2048d4d3e672783eea4f306aa9a03f33a1a9f2;hp=0000000000000000000000000000000000000000;hpb=59f512662c02a16c1d5c45b090b185d2e773310f;p=eliot.git diff --git a/blueprints/common/eliot-ui/frontend-src/src/app/deployments/toast.service.ts b/blueprints/common/eliot-ui/frontend-src/src/app/deployments/toast.service.ts new file mode 100644 index 0000000..8cda912 --- /dev/null +++ b/blueprints/common/eliot-ui/frontend-src/src/app/deployments/toast.service.ts @@ -0,0 +1,17 @@ +import { Injectable, TemplateRef } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class ToastService { + toasts: any[] = []; + + show(textOrTpl: string | TemplateRef, options: any = {}) { + this.toasts.push({ textOrTpl, ...options }); + } + + remove(toast) { + this.toasts = this.toasts.filter(t => t !== toast); + } + constructor() { } +}