TreeMaterial Can't bind to 'dataSource' since, в чем причина?

Html код:

<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" class="example-tree"></mat-tree>


Модуль:

import { NgModule } from "@angular/core";
import { CommonModule } from "@angular/common";
import { TreeComponent } from "./tree.component";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserModule } from "@angular/platform-browser";
import { FormsModule } from "@angular/forms";
import { MaterialModule } from "../../material.module";

@NgModule({
  declarations: [TreeComponent],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    CommonModule,
    FormsModule,
    MaterialModule,
  ],
  exports: [TreeComponent],
})
export class TreeModule {}


Получаю ошибку в шаблоне:

Can't bind to 'dataSource' since it isn't a known property of 'mat-tree'.
1. If 'mat-tree' is an Angular component and it has 'dataSource' input, then verify that it is part of this module.
2. If 'mat-tree' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.
  • Вопрос задан
  • 33 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы