1 import { Injectable, NgZone } from '@angular/core'
4 export class ScreenService {
5 private windowInnerWidth: number
7 constructor (private zone: NgZone) {
8 this.windowInnerWidth = window.innerWidth
10 // Try to cache a little bit window.innerWidth
11 this.zone.runOutsideAngular(() => {
12 setInterval(() => this.windowInnerWidth = window.innerWidth, 500)
17 return this.windowInnerWidth < 600
21 return this.windowInnerWidth < 500