Skip to content

bug(tree): tree does not initialize when data is set in constructor #22282

Closed
@meblum

Description

@meblum

Reproduction

https://stackblitz.com/edit/mat-tree-flat-data-source-bug?file=src/app/tree-flat-overview-example.ts

Steps to reproduce:

  1. Try to initialize the data in the constructor
  2. Run the app

Expected Behavior

The MatTreeFlatDataSource accepts an optional argument initialData. I would expect the data sorce to be properly initialized when set in the constructor.

Actual Behavior

Tree renders as if data is empty

Environment

  • Angular: 11
  • CDK/Material: 11
  • Browser(s): latest chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): windows

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/tree

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions