<div (scroll)="onScroll($event)">
onScroll(event: any) {
const value= event.target;
}
Here instead of type "any" ,I need to put the type of the event. Can anyone help me with this.
<div (scroll)="onScroll($event)">
onScroll(event: any) {
const value= event.target;
}
Here instead of type "any" ,I need to put the type of the event. Can anyone help me with this.
It would be Event as a type.
onScroll(event: Event) {
const value= event.target;
}
Fired at the Document or element when the viewport or element is scrolled, respectively. https://drafts.csswg.org/cssom-view/#event-summary
An event can be triggered by the user action e.g. clicking the mouse button or tapping keyboard, or generated by APIs to represent the progress of an asynchronous task. https://developer.mozilla.org/en-US/docs/Web/API/Event
The easiest way to find out (not using the docs) would be to print the input:
onScroll(event: any): void {
console.log(event);
}