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