I have a sidenav of angled design material that I need when the width is less than 700, open the screen with the nav closed, and when it is larger than 700 the screen can open with the nav open.
I tried something like:
@ViewChild('sidenav') sidenav: MatSidenav;
mobHeight = screen.height
mobWidth = screen.width;
fechaNav(){
this.sidenav.close();
}
constructor() {
if(this.mobWidth < 700){
this.sidenav.close();
}
}
I also tried on ngOnInit however the screen continues to open with the nav open.
This this.sidenav.close () function is correct, I use it to close the sidenav when the user clicks on some item, but for some reason I am not able to execute it in conjunction with the constructor or ngoninit.