Open Planet910 opened 7 years ago
Had a look at you plunker, i'm not getting the error or i'm doing something wrong. Can you verify if the plunker has the correct example?
I verified and I still get the error. Try to write "hello" inside the input and press Enter:
I had the same issue, here is how I made it works:
<ui-select multiple tagging="myScopeFunction" (...)
with:
myScopeFunction = function(newItem) {
return {
label: newItem,
value: newItem,
}
}
It will generate the correct values in the ngModel (array of strings).
Same issue here, but trying the approach suggested by @poupougnac doesn't work for me. The javascript error goes, but the value that is displayed in the dropdown list is the entire object.
I want to limit the tag creation for string with length < 2 but I always get this error:
Uncaught TypeError: Cannot create property 'isTag' on string
this is the tagging function:
and here is a plunker: http://plnkr.co/edit/SS3V4A13nAbPDRAYrdaI?p=preview
You can see the error in the console and the new tag is not created. I suppose the error is because he expect an object to be returned from that function and I return a string. I dunno how to limit the creation of tag with an array of string and I really need this.