Skip to content

fix(tree): Fix tree nested data source #9828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MatTreeNestedDataSource<T> implements DataSource<T> {
set data(value: T[]) { this._data.next(value); }

connect(collectionViewer: CollectionViewer): Observable<T[]> {
return merge([collectionViewer.viewChange, this._data])
return merge(...[collectionViewer.viewChange, this._data])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same as merge(collectionViewer.viewChange, this._data) right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

.pipe(map(() => {
return this.data;
}));
Expand Down
2 changes: 1 addition & 1 deletion src/material-experimental/tree/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This tree builds on the foundation of the CDK tree and uses a similar interface
data source input and template, except that its element and attribute selectors will be prefixed
with `mat-` instead of `cdk-`.

There are two types of trees: Flat tree and Nested Tree. The DOM structures are different for these
There are two types of trees: Flat tree and nested tree. The DOM structures are different for these
two types of trees.

#### Flat tree
Expand Down