there's my problem:
I've a function that add a element to a array (A), the element to add comes from the argument. Then when I modify this element in the array (A), it also modify the element that I used as argument.
it look like that :
addTemplates(nTemplate){
let k = nTemplate;
k.id=this.templates.length+1;
this.templates.push(k);
this.emitTemplateSubject();
}
//when I use the function:
let aObject={id:1, sth:"aa", sthE:"bb"}
addTemplate(aObject);
//then aObject.id is also change.
It's probably normal but how can I avoid to apply the changement on 'aObject' ?