Description
ScrollDispatcher needs to create subscriptions to the window scroll/resize events lazily (when they are actually needed by the UI) and destroy them once the UI using them gets destroyed.
Currently it simply subscribes to the scroll and resize events on init, which is when the page loads.
Since it is not utilizing the zone.runOutsideAngular functionality, then it means that every time a scroll or resize event happens, it will re-render the UI several times.
This usually goes unnoticed in smaller applications, but when you have bigger applications, this slows down the UI a lot.
It also removes performance control from the developers.
It's fine to emit the events when the dispatcher is actually being used by an overlay or whatnot, but it makes no sense to trigger zone to re-render the view every time the user scrolls, when there's nothing new to re-render.
I'd suggest making the subscriptions lazy and destroy them when components unsubscribe, or if possible using the zone.runOutsideAngular functionality to never trigger a re-render in the first place.
version 2.0.0-beta.2