K
K
Konstantin2020-04-22 15:38:25
Angular
Konstantin, 2020-04-22 15:38:25

Why does not find the material module for the component?

My SharedModule is imported into app.module:

@NgModule({
  imports: [CommonModule, MaterialModule],
  declarations: [
    FormsModule,
    MaterialModule,
    HeaderOrderBlockClassifierComponent,
    OrderDefinitionsTabsComponent,
  ],
  exports: [
    HeaderOrderBlockClassifierComponent,
    OrderDefinitionsTabsComponent,
    FormsModule,
    MaterialModule,
    CommonModule,
  ],
})
export class SharedModule {}


Why does Angular swear at:

HeaderOrderBlockClassifierComponent.
    header-order-block-classifier/header-order-block-classifier.component.html:4:5 - error NG8001: 'mat-icon' is not a known element:
    1. If 'mat-icon' is an Angular component, then verify that it is part of this module.
    2. If 'mat-icon' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.


If present HeaderOrderBlockClassifierComponentinMaterialModuleexport class SharedModule {}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
babtsoualiaksandr, 2020-04-22
@Junart1

import {MatIconModule} from '@angular/material/icon';
probably for this reason

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question