Revision 57811
Added by Konstantinos Triantafyllou over 4 years ago
sideBar.component.ts | ||
---|---|---|
1 | 1 |
import {Component, Input, OnInit} from '@angular/core'; |
2 |
import {Router} from "@angular/router"; |
|
3 | 2 |
import {Header, Item} from "../../../utils/entities/sidebar"; |
4 | 3 |
|
5 | 4 |
@Component({ |
... | ... | |
13 | 12 |
@Input() activeItem: string = ''; |
14 | 13 |
@Input() activeSubItem: string = ''; |
15 | 14 |
|
16 |
constructor(private router: Router) { |
|
17 |
} |
|
15 |
constructor() {} |
|
18 | 16 |
|
19 | 17 |
ngOnInit(): void { |
20 | 18 |
} |
21 | 19 |
|
22 | 20 |
|
23 |
isTheActiveMenuItem(item: Item, subItem = false): boolean {
|
|
21 |
isTheActiveMenuItem(item: Item, subItem: Item = null): boolean {
|
|
24 | 22 |
return (!subItem && this.activeItem === item.id) || |
25 |
(subItem && this.activeSubItem === item.id);
|
|
23 |
(subItem && this.activeItem === item.id && this.activeSubItem === subItem.id);
|
|
26 | 24 |
} |
27 | 25 |
} |
Also available in: Unified diff
[Monitor Dashboard]: Fix a bug on menu item of sidebar