jeudi 1 octobre 2015

How to add a class to the selected component?

I have a list of components (all the same)

<ul class="search-results">
  {{#each res as |item|}}
    {{search-result item=item}}
  {{/each}}
</ul>

I'd like to add a class on the clicked element, and, when a new element is clicked, the old element should become "unclicked" (aka, remove the class).

Which is the best way to obtain this result?




Aucun commentaire:

Enregistrer un commentaire