Skip to content

docs(components/cdk/scrolling): add note about view recycling with dy… #19245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cdk/scrolling/scrolling.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ is reused instead. The size of the view cache can be adjusted via the `templateC
property; setting this size to `0` disables caching. If your templates are expensive in terms of
memory you may wish to reduce this number to avoid spending too much memory on the template cache.

Recycled components within the `<cdk-virtual-scroll-viewport>` preserve state like bound parameter values.
When rendering dynamic components, you may want to disable caching completely.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding to the docs. Based on your initial issue it looks like a lot of people would benefit from this sort of messaging. However, I don't think "dynamic components" will be clear enough. Is there another way to describe what users should watch out for in more Angular-ish terms? Should users specifically be careful about components not calling their constructor or ngOnInit when reused?


<!-- example(cdk-virtual-scroll-template-cache) -->

##### Specifying data
Expand Down