mercredi 29 juillet 2015

Ember action helper

I have a problem with action helper in my ember application. I have a list of items LI in one UL list. List could have various number if items. Items should response on mouse over. The first solution was to add on every item (LI) in the list one mouse enter action like:

<ul>
 {{#each data key="id" as |item|}}
   <li {{action "mouseOverLi" on="mouseEnter"}}>  {{item.description}}</li>
{{/each}}
</ul>

This solution is working but now for every LI tag I have one action, and that is not good solution . So is there any other solution for this. The best will be to add action helper in UL tag with filter on LI children tags.

In other words how one can transform this jQuery code snippet in action helper for Ember:

$("ul").on("mouseover","li",function(){
    // some code.
});




Aucun commentaire:

Enregistrer un commentaire