jeudi 5 mars 2015

How to create a link-to drop-down in Ember.js

I have an application where we'd like to use a <select> element to control which object is loaded in a detail route.


If this were a normal <ul>, like if I were using bootstrap's drop-down, using the #link-to helper would be perfect here, because I could use the active class to always automatically select the item that is loaded in the child route.


With a select element it's a little different. I'll probably need to write a view, I'm okay with that, but it occurs to me that parents aren't supposed to know about their children in ember, so how does a parent view get access to know which child view is currently selected?


Even a link to how the link-to helper is implemented could be helpful here.


Thanks!





Aucun commentaire:

Enregistrer un commentaire