Warm tip: This article is reproduced from serverfault.com, please click

Multiple triggers in Aurelia

发布于 2016-05-05 19:40:51

I want to trigger two different methods in aurelia, what's the best way to achieve this?

<a click.trigger="toggleSize(size.parts)" click.delegate="refreshPanel()" click.trigger="viewUtility.closeStickyDropdown($event)">
Questioner
Akshay Khot
Viewed
0
DevNebulae 2016-05-06 23:02:05

What I would probably do is the following

HTML

<a click.delegate="yourFunction($event, size.parts)">

Javascript

yourFunction(event, parts) {
    this.toggleSize(size.parts);
    this.refreshPanel();
    this.viewUtility.closeStickyDropdown(event); //Depends on what viewUtility is.
}