feat: add disabled state to text button component

This commit is contained in:
itsscb 2025-03-05 22:44:17 +01:00
parent 0218c80aa9
commit aacbad3357
2 changed files with 12 additions and 1 deletions

View File

@ -1 +1 @@
<button>{{ text }}</button>
<button [disabled]="disabled">{{ text }}</button>

View File

@ -9,4 +9,15 @@ import {Component, Input} from '@angular/core';
})
export class TextButtonComponent {
@Input() text: string = '';
private _disabled: boolean = false;
get disabled(): boolean {
return this._disabled;
}
@Input()
set disabled(value: boolean | undefined) {
this._disabled = value === undefined || value === true;
}
}