mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-25 02:36:10 +01:00
fix(menu): fix #84 page title and breadcrumb not showing up
This commit is contained in:
parent
77a13b5308
commit
8340acec7a
2 changed files with 27 additions and 4 deletions
|
|
@ -4,6 +4,8 @@ import {Router, UrlTree, RouterConfig} from '@angular/router';
|
|||
@Injectable()
|
||||
export class BaMenuService {
|
||||
|
||||
protected _currentMenuItem = {};
|
||||
|
||||
constructor(private _router:Router) {
|
||||
}
|
||||
|
||||
|
|
@ -12,11 +14,19 @@ export class BaMenuService {
|
|||
return this._skipEmpty(items);
|
||||
}
|
||||
|
||||
public getCurrentItem():any {
|
||||
return this._currentMenuItem;
|
||||
}
|
||||
|
||||
public selectMenuItem(menuItems:any[]):any[] {
|
||||
let items = [];
|
||||
menuItems.forEach((item) => {
|
||||
this._selectItem(item);
|
||||
|
||||
if (item.selected) {
|
||||
this._currentMenuItem = item;
|
||||
}
|
||||
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children = this.selectMenuItem(item.children);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue