Trying to figure out how to get window width on resizing events in Angular2. Here is my code:
export class SideNav { innerWidth: number; constructor(pr
Use NgZone to trigger change detection:
NgZone
constructor(ngZone:NgZone) { window.onresize = (e) => { ngZone.run(() => { this.width = window.innerWidth; this.height = window.innerHeight; }); }; }