]>
Commit | Line | Data |
---|---|---|
df98563e C |
1 | import { Injectable } from '@angular/core' |
2 | import { Subject } from 'rxjs/Subject' | |
3 | import 'rxjs/add/operator/first' | |
5769e1db C |
4 | |
5 | @Injectable() | |
6 | export class ConfirmService { | |
df98563e C |
7 | showConfirm = new Subject<{ title, message }>() |
8 | confirmResponse = new Subject<boolean>() | |
5769e1db | 9 | |
df98563e C |
10 | confirm (message = '', title = '') { |
11 | this.showConfirm.next({ title, message }) | |
5769e1db | 12 | |
df98563e | 13 | return this.confirmResponse.asObservable().first() |
5769e1db C |
14 | } |
15 | } |