I'm trying to create navigation menu for my project. The idea is to use Routes array for this menu and it is working but now I'm trying to add urls to my menu and it is not working
As you can see on picture above I created navigation menu with children elements. Now I want to add [routerLink] to enable links. For root items all works fine using:
[routerLink]="[menuItem.route.path]"
but for children items it doesn't work.
P.S. Routes:
RouterModule.forRoot([
{ path: '', component: HomeComponent },
{ path: 'admin', component: HomeComponent, data: { title: "Home", icon: "home" } },
{
path: 'test', component: HomeComponent, data: { title: "Settings", icon: "settings" },
children: [
{ path: '', component: HomeComponent, data: { title: "Test", icon: "power_settings_new" } },
{ path: 'settings', component: HomeComponent, data: { title: "Test2", icon: "power_settings_new" } }
]
}
])