I am trying to use angular-ui's ui-selec2 with tagging. The problem I'm having is when the select2 loads up, the existing objects that have been selected look like this: [object Object]
. Here is the declaration of the select2:
<input name="zip" ng-required="true" required ui-select2="selectZips" type="text" ng-model="zone.zip"/>
The following is the selectZips
object that is passed to the ui-select2:
$scope.selectZips = {
'multiple': true,
'simple_tags': true,
'tags': zips,
'width': '100%',
};
Also of note, the objects that are being passed in have an id
, a postal_code
, and a zone_id
. I tried specifying what the id and the text should be (according to what the docs said) but that didn't change anything.
I've tried using an initSelection
, like on this page, tried looking at the select2 docs for loading array data, and lots of other StackOverflow questions but I haven't been able to find anything that fixes this.
Let me know if you need any clarifications or more code.