The Aurelia Router fires off events in the EventAggregator which I can subscribe to. My code subscribes to the router:navigation:processing
event so that whenever a user clicks a route my navigation menu closes.
eventAggregator.subscribe('router:navigation:processing', e => menu.close());
The problem is that when the user is on the page in which they are trying to navigate to, then the menu stays open. I would like to close the menu when they select the same page in which they are currently on.
I would also like to mention that my menu links look like this:
<a route-href="route:showcase" class="menu-item">Showcase</a>
I would like keep my links like this if at all possible because I like how the aurelia-router
binds the href
address automagically.