Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the type of scroll event in angular

<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.

like image 293
Sneha Avatar asked Oct 19 '25 10:10

Sneha


1 Answers

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

like image 173
Joosep Parts Avatar answered Oct 22 '25 00:10

Joosep Parts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!