import { MediaObserver } from "@angular/flex-layout" ; import { Injectable } from "@angular/core" ; import { Subject } from "rxjs" ; @ Injectable ( ) export class WindowService { public static readonly SCREEN_MD : string = "md" ; public resizing : Subject < void > ; constructor ( public media ) { this . resizing = new Subject < void > ( ) ; } public isScreenMediaActive ( query ) { return this . media . isActive ( query ) ; } public onResize ( ) { this . resizing . next ( ) ; } }