Standard navigation convention(s) for Angular?

13 views
Skip to first unread message

Rich Leach

unread,
Nov 17, 2017, 3:01:23 PM11/17/17
to Angular and AngularJS discussion
Hi

After getting my routing code to work I realized that I wasn't seeing any docs about Navigation, or specifically anything Angular regarding automated menu development.... Some sites I've built in the past have had rather detailed and complex menus based on permissions, content, current URL, etc....

Are there any Angular conventions that the community uses to build out advanced navigation? Or is the solution to simply use manual Javascript calls to render what I need?

Thanks in advance,

Rich

Sander Elias

unread,
Nov 20, 2017, 2:32:11 AM11/20/17
to Angular and AngularJS discussion
Hi Rich,

I'm not aware of a broadly used convention. However, you can add auxiliary data to each route, and also, you can traverse the router using code. Knowing those 2 things enable you to create a NAV component that had the router injected, and build out the needed layout from the router itself.

For most of my projects, I found that I had to do both, a part that's generated from the router, and a 'static'  part. Other projects have a more dynamic need and use a service to add/remove things from the navigation.

Regards
Sander
Reply all
Reply to author
Forward
0 new messages