Last change
on this file since e29cc2e was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago |
adding photos
|
-
Property mode
set to
100644
|
File size:
3.3 KB
|
Rev | Line | |
---|
[59329aa] | 1 | import { Injectable } from '@angular/core';
|
---|
| 2 | import { Subject } from 'rxjs';
|
---|
| 3 | import * as i0 from "@angular/core";
|
---|
| 4 | export class ConfirmationService {
|
---|
| 5 | constructor() {
|
---|
| 6 | this.requireConfirmationSource = new Subject();
|
---|
| 7 | this.acceptConfirmationSource = new Subject();
|
---|
| 8 | this.requireConfirmation$ = this.requireConfirmationSource.asObservable();
|
---|
| 9 | this.accept = this.acceptConfirmationSource.asObservable();
|
---|
| 10 | }
|
---|
| 11 | confirm(confirmation) {
|
---|
| 12 | this.requireConfirmationSource.next(confirmation);
|
---|
| 13 | return this;
|
---|
| 14 | }
|
---|
| 15 | close() {
|
---|
| 16 | this.requireConfirmationSource.next(null);
|
---|
| 17 | return this;
|
---|
| 18 | }
|
---|
| 19 | onAccept() {
|
---|
| 20 | this.acceptConfirmationSource.next(null);
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 | ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ConfirmationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
---|
| 24 | ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ConfirmationService });
|
---|
| 25 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ConfirmationService, decorators: [{
|
---|
| 26 | type: Injectable
|
---|
| 27 | }] });
|
---|
| 28 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybWF0aW9uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcHAvY29tcG9uZW50cy9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geyBDb25maXJtYXRpb24gfSBmcm9tICcuL2NvbmZpcm1hdGlvbic7XG5cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBDb25maXJtYXRpb25TZXJ2aWNlIHtcblxuICAgIHByaXZhdGUgcmVxdWlyZUNvbmZpcm1hdGlvblNvdXJjZSA9IG5ldyBTdWJqZWN0PENvbmZpcm1hdGlvbj4oKTtcbiAgICBwcml2YXRlIGFjY2VwdENvbmZpcm1hdGlvblNvdXJjZSA9IG5ldyBTdWJqZWN0PENvbmZpcm1hdGlvbj4oKTtcblxuICAgIHJlcXVpcmVDb25maXJtYXRpb24kID0gdGhpcy5yZXF1aXJlQ29uZmlybWF0aW9uU291cmNlLmFzT2JzZXJ2YWJsZSgpO1xuICAgIGFjY2VwdCA9IHRoaXMuYWNjZXB0Q29uZmlybWF0aW9uU291cmNlLmFzT2JzZXJ2YWJsZSgpO1xuXG4gICAgY29uZmlybShjb25maXJtYXRpb246IENvbmZpcm1hdGlvbikge1xuICAgICAgICB0aGlzLnJlcXVpcmVDb25maXJtYXRpb25Tb3VyY2UubmV4dChjb25maXJtYXRpb24pO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBjbG9zZSgpIHtcbiAgICAgICAgdGhpcy5yZXF1aXJlQ29uZmlybWF0aW9uU291cmNlLm5leHQobnVsbCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIG9uQWNjZXB0KCkge1xuICAgICAgICB0aGlzLmFjY2VwdENvbmZpcm1hdGlvblNvdXJjZS5uZXh0KG51bGwpO1xuICAgIH1cbn1cbiJdfQ== |
---|
Note:
See
TracBrowser
for help on using the repository browser.