UNPKG

fabric8-planner

Version:
30 lines 1.22 kB
import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; var ModalService = /** @class */ (function () { function ModalService() { this.clientSource = new Subject(); this.componentSource = new Subject(); this.clientSource$ = this.clientSource.asObservable(); this.componentSource$ = this.componentSource.asObservable(); } ModalService.prototype.openModal = function (title, message, buttonText, actionKey) { this.componentSource.next([title, message, buttonText, actionKey]); console.log('Opened modal dialog for key ' + actionKey); return this.clientSource$; }; ModalService.prototype.doAction = function (actionKey) { console.log('Received confirm action for key ' + actionKey + ', sending to clients'); this.clientSource.next(actionKey); }; ModalService.prototype.getComponentObservable = function () { return this.componentSource$; }; ModalService.decorators = [ { type: Injectable }, ]; /** @nocollapse */ ModalService.ctorParameters = function () { return []; }; return ModalService; }()); export { ModalService }; //# sourceMappingURL=modal.service.js.map