aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/confirm/confirm.service.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-27 16:54:44 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-27 16:59:56 +0100
commit5769e1db8d3d5a1e3baa8dff23090cfe93d48a50 (patch)
treeacbb14fda82b7517734f22d4ca57fb5e1ff9ef04 /client/src/app/core/confirm/confirm.service.ts
parent7ddd02c9b8c1e088f6679a2227f105e6439fc992 (diff)
downloadPeerTube-5769e1db8d3d5a1e3baa8dff23090cfe93d48a50.tar.gz
PeerTube-5769e1db8d3d5a1e3baa8dff23090cfe93d48a50.tar.zst
PeerTube-5769e1db8d3d5a1e3baa8dff23090cfe93d48a50.zip
Client: better confirm box for a beautiful world
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}