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:
I would like keep my links like this if at all possible because I like how the aurelia-router binds the href address automagically. I’m also open to any suggestions on alternative ways of doing this. If anyone has done something similar
So, basically I’m using the aurelia-store to open and close my menu. Also, I need to return true from the click.delegate method in order for the href link to navigate.