I would like to use a custom event to let me app know that a route has changed. This way any components that care can listen and act accordingly. However I can’t seem to get custom events working outside of jquery… it would be really nice to add them to the
Template.foo.events… is this possible?
I have a situation where my header needs an
active class to display the active CSS. Checking and setting the active class on click works for 90% of use cases but when the header switches out or it’s the first page load it won’t work quite right.
Currently i’m triggering
Template.header.setActiveTabOnNavbar() from the AppController’s onAfterAction hook…which works great but i’d rather not mix header code in with the app router. I would really like to fire an event instead.
Is using jQuery trigger the only way?