import { Component, HostListener, HostBinding } from '@angular/core'; import * as screenfull from 'screenfull'; @Component({ selector: 'na-layout-fullscreen', templateUrl: './na-fullscreen.component.html', styleUrls: ['./na-fullscreen.component.scss'], }) export class NaFullscreenComponent { @HostBinding('class.d-block') 'd-block' = 'true'; status = false; @HostListener('window:resize') _resize() { this.status = screenfull.isFullscreen; } @HostListener('click') _click() { if (screenfull.enabled) { screenfull.toggle(); } } }