diff options
Diffstat (limited to 'client/src/app/core/confirm/confirm.service.ts')
-rw-r--r-- | client/src/app/core/confirm/confirm.service.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/client/src/app/core/confirm/confirm.service.ts b/client/src/app/core/confirm/confirm.service.ts new file mode 100644 index 000000000..b97969795 --- /dev/null +++ b/client/src/app/core/confirm/confirm.service.ts | |||
@@ -0,0 +1,15 @@ | |||
1 | import { Injectable } from '@angular/core'; | ||
2 | import { Subject } from 'rxjs/Subject'; | ||
3 | import 'rxjs/add/operator/first'; | ||
4 | |||
5 | @Injectable() | ||
6 | export class ConfirmService { | ||
7 | showConfirm = new Subject<{ title, message }>(); | ||
8 | confirmResponse = new Subject<boolean>(); | ||
9 | |||
10 | confirm(message: string = '', title: string = '') { | ||
11 | this.showConfirm.next({ title, message }); | ||
12 | |||
13 | return this.confirmResponse.asObservable().first(); | ||
14 | } | ||
15 | } | ||