1

After selecting an item from the dropdown an error is triggered for every keypress: origItem.toUpperCase is not a function, see http://plnkr.co/edit/xxTfWMcK3CuRPuiRldcB?p=preview

My ui select element:

<ui-select multiple tagging tagging-label="(custom 'new' label)" ng-model="project.tags" theme="bootstrap" sortable="true" title="Tags">
      <ui-select-match placeholder="Tags">{{$item.name || $item}}</ui-select-match>
      <ui-select-choices repeat="tag in tags | filter:$select.search">
        {{tag.name || tag}}
      </ui-select-choices>
    </ui-select>

where tags is

$scope.tags = [
 {
   name: 'foo'
 },
 {
   name: 'bar'
 }
]

I didn't find anything about using an object as source for the dropdown - but it seems like I'm doing it wrong.

1 Answer 1

3

I check this and this worked for me to resolve the issue. 1. Add a function to your demo.js

$scope.tagTransform = function (newTag) {
var item = {
    name: newTag
 };

 return item;
}

2. Second add the function to the tagging tag like so.

 tagging="tagTransform" 

I didn't get the error any more on your plunker when I added this. Hope this will work.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.