From 763ac410bd4a99f7d06a6264f77daae56e1c3d4c Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 14 Jan 2022 17:59:32 +0200 Subject: [PATCH] added general disabled implementation in base dialog --- src/lib/dialog/base-dialog.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/dialog/base-dialog.component.ts b/src/lib/dialog/base-dialog.component.ts index 21cb7af..a361d0f 100644 --- a/src/lib/dialog/base-dialog.component.ts +++ b/src/lib/dialog/base-dialog.component.ts @@ -23,7 +23,6 @@ export interface SaveOptions { * (otherwise the save request will be triggered twice). * */ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnInit { - abstract disabled: boolean; protected readonly _dialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService); protected _waitingForConfirmation = false; @@ -78,6 +77,10 @@ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnI return false; } + get disabled(): boolean { + return !this.valid || !this.changed; + } + close(): void { if (this.changed) { this._openConfirmDialog().then(result => {