I can\'t seem to be able to capture the Window scroll event. On several sites I found code similar to this:
@HostListener(\"window:scroll\", [])
onWindowScro
If you happen to be using Angular Material, you can do this:
import { ScrollDispatchModule } from '@angular/cdk/scrolling';
In Ts:
import { ScrollDispatcher } from '@angular/cdk/scrolling';
constructor(private scrollDispatcher: ScrollDispatcher) {
this.scrollDispatcher.scrolled().subscribe(x => console.log('I am scrolling'));
}
And in Template:
{{one}}
Reference: https://material.angular.io/cdk/scrolling/overview