I need to initialize initial value of 'gDetailDS' object. I cannot create classes instead of interfaces and interfaces don't allow me to set default values.
I have tried using map or other functions to resolve the issue but could not get success. Using map, get the error "_this.gDetailDS.map is not a function".
export interface InterfaceA{
sysSeq: number;
code: string;
isUpdate: boolean;
version: number;
}
export interface InterfaceB{
sysSeq: number;
name: string;
isReserved: boolean;
isPublic: boolean;
version: number;
}
export class DetailComponent<T> extends CoreComponent {
gDetailDS: any;
constructor(){
this.gDetailDS = <T> new Object;
}
}
I want to get default values specially for booleans. for instance, after executing this below line,
this.gDetailDS = <InterfaceB> new Object;
I should have an object of type InterfaceB with default sets for
this.gDetailDS.isReserved has default value "false";
this.gDetailDS.isPublic has default value "false";
Your help would be much appreciated.