fixed sidenav click

pull/8/head
FlayInAHook 4 years ago
parent 4e1260a51c
commit 65bc9fbd3d

@ -1,4 +1,4 @@
<div routerLink = "/profile" class="sidenav-profile"> <div (click)="closeSidenav()" routerLink = "/profile" class="sidenav-profile">
<img class="navbar-photo" src={{profileURL}}> <img class="navbar-photo" src={{profileURL}}>
<p>{{name}}</p> <p>{{name}}</p>
<p>{{email}}</p> <p>{{email}}</p>

@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service'; import { AuthService } from '../../services/auth.service';
import { SnackBarService } from '../../services/snackbar.service'; import { SnackBarService } from '../../services/snackbar.service';
import { NavService } from '../menu-list-item/nav.service';
@Component({ @Component({
selector: 'sidenav-profile', selector: 'sidenav-profile',
@ -12,7 +13,7 @@ export class SidenavProfileComponent implements OnInit {
email: String; email: String;
profileURL: String = '/assets/flotte_logo.png'; profileURL: String = '/assets/flotte_logo.png';
constructor( private auth: AuthService, private snackBar: SnackBarService) { } constructor( private auth: AuthService, private snackBar: SnackBarService, private navService: NavService) { }
ngOnInit() { ngOnInit() {
this.auth.currentUser.subscribe(user => { this.auth.currentUser.subscribe(user => {
@ -28,4 +29,8 @@ export class SidenavProfileComponent implements OnInit {
testSnackBar(){ testSnackBar(){
this.snackBar.openSnackBar("A user administration will be found here", "Ok"); this.snackBar.openSnackBar("A user administration will be found here", "Ok");
} }
closeSidenav() {
this.navService.closeNav();
}
} }
Loading…
Cancel
Save