Skip to content

feat(tree): add data sources for tree #9036

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
Jan 23, 2018

Conversation

tinayuangao
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 18, 2017
* level: 2
* }
*/
export class MatTreeFlattener<T, F> {
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite follow what T and F are. Is one the type of node and one the type of data? If so, should the type of node include an extends?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline and added comments about this.

*/
export class MatTreeNestedDataSource<T> implements DataSource<T> {
_renderedData = new BehaviorSubject<T[]>([]);
get renderedData(): T[] { return this._renderedData.value; }
Copy link
Member

Choose a reason for hiding this comment

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

I don't quite follow what renderedData is needed/used for

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed. data is enough

*/
export class MatTreeFlatDataSource<T, F> implements DataSource<F> {
_flattenedData = new BehaviorSubject<F[]>([]);
get flattenedData() { return this._flattenedData.value; }
Copy link
Member

Choose a reason for hiding this comment

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

Why expose flattenedData in addition to the data stream coming back from connect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed getters

@tinayuangao tinayuangao force-pushed the tree-datasource branch 3 times, most recently from efc6bbf to 8d20750 Compare January 8, 2018 20:43
@tinayuangao tinayuangao force-pushed the tree-datasource branch 3 times, most recently from 873b70d to 297a357 Compare January 11, 2018 19:21
@jelbourn
Copy link
Member

Poke @andrewseguin

Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

LGTM, though I think this should include changes to the tree.md by adding a Getting Started guide to the docs and using this with the examples

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@tinayuangao tinayuangao merged commit 76cf8df into angular:tree Jan 23, 2018
@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label Jan 29, 2018
jelbourn pushed a commit that referenced this pull request Feb 12, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants