I have an array of typed object and I need to create a separated copy of it in order to be able to work on a clone.
I have to pass to configuratorProduct the copy of listProducts value:
listProducts: Product[];
configuratorProducts : Product[];
This is what I'm trying:
this.configuratorProducts = this.listProducts.map(x => Object.assign({}, x));
for(let p in this.configuratorProducts)
{
var ck = this.accessories.filter(x=> x.idProductParent == p.idProduct);
}
The problem is that compiler returns:
Property 'idProduct' does not exist on type 'string'
How can i solve it ?
Thanks to support