Angular Scroll Position Restoration

Angular Scroll Position Restoration

Code Shots With Profanis

1 год назад

6,399 Просмотров

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/codeShotsWithProfanis/tree/58/restore-scrolling

✨ 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: https://twitter.com/prodromouf
LinkedIn: https://www.linkedin.com/in/prodromouf/

#angular #learnAngular #angularTutorial #webdeveloper #angulartraining #webdevelopment

Тэги:

#angular #angular_tutorial #learn_angular #angular_lesson #angular_restore_scrolling_position #angular_scrolling_restoration #withInMemoryScrolling #angular_scrolling
Ссылки и html тэги не поддерживаются


Комментарии: