0

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.

4
  • so what it the problem Commented Oct 25, 2014 at 19:38
  • i guess problem is what i describe. no-model did not difine a variable in $scope Commented Oct 25, 2014 at 19:39
  • you havent given values to ui-select? Commented Oct 25, 2014 at 19:43
  • i have. Tried with one value and multiple values. Commented Oct 25, 2014 at 19:44

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.