vendredi 27 février 2015

Reusable ember component with its own data source

I have a dropdown <select>-based component that I'd like to be able to drop into any template in the hierarchy of my ember app. This displays a list of all the Articles (the model) on the site. Whenever I use this component though, the route that I'm in needs to load the data and get passed to the template. How can I load this data once and only when the component is rendered? I've been reading this and still have yet to come up with a good solution. I'd like the component to provide the data source, but that seems to be frowned upon.


Would it be terrible to just do an ajax request in my component pre-render?





Aucun commentaire:

Enregistrer un commentaire