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
You may use the typescript getter method for this scenario. Like this
public get width() {
return window.innerWidth;
}
And use that in template like this:
= 768, 'mobile-view': width < 768
}">
You won't need any event handler to check for resizing/ of window, this method will check for size every time automatically.