aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/services/modal.service.ts
blob: 04f2f3a1f8e1aeb8d0ab0d19327dbcc6f6501a38 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
    }
}