feat: add disabled state to text button component
This commit is contained in:
parent
0218c80aa9
commit
aacbad3357
@ -1 +1 @@
|
||||
<button>{{ text }}</button>
|
||||
<button [disabled]="disabled">{{ text }}</button>
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user