I'm attempting to build a lightning community and it requires that I use a custom navigation menu. I got all the elements to populate correctly but I can't figure out how to dynamically set the last selected menu item as active because the component reloads each time I navigate to a new page.
I am using aura:iteration to loop through the menuItems
<ul id="menuItems" onclick="{!c.onClickMenu}">
<aura:iteration items="{!v.menuItems}" var="item" >
<li><a onload="{!c.setActive}" id="{!item.id}" data-menu-item-id="{!item.id}" href="">{!item.label}</a></li>
</aura:iteration>
</ul>