diff options
Diffstat (limited to '')
| -rw-r--r-- | ufund-ui/src/app/services/modal.service.ts | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/ufund-ui/src/app/services/modal.service.ts b/ufund-ui/src/app/services/modal.service.ts new file mode 100644 index 0000000..04f2f3a --- /dev/null +++ b/ufund-ui/src/app/services/modal.service.ts @@ -0,0 +1,25 @@ +import {Injectable, TemplateRef} from '@angular/core'; +import {BehaviorSubject} from 'rxjs'; + +@Injectable({ +    providedIn: 'root' +}) +export class ModalService { + +    private modal = new BehaviorSubject<TemplateRef<any> | null>(null) + +    constructor() {} + +    showModal(template: TemplateRef<any>) { +        console.log("got here", template) +        this.modal.next(template) +    } + +    hideModal() { +        this.modal.next(null) +    } + +    getModalBehaviorSubject() { +        return this.modal; +    } +}  | 
