“ mat-card-content”不是已知元素:

时间:2020-07-26 15:32:07

标签: angular angular-universal angular-lazyloading

我在Angular Universal,材料的延迟加载和共享模块中遇到此错误。运行npm run dev:ssr时出现此错误,我认为这是延迟加载和Angular Universal的组合。

“ mat-card-content”不是已知元素

import { ExceptionModalComponent } from './../../components/exception-

modal/exception-modal.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ExceptionModalRoutingModule } from './exception-modal-routing.module';
import { MaterialModule } from '../shared/material.module';


@NgModule({
  declarations: [ExceptionModalComponent],
  imports: [
    CommonModule,
    MaterialModule,
    ExceptionModalRoutingModule
  ]
})
export class ExceptionModalModule { }

1 个答案:

答案 0 :(得分:0)

您需要在ExceptionModalModule中添加MatCardModule。

import {MatCardModule} from '@angular/material/card';