What is the reason to AngularJS not to have ng-scroll="" bound to mouse wheel events?

2,756 views
Skip to first unread message

Darlan Alves

unread,
Nov 21, 2013, 11:18:29 AM11/21/13
to ang...@googlegroups.com
Hello people!

I didn't find any specific post on group mentioning ng-scroll and this event (scroll), and the GitHub of AngularJS code don't have any reference to it either.

I did a implementation for these event using almost the same implementation of ng* that comes with AngularJS: https://github.com/darlanalves/ngWheel

Is there any bug or misbehavior I am missing?

Victor Bjelkholm

unread,
Nov 21, 2013, 4:56:50 PM11/21/13
to ang...@googlegroups.com
Why would you want to bind a html element to scroll? What does that mean? Where does calledOnMouseWhell() comes from?

bwiklund

unread,
Nov 22, 2013, 12:17:25 AM11/22/13
to ang...@googlegroups.com
I've written my own in the past, yes. I suspect it's not built in because running digests on scroll events could be potentially very expensive. Same with drag events, since both can trigger dozens of events per second. I ended up making directives that updated the position of dragging/scrolling stuff manually, without running a digest, to do what we needed. Then I fired a digest when the drag/scroll stopped. But it all depends on your needs. Just be mindful of how you handle spammy events and digests.
Reply all
Reply to author
Forward
0 new messages