Hide buttons when no routing to sink
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2021-04-12 15:10:29 +02:00
parent cbf805e1ff
commit a6d3b208b0
6 changed files with 42 additions and 13 deletions

View File

@@ -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());