Hide buttons when no routing to sink
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
|
||||
import { IUser } from '../../models/user';
|
||||
@@ -11,16 +12,25 @@ import * as appActions from '../../actions/app-common.actions';
|
||||
templateUrl: './app-menu.component.html',
|
||||
styleUrls: ['./app-menu.component.scss']
|
||||
})
|
||||
export class AppMenuComponent implements OnInit {
|
||||
export class AppMenuComponent implements OnInit,AfterViewInit {
|
||||
|
||||
@Input() user:IUser;
|
||||
@Input() showMenu:boolean;
|
||||
public noContent: boolean = true;
|
||||
|
||||
constructor(private store: Store<appReducers.State>) { }
|
||||
constructor(private store: Store<appReducers.State>, private route: ActivatedRoute) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.route.children.forEach((entry) => {
|
||||
if(entry.outlet=="app-menu") {
|
||||
this.noContent=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggle(event:MouseEvent) {
|
||||
event.stopPropagation();
|
||||
this.store.dispatch(new appActions.ToggleAppMenu());
|
||||
|
Reference in New Issue
Block a user