Best practice for loading values into a drop down from a server


#1

If I have a form with a drop down field, say companyTypes what I want to populate from the server, what is the best way to populate the dropdown? What gets the data from the server and how does it know the API’s URL if there is no route?

Thanks, Brad


#2

The best practice is to use ember-data. You can install an adapter for your backend. See https://guides.emberjs.com/v2.12.0/models/customizing-adapters/

For the dropdown I like ember-selectize See: https://github.com/broerse/ember-cli-blog/blob/master/app/templates/components/blog-post-edit.hbs#L4


#3

Broerse,

Finally, an Ember sample app that does something interesting and useful. I will study it.

If you can recommend any other sample apps that have real world, useful UIs and show how its all wired up, I would love to study them as well.

Thanks, Brad


#4

#5

By the way you can see the app in action here: https://bloggr.exmer.com The drop down is in the edit screen.