RLH-12 | Start implementing /account page
This commit is contained in:
40
src/app/libraries/components/button/button.component.ts
Normal file
40
src/app/libraries/components/button/button.component.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import {booleanAttribute, Component, Input, OnInit} from '@angular/core';
|
||||
import {ButtonModel} from "./models/button.model";
|
||||
|
||||
@Component({
|
||||
selector: 'rlh-button',
|
||||
standalone: true,
|
||||
imports: [],
|
||||
templateUrl: './button.component.html',
|
||||
styleUrl: './button.component.scss'
|
||||
})
|
||||
export class ButtonComponent implements OnInit
|
||||
{
|
||||
|
||||
@Input() button: ButtonModel = {
|
||||
text: 'text',
|
||||
disabled: () => false,
|
||||
click: () => {}
|
||||
};
|
||||
|
||||
buttonDisabled: () => boolean = () => {
|
||||
return false;
|
||||
// tslint:disable-next-line: semicolon
|
||||
};
|
||||
|
||||
ngOnInit() {
|
||||
this.button.disabled = this.button.disabled
|
||||
? this.button.disabled
|
||||
: () => false;
|
||||
//
|
||||
setTimeout(() => {
|
||||
this.buttonDisabled = () => {
|
||||
return this.button.disabled();
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user