can we make Angular2 @HostListener listen to "window"? not to window or document event, because I want to make smooth animation based on event but not waiting value from event..
@HostListener('window', ['$event'])
alwaysListeningAlwaysUnderstanding() {
console.log("I'm listening..");
}
So the problem is, I want to make an animation based on scroll position, like scrollme plugin, but I don't want use it since scrollme use jquery.
For now I already create @HostListener function based on 'window:scroll' but the return value not smooth if I scroll it fast, its like 2,45,123,432. and it give impact to my animation, some element not render nicely and oftenly giving a bad result.
So is there a way to fix it? I thought listening to scroll position without waiting scroll to move make it more smooth.