In Angular, you can customize the scrolling behavior by using the withInMemoryScrolling. While this works great, it has a pitfall when introducing a delay in the response of the data.
In this video, you will learn how to create a reusable and easy-to-use approach to restore the scrolling position when a user navigates back to a list of items
Chapters:
00:00 Intro
00:29 Enable the withInMemoryScrolling
02:28 How things work
03:38 Restore Scrolling Position having an HTTP delay
10:17 Refactor the code to make it reusable
15:12 Thank you
✨ Code: https://github.com/profanis/codeShots...
✨ Credits
[Ryan Hutchison] Who put me on the right track, and told me that there is no need for an additional state layer since Angular already keeps the scrolling position on the router state.
******************************************************
Let's connect
******************************************************
Twitter: / prodromouf
LinkedIn: / prodromouf
#angular #learnAngular #angularTutorial #webdeveloper #angulartraining #webdevelopment
On this page of the site you can watch the video online Angular Scroll Position Restoration with a duration of hours minute second in good quality, which was uploaded by the user Code Shots With Profanis 22 September 2023, share the link with friends and acquaintances, this video has already been watched 6,326 times on youtube and it was liked by 205 viewers. Enjoy your viewing!