Reputation: 67
I'm trying to use angular material in my project. I have done below required settings.
npm i -S @angular/material @angular/cdk @angular/animations
import {MatCheckboxModule} from '@angular/material/checkbox';
and imports: [ BrowserModule, AppRoutingModule, FontAwesomeModule, MatCheckboxModule ],
checked = false; labelPosition: 'before' | 'after' = 'after';
Below is the error:
Error: src/app/app.component.html:104:1 - error NG8001: 'mat-card' is not a known element:
Can someone please help me on this.
NOTE: I'm using bootstrap too in the same project, hope that dosen't impact this.
Upvotes: 0
Views: 345
Reputation: 67
So there are few changes I needed to make, thanks to the answers I got.
...
import { FormsModule } from '@angular/forms';
//angular material
import {MatCardModule} from '@angular/material/card';
import {MatRadioModule} from '@angular/material/radio';
@NgModule({
imports: [
BrowserModule,
FormsModule,
MatCardModule,
MatRadioModule
], . . .
Upvotes: 0
Reputation: 132
you have to include
import {MatCardModule} from '@angular/material/card';
for more info
https://material.angular.io/components/card/api
Upvotes: 2
Reputation: 2175
You have configuration issue :
you need to add those in module.ts file and add it in imports ,something like this:
import { MatCardModule} from '@angular/material';
@NgModule({
imports: [ BrowserModule, FormsModule, BrowserAnimationsModule, MatCardModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Upvotes: 1