ng-options="branch as branch.name for branch in ordersItemClientInfo.branches track by branch.id"
在我的情况下,“分支”是一个对象数组,每个对象都有指向如此深的对象(地图 geoObject)的字段引用。Angular 试图复制那个对象但失败了!
来自 angular.js:
getViewValueFromOption: function(option) {
// If the viewValue could be an object that may be mutated by the application,
// we need to make a copy and not return the reference to the value on the option.
return trackBy ? angular.copy(option.viewValue) : option.viewValue;
}
我不需要副本,我需要选择原始对象。我怎样才能做到?