Changing navbar after login

57 views
Skip to first unread message

Katheeja Beevi

unread,
Dec 23, 2018, 9:52:59 PM12/23/18
to ang...@googlegroups.com
Once user logs into my angular website,I have to change navbar accordingly,how to do this?

Sander Elias

unread,
Dec 26, 2018, 11:23:16 PM12/26/18
to Angular and AngularJS discussion
Hi Katheeja,

Usually, I have a special route for login that doesn't show the UI at all. Think of it as a routing layer above what you have now, that has a special outlet for anything that's not "inside" your app.

Another solution is something like this:
<nav *ngIf="user.isAuthenticated()">
<a [routerLink]="['/routePath']" routerLinkActive="router-link-active" >Orders</a>
<a [routerLink]="['/routePath']" routerLinkActive="router-link-active" >Invoices</a>
<a *ngIf="user.hasPermission('setup')" [routerLink]="['/routePath']" routerLinkActive="router-link-active" >Setup</a>
</nav>

Hope this helps a bit,
Regards
Sander

Katheeja Beevi

unread,
Dec 27, 2018, 12:36:59 PM12/27/18
to ang...@googlegroups.com
Thanks a lot I used ngif too.

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages