mraible/ng-demo

ENTITY CONTRUCTOR

freefred81 opened this issue · 1 comments

Hi ... what you think about this way of doing a contructor of a Entity .. like:

export class Address {
  street: string;
  city: string;
  state: string;
  zip: string;

  constructor(obj: Partial<Address>=undefined) {
    if(obj){
      Object.assign(this,obj);
    }
  }
}

Do you think it's correct? or do you see something wrong with this approch?

Thnx for your time!

Duplicate of #65.