I am having a problem with adding the active class on my navbar when the page load. The triggerEnters works when I click the page, but I also want it when the page loads.
Here's my code:
var headerRoutes = FlowRouter.group({
triggersEnter: [activePage]
});
function activePage(){
var selector = '.nav li a[href="' + FlowRouter.current().path + '"]';
$('.navbar-nav li.active').removeClass('active');
$(selector).parent("li").addClass('active');
}