import { MediaMatcher } from '@angular/cdk/layout' ; import { ChangeDetectorRef , Component , OnDestroy } from '@angular/core' ; title @ Component ( { selector : 'sidenav-responsive-example' , templateUrl : 'sidenav-responsive-example.html' , styleUrls : [ 'sidenav-responsive-example.css' ] , } ) export class SidenavResponsiveExample implements OnDestroy { mobileQuery : MediaQueryList ; fillerNav = Array . from ( { length : 50 } , ( _ , i ) => `Nav Item ${ i + 1 }` ) ; fillerContent = Array . from ( { length : 50 } , ( ) => `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
       labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
       laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
       voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
       cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.` ) ; private _mobileQueryListener : ( ) => void ; constructor ( changeDetectorRef , media ) { this . mobileQuery = media . matchMedia ( '(max-width: 600px)' ) ; this . _mobileQueryListener = ( ) => changeDetectorRef . detectChanges ( ) ; this . mobileQuery . addListener ( this . _mobileQueryListener ) ; } ngOnDestroy ( ) { this . mobileQuery . removeListener ( this . _mobileQueryListener ) ; } shouldRun = [ /(^|\.)plnkr\.co$/ , /(^|\.)stackblitz\.io$/ ] . some ( h => h . test ( window . location . host ) ) ; }