Correcting overselecting menue
This commit is contained in:
@@ -3,13 +3,21 @@ import { Router } from '@angular/router';
|
||||
import { IconNamesEnum } from "ngx-bootstrap-icons";
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
|
||||
|
||||
interface MenuItem {
|
||||
title: string,
|
||||
link: string,
|
||||
icon: IconNamesEnum
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
selector: "sidenav",
|
||||
templateUrl: "./sidenav.component.html",
|
||||
styleUrls: ["./sidenav.component.css"]
|
||||
})
|
||||
export class SidenavComponent {
|
||||
Menu = [
|
||||
Menu: MenuItem[] = [
|
||||
{
|
||||
title: $localize`Dashboard`,
|
||||
link: "/dashboard",
|
||||
@@ -54,7 +62,7 @@ export class SidenavComponent {
|
||||
})
|
||||
}
|
||||
|
||||
is_current_page(menu_item: any) {
|
||||
return this.router.url.indexOf(menu_item.link) > -1;
|
||||
is_current_page(menu_item: MenuItem) {
|
||||
return this.router.url.indexOf(`${menu_item.link}/`) > -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user