aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/confirm/confirm.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/confirm/confirm.service.ts')
-rw-r--r--client/src/app/core/confirm/confirm.service.ts15
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 @@
1import { Injectable } from '@angular/core';
2import { Subject } from 'rxjs/Subject';
3import 'rxjs/add/operator/first';
4
5@Injectable()
6export 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}