$select.selected is undefined
I am trying to use ui-select to render my multi-select dropdown list.
I followed the multi-select example, which works except that I see the $select.selected is undefined error message. The error does not prevent the directive from functioning, but it is quite annoy.
I debugged the code and notice that in ui.select directive, ngModel.$render function, if I do
if (ngModel.$viewValue)
$select.selected = ngModel.$viewValue;
I won't see the error any more, but the multi-select won't work when I click on the input box, I get ctrl.items is undefined.
It seems that the ngModel.$viewValue is not defined for some reason. Is that a bug or something that I am doing correctly?
Try $item not $select.selected
I did use $item
<ui-select multiple data-ng-model="stateIDs" data-ng-disabled="disabled">
<ui-select-match placeholder="Choose a state">{{$item.name}}</ui-select-match>
<ui-select-choices data-repeat="state.id as state in availableStates">
{{state.name}}
</ui-select-choices>
</ui-select>
data-repeat ??
Changed data-repeat to repeat, same problem.
Show your example in plnkr.co
i have the same problem
I can reproduce with a demo on plnkr.co. More detailed description will be available in a new issue.
new issue - https://github.com/angular-ui/ui-select/issues/587