import { Component, HostListener } from '@angular/core'; import * as screenfull from 'screenfull'; @Component({ selector: 'rh-industrial-fullscreen', templateUrl: './industrial-fullscreen.component.html', styleUrls: ['./industrial-fullscreen.component.less'] }) export class RhIndustrialFullscreenComponent { status = false; private get sf(): screenfull.Screenfull { return screenfull as screenfull.Screenfull; } @HostListener('window:resize') _resize() { this.status = this.sf.isFullscreen; } @HostListener('click') _click() { if (this.sf.isEnabled) { this.sf.toggle(); } } }