0
votes

I can't make Ionic 3 + Material angular work together.

I've followed every stepped, installing angular/material, angular/cdk, angular/animation and bring BrowserAnimationsModule to app.module.ts. I've imported MatCardModule from '@angular/material' and added it to imports array. And I finally tried to use it with <mat-card>Simple card</mat-card>.

Error: Uncaught (in promise): Error: Template parse errors: 'mat-card' is not a known element: 1. If 'mat-card' is an Angular component, then verify that it is part of this module. 2. If 'mat-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. (" `

How can I make it work together?

1
This is an import problem. Check that you have importer it in the specific ts file you are in for exampleuser7722867
I am pretty sure importing anything onto the component.ts files, only modules need imports I believe.GreatHawkeye

1 Answers

0
votes

Try to add schema in module component and check again.

    @NgModule({
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
    })