Reputation: 24909
using Angular v5 with Angular Material v5.
markup:
<md-card md-theme="'dark-blue'" md-theme-watch>
<md-card-title>
<md-card-title-text>
Uncaught Error: Template parse errors: 'md-card-title-text' is not a known element: 1. If 'md-card-title-text' is an Angular component, then verify that it is part of this module.
my module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatButtonModule, MatCheckboxModule, MatIconModule, MatMenuModule, MatCardModule } from '@angular/material';
...
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
BrowserAnimationsModule,
MatButtonModule, MatCheckboxModule,
MatMenuModule,
MatIconModule,
MatCardModule
],
providers: [...],
bootstrap: [AppComponent]
})
export class AppModule { }
the other Material elements on my page work fine. md-card parses fine after I added MatCardModule.
what's perplexing is why adding MatCardModule worked to fix any md-card issues, but not md-card-title-text
Upvotes: 0
Views: 6417
Reputation:
Because in Material@5, the element is called
mat-card
They renamed all of their components.
Upvotes: 1