Autoscroll in Angular 2

后端 未结 10 1174
清歌不尽
清歌不尽 2020-12-01 12:21

I\'m experiencing an issue with Angular 2 where changing from one route to another does not automatically scroll to the top of the new view. I realize that Angular 1 allowed

10条回答
  •  攒了一身酷
    2020-12-01 12:48

    For Those of you who find window.scrollTo(0,0) not working (I'm guessing because of material design sidenav but totally guessing) use the method found here: Javascript / CSS window.scrollTo(0,0) not working

提交回复
热议问题