更新时间:2022-06-03 03:21:15
似乎Angular2使用对象引用而不是属性,因此,如果这样做,它将起作用:
It seems Angular2 uses objects reference, instead of properties, so if you do this, it will work:
private onEdit(relationship: Relationship): void {
this.selectedSupplier = this.suppliers.find(supplier => supplier.id === relationship.supplierId);
}
您需要传递与选择对象完全相同的对象.
You need to pass the exact same object from the select.