Newer
Older
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {Router} from '@angular/router';
import {Http} from '@angular/http';
import {LayoutService} from '../layout.service';
import {LocalStorageService, SessionStorageService} from 'ngx-webstorage';
import {CommonService} from '../../shared/common/common.service';
import {timer} from 'rxjs/observable/timer';
import {AppService} from '../../app.service';
selector: 'jhi-sidebar',
templateUrl: './sidebar.component.html',
constructor(public router: Router, private http: Http,
public layoutSer: LayoutService,
this.appSer.Collapse.subscribe(value => {
this.isCollapsed = value;
// this.menuList = this.commonSer.listToTree('id', 'parentId', this.menuList);
}
getMenu() {
this.layoutSer.getMenu().subscribe(
(res) => {
if (res.errCode == 10000) {
this.menuList = this.commonSer.listToTree('id', 'parentId', res.data);
toggle() {
timer(100).subscribe(e => {
console.log(this.slideUL.nativeElement.clientHeight);
this.appSer.setContentHeight(this.slideUL.nativeElement.clientHeight);
});
}