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
onResize(event) { event.target.innerWidth; } to get notified on scroll events on a child element in a components template or listen on the components host element itself @HostListener('window:resize', ['$event']) onResize(event) { event.target.innerWidth; } 0 讨论(0) 查看其它3个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
onResize(event) { event.target.innerWidth; }
to get notified on scroll events on a child element in a components template
or listen on the components host element itself
@HostListener('window:resize', ['$event']) onResize(event) { event.target.innerWidth; }