1

ng-options="branch as branch.name for branch in ordersItemClientInfo.branches track by branch.id"

In my case "branches" is an array of object and each of them have field ref to so deep object (map geoObject). Angular tries to copy thats object and fails!

from 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;
}

I don't need a copy, I need original object to be selected. How can I make it?

stollr
  • 6,534
  • 4
  • 43
  • 59
nitro-n
  • 423
  • 1
  • 5
  • 9

1 Answers1

0

Maybe you can try to do a JSON.stringify (to each item before showing it) and then make the JSON.parse in the template whenever you want to display it?

Alejandro Vales
  • 2,816
  • 22
  • 41