【发布时间】:2018-09-28 16:33:49
【问题描述】:
我有一个类型化对象数组,我需要为其创建一个单独的副本,以便能够在克隆上工作。
我必须将 listProducts 值的副本传递给 configuratorProduct:
listProducts: Product[];
configuratorProducts : Product[];
这就是我正在尝试的:
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);
}
问题是编译器返回:
属性“idProduct”不存在于 输入“字符串”
我该如何解决?
感谢支持
【问题讨论】:
-
产品的类型是什么?
-
这是一个简单的类
标签: angular typescript