Client: responsive design
[oweals/peertube.git] / client / src / app / core / confirm / confirm.service.ts
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 = '', title = '') {
11     this.showConfirm.next({ title, message });
12
13     return this.confirmResponse.asObservable().first();
14   }
15 }