diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:54:44 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-27 16:59:56 +0100 |
commit | 5769e1db8d3d5a1e3baa8dff23090cfe93d48a50 (patch) | |
tree | acbb14fda82b7517734f22d4ca57fb5e1ff9ef04 /client/src/app/core/confirm/confirm.service.ts | |
parent | 7ddd02c9b8c1e088f6679a2227f105e6439fc992 (diff) | |
download | PeerTube-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.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 | } | ||