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 => {