Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
hi i'm using angular 2 rc1

i have the following business

parent Modules and child modules


for exmaple:

id:1,
name:moduleA,
parentId: 0

------
id:2
name:moduleA-1
parentId:1

----
id:3
name: moduleB
parentId: 0
------
id:4
name: moduleB-1
parentId:3
-------
id:5
name: moduleB-2
parentId:3



i want to create navbar such that

moduleA

--------------> moduleA-1

moduleB
--------------> moduleB-1
--------------> moduleB-2


how to achieve that dynamic menu structure?

What I have tried:

@Component({
selector: 'app-nav',
directives: [ROUTER_DIRECTIVES],
template: `


[routerLink]="route.path">



`
})
export class AppNav {
@Input()
routes: string[];
}
Posted
Updated 26-Jun-16 23:06pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900