Honchar Denys
Honchar Denys

Reputation: 1518

Angular UI Select, undefined ng-model

I have below code from example of Angular UI Select:

<ui-select multiple ng-model="SelectedItem" style="width: 300px;">
    <ui-select-match placeholder="Select colors">{{$item}}</ui-select-match>
    <ui-select-choices repeat="color in availableColors">{{color}} Cool</ui-select-choices>
</ui-select>
<p>Selected: {{SelectedItem}}</p>

And nd-model didnt define any scope variable. <p> show only 'Selected: ' and in controller variable $scope.SelectedItem is undefined. The rest is working fine.

Upvotes: 0

Views: 2450

Answers (1)

Honchar Denys
Honchar Denys

Reputation: 1518

Well, i had to define mine scope variable in controller first. Something like that: $scope.SelectedItem = {}; That's was something that was nowhere before Angular-UI and was not clear from main page of Angular-UI.

Upvotes: 3

Related Questions