Quantcast
Viewing all articles
Browse latest Browse all 4826

Run a function from defined on the client side

@IAmAndre wrote:

Hi,

I’m using a JavaScript library to create some animations, and I’d like know how to trigger these animations from my Controller. This library doesn’t have any npm version, so I had to use the ember-cli to import it to my code. From what I understood, this client code isn’t available to Ember so I don’t know how to call these functions from Ember. As of now, my solution is :

<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
     <a class="dropdown-item" onclick="sortByPrice('low_to_high');" href="#">Prix croissant</a>
     <a class="dropdown-item" onclick="sortByPrice('high_to_low');" href="#">Prix décroissant</a>
</div> 

sortByPrice() is a function I wrote myself (in app.js) and it triggers the animation. What would be the more elegant (Ember) way to achieve the same result?

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles