bug(cdk/scrolling): Documentation for using cdk-virtual-scroll-viewport is incorrect
See original GitHub issueReproduction
The API reference for Angular CDK scrolling (https://material.angular.io/cdk/scrolling/api) only mentions CdkScrollableModule
and does not mention ScrollingModule
. ScrollingModule
should be mentioned in the documentation – for example it is required to use cdk-virtual-scroll-viewport
.
From the documentation:
API reference for Angular CDK scrolling
import {CdkScrollableModule} from '@angular/cdk/scrolling';
In order to use cdk-virtual-scroll-viewport
, I need to import ScrollingModule
from @angular/cdk/scrolling
instead.
Steps to reproduce:
- Go to the following StackBlitz: https://stackblitz.com/edit/angular-ivy-xt5sg3?file=src%2Fapp%2Fapp.module.ts. You will see the following error:
Error in src/app/app.component.html (2:1) 'cdk-virtual-scroll-viewport' is not a known element: 1. If 'cdk-virtual-scroll-viewport' is an Angular component, then verify that it is part of this module. 2. If 'cdk-virtual-scroll-viewport' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
- Import
ScrollingModule
and it will work again.
Expected Behavior
I expect the documentation at https://material.angular.io/cdk/scrolling/api to mention ScrollingModule
, something along the lines of
API reference for Angular CDK scrolling
/**
* To use the following:
* - CdkScrollable
*/
import {CdkScrollableModule} from '@angular/cdk/scrolling';
/**
* To use the following:
* - CdkFixedSizeVirtualScroll
* - CdkVirtualForOf
* - CdkVirtualScrollViewport
*/
import {ScrollingModule} from '@angular/cdk/scrolling';
Actual Behavior
The documentation does not mention ScrollingModule
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cdk virtual scrolling issue - angular - Stack Overflow
First you need the Viewport Reference: @ViewChild(CdkVirtualScrollViewport, {static: false}) cdkVirtualScrollViewport: CdkVirtualScrollViewport;.
Read more >Virtualize large lists with the Angular CDK - web.dev
Learn how to make large lists more responsive by implementing virtual scrolling with the Angular Component Dev Kit.
Read more >Virtual Scroll | Ionic Documentation
When we want to use the CDK Scroller, we'll need to import the module in our ... cdk-virtual-scroll-viewport becomes the root of our...
Read more >Angular Cdk Demo Virtual Scroll (forked) - StackBlitz
Demonstrate Virtual Scrolling for @angular/cdk. ... import { CdkVirtualScrollViewport } from ... loading$ = new BehaviorSubject(false);. constructor(){.
Read more >ng-table-virtual-scroll-bug - npm
Start using ng-table-virtual-scroll-bug in your project by running `npm ... <cdk-virtual-scroll-viewport tvsItemSize="48" headerHeight="56" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, it’s not the most obvious process. We have a bazel rule that takes all our documentation content and bundles it into an npm package, then we install that npm package into the docs site. So you would do this:
We should probably make a script that does this more easily (cc @devversion )
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.