Need help with checking the selected navigation using console.log?
export const navItems: NavData[] = [
{
name: 'Book #1',
url: '/book',
icon: 'fa fa-book',
children: [{
name: 'Book #2',
url: '/book',
icon: 'fa fa-pencil'
},{
name: 'Shopping Plan',
url: '/plan',
icon: 'fa fa-shopping-cart',
}]
}
]
If you click on "Shopping Plan" in the sideNav, the console will display "Shopping Plan". If you click on "Book #2", the console will show "Book #2". In simpler terms, how can you log the selected navigation item to the console?
This is the HTML code for reference:
<app-sidebar [fixed]="true" [display]="'lg'">
<app-sidebar-nav [navItems]="navItems" [perfectScrollbar] [disabled]="sidebarMinimized"></app-sidebar-nav>
<app-sidebar-minimizer></app-sidebar-minimizer>
</app-sidebar>