0
joe704la created
I was wondering can I add an external link to the AppMenuItem?
Also how would I set a new entry point into the site? I do not want the dashboard or the notifications to be the entry point for non admins.
Thank you
3 Answer(s)
-
0
I ended up adding a external boolean to the AppMenuItem class
export class AppMenuItem { name = ''; permissionName = ''; icon = ''; route = ''; items: AppMenuItem[]; external: boolean; constructor(name: string, permissionName: string, icon: string, route: string, external?: boolean, items?: AppMenuItem[]) { this.name = name; this.permissionName = permissionName; this.icon = icon; this.route = route; this.external = external; if (items === undefined) { this.items = []; } else { this.items = items; } } }
Then in the side-bar-menu.component.html I added this
<a href="{{menuItem.route}}" *ngIf="!menuItem.items.length && menuItem.external" class="m-menu__link m-menu__toggle" target="_blank"> <i class="m-menu__link-icon {{menuItem.icon}}"></i> <span class="m-menu__link-text"> <span class="title">{{l(menuItem.name)}}</span> </span> </a>
It seems to work very well. I just had a need to link to two different external applications.
-
0
Thanks @joe704la, we will also include this into AspNet Zero, <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/733">https://github.com/aspnetzero/aspnet-ze ... issues/733</a>.