I used the<cdk-virtual-scroll-viewport> component in my html
But constantly getting
ERROR in new-post.component.html:73:1 - error NG8001: '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.
error
I have angular cdk installed;
import { ScrollingModule } from '@angular/cdk/scrolling';
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
in app.module.js
import {ScrollingModule} from '@angular/cdk/scrolling';
import {CdkVirtualScrollViewport} from "@angular/cdk/scrolling";
in my new-post component trying to use <cdk-virtual-scroll-viewport>
What other steps did I miss?
You should add the ScrollingModule to imports in app.module.ts :
imports: [ ScrollingModule, ]
Please provide a reproduction. @mehdifracso provided a good hint. At first glance this looks like the module has not been imported correctly.
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._
Most helpful comment
You should add the ScrollingModule to imports in app.module.ts :
imports: [ ScrollingModule, ]