I have been trying to build a responsive nav-bar and do not wish to use a media query, so I intend to use *ngIF with the window size as a criterion. But I have
*ngIF
@HostListener("window:resize", []) public onResize() { this.detectScreenSize(); } public ngAfterViewInit() { this.detectScreenSize(); } private detectScreenSize() { const height = window.innerHeight; const width = window.innerWidth; }