is there a method to fill a local object in Angular 2 without deleting some attributes? For example, I have a A object:
export class A {
first: string;
second: string;
}
Then I get a response like this in B:
{
"first": "bob"
}
Now I how to do something like that:
public a: A; // first and second are undefined
// Retrievethe response in b
this.a = b; // **Without doing fields for fields**
But b has no second attribute, so now a object has no more the second attribute but I have that it is undefined. I see that for forms there is patchvalue method, but it's valid only for forms...
Thanks