mat-card-actions' is not a known element

8,218 views
Skip to first unread message

Prudvi Seshu

unread,
Feb 25, 2018, 2:00:44 PM2/25/18
to angular-material2
Hi,

somebody please help.

I am using latest angular version (5.x) with latest angular material, hammer js and animation module. (project made with latest cli version)

i imported matcard module in app.module.ts like: import {MatCardModule} from '@angular/material/card';

i injected  MatCardModule  in the imports section of ngmodule.

when  i write some html with mat-card or mat-card-actions in the index.html file it is rendering fine. But, when i use the same code in header.component i am getting the following error:

"mat-card-actions' is not a known element"
1. If 'mat-card-actions' is an Angular component, then verify that it is part of this module.
2. If 'mat-card-actions' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

I have imported 'CUSTOM_ELEMENTS_SCHEMA' in the app.module.ts, still its doesnt work
I dont understand whats wrong, can somebody please guide me.

Thanks
Prudhvi

an darow

unread,
Jun 23, 2020, 6:45:35 AM6/23/20
to angular-material2
Hi Prudhvi,

Please make sure that you have included the HeaderComponent in the declarations section. This can be a problem.

Ann
Reply all
Reply to author
Forward
0 new messages