This commit is contained in:
Andras Schmelczer 2019-09-21 11:51:53 +02:00
commit 19aad2b2af

View file

@ -10,7 +10,16 @@ import { CancelService } from '../../services/cancel.service';
export class ModalComponent {
ModalType = ModalType;
save: () => void = null;
constructor(public modalService: ModalService, private cancelService: CancelService) {
this.cancelService.subscribe(this, () => this.modalService.cancel());
this.cancelService.subscribe(this, () => {
if (this.save) {
this.save();
this.save = null;
} else {
this.modalService.cancel();
}
});
}
}