I have the following interface and I can pass its parameter values to the base component. However, although I could pass string values without any problem, I cannot pass boolean values and encounter "Identifier 'isDisabled' is not defined. 'CustomButton' does not contain such a member" error.
export interface CustomButton {
name: string;
operation: string;
tooltip: string;
isDisabled?: boolean;
}
On the other hand, I set the default value of isDisabled
in a component from that I call the base component:
buttons: CustomButton[];
isEmployeeDisabled = false; // set the value while defining variable
this.buttons = [
{
name: 'edit',
tooltip: 'Edit Employee',
operation: 'Delete',
isDisabled: this.isEmployeeDisabled
// isDisabled: true // if I use like this, it works fine but still gives that error
}
];
I could not find why isDisabled is not known property. How can I fix this problem?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…