export class EntityVM implements EntityModel {
...
Properties...
...
constructor(newEntity: EntityModel, isCollapsed = false) {
...
Properties...
...
this.isCollapsed = isCollapsed;
}
}
public myFunction(myEntity: EntityVM) {
//!! here myEntity.isCollapsed is undefined instead of false
}
public myEntity = new Array<EntityModel>();
myFunction(myEntity)
When converting from EntityModel to EntityVM, the value for isCollapsed is not set to false.