Recently, I crafted a Class that defines the properties of an element:
export class ElementProperties {
constructor(
public value: string,
public adminConsentRequired: boolean,
public displayString?: string,
public description?: string){}
}
Next, I'm forming an Object in the same manner as traditional Javascript:
static readonly MyObject = {
ChildProperty1: {
NestedPropA: new ElementProperties(
"My value",
true
),
NestedPropB: new ElementProperties(
"My value in B",
false
)
},
ChildProperty2: {
...
}
}
However, I encountered this error message:
Class 'ElementProperties' used before its declaration.ts(2449)
I have numerous instances where I need to initialize objects with ElementProperties and creating separate variables for each seems impractical. Any suggestions on how to address this?
Thank you.