Components: error NG8001: 'cdk-virtual-scroll-viewport' is not a known element:

Created on 16 Apr 2020  路  3Comments  路  Source: angular/components

I used the<cdk-virtual-scroll-viewport> component in my html

Actual Behavior

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

Environment

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?

Most helpful comment

You should add the ScrollingModule to imports in app.module.ts :
imports: [ ScrollingModule, ]

All 3 comments

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hiblton picture Hiblton  路  3Comments

jelbourn picture jelbourn  路  3Comments

vitaly-t picture vitaly-t  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

crutchcorn picture crutchcorn  路  3Comments