Skip to content

Instantly share code, notes, and snippets.

@oleersoy
Created September 6, 2019 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleersoy/6a14e4c00f01ad1767f8538f3c5630e0 to your computer and use it in GitHub Desktop.
Save oleersoy/6a14e4c00f01ad1767f8538f3c5630e0 to your computer and use it in GitHub Desktop.
mdq: MediaQueryList;
mediaQueryListener:()=>void;
constructor( changeDetectorRef: ChangeDetectorRef, media: MediaMatcher ) {
this.mdq = media.matchMedia('(max-width: 992px)');
this.mediaQueryListener = () => changeDetectorRef.detectChanges();
this.mdq.addListener(this.mediaQueryListener);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment