AngularJS + Safari: Force page to scroll to top when pages switch

后端 未结 9 2032
深忆病人
深忆病人 2021-02-07 00:20

I am having an odd, safari-only scrolling behavior using AngularJS.

Whenever the user flips between pages, the pages are being changed as if they are AJAX. I understand

9条回答
  •  轮回少年
    2021-02-07 00:53

    In the controller you can actually drop the $ from window and simply putwindow.scrollTo(0,0); without having to inject $window into the controller. It worked great for me.

提交回复
热议问题