import { AfterContentInit, Component, ViewChild, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { views } from './app-nav-views'; import { MOBILE } from './services/constants'; import { MatSidenav } from '@angular/material'; import {environment} from '../environments/environment'; @Component({ selector: 'app-root', styleUrls: ['./app.component.scss'], templateUrl: 'app.component.html', encapsulation: ViewEncapsulation.None }) export class AppComponent implements AfterContentInit { mobile = MOBILE; sideNavMode = MOBILE ? 'over' : 'side'; views = views; @ViewChild(MatSidenav) sidenav: MatSidenav; constructor (public route: ActivatedRoute, public router: Router) { } ngAfterContentInit () { this.sidenav.open(); } activateEvent (event) { if (!environment.production) { console.log('Activate Event:', event); } } deactivateEvent (event) { if (!environment.production) { console.log('Deactivate Event', event); } } }