formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.22k stars 405 forks source link

ui-select 0.17.1 repeat error #681

Open Blaze34 opened 8 years ago

Blaze34 commented 8 years ago

Yesterday ui-select was updated and angular-formly stop working.

This is jsbin example

thachp commented 8 years ago

I am experiencing similar issue. I'm getting this error...

Error: [ui.select:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{{to.ngOptions}}'.

My temp solution is to use v0.17.0.

npm install ui-select@0.17.0 --save-dev
Luddinus commented 8 years ago

same issue here

It works if you add 'option[to.valueProp] as option in to.options | filter: $select.search' instead of {{to.ngOptions}}

immortalcy commented 8 years ago

It would be nice if we could have a more generic solution instead of changing the template to only support that, since that means that in any case where you would like to have other data-repeat value you wouldn't be able to. You would be 'forced' to create a new template and that is something angular-formly doesn't intent to do.

kentcdodds commented 8 years ago

@immortalcy, actually, if you look at the implementation of the example above, it allows you to specify the ngOptions at the field level, and actually you can specify the ngOptions attribute for a specific field using ngModelAttrs as well. I think that's the generic solution you're looking for...

immortalcy commented 8 years ago

Yes but with Luddinus solution you won't be able to use to.ngOptions, am I missing something here?

vmartinetti commented 8 years ago

+1 same problem and same workaround of @Luddinus

msms007 commented 8 years ago

+1 Same issue here, I need to dynamically build the repeat string and bind it. falling back to 0.17.0

blowsie commented 8 years ago

@Luddinus's solution doesn't work for me with the latest version. Its also worth considering that you might want to apply other filters like orderBy

arickampschaefer commented 8 years ago

+1 same issue, and @Luddinus's solution doesn't work for me, so I've also fallen back to 0.17.0

hustshawn commented 8 years ago

@Luddinus Works well. 'Formly' officially correct this here? http://angular-formly.com/#/example/integrations/ui-select-angular-1-4

oscar-b commented 8 years ago

Also see https://github.com/angular-ui/ui-select/issues/1640

JR-Utily commented 7 years ago

+1 (still happening with ui-select v0.19.x and angular-formly v8.4.x) @hustshawn no, there is no correction, you can see in the html they included v0.16 of ui-select and the regression was introduced in v0.17.1 <script src="https://cdn.rawgit.com/angular-ui/ui-select/v0.16.0/dist/select.js"></script>

blowsie commented 7 years ago

https://github.com/formly-js/angular-formly/issues/441