so i am having hard time to figure out how to scroll page to top of window upon user interaction (like click on item). In AngularJS i could use $window.scrollTo(0, 0);
I am not using Angular2 Router so need something like aformentioned $window
Any help would be appreciated.
You can use the javascript window object or refer to this link if you want to do it purely in angular 2(Angular2 - How to inject window into an angular2 service):
window.scrollTo(0,0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With