-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(tree): add tree examples #9585
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
Conversation
@@ -0,0 +1,9 @@ | |||
.tree-demo-invisible { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix with example-
(here and elsewhere)
display: none; | ||
} | ||
|
||
ul, li { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be gated by some css class
import {of} from 'rxjs/observable/of'; | ||
import {BehaviorSubject} from 'rxjs/BehaviorSubject'; | ||
|
||
export class JsonNode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add description?
} | ||
|
||
/** Flat node with expandable and level information */ | ||
export class JsonFlatNode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to make these more clearly examples specific to some use-case
}}`; | ||
|
||
@Injectable() | ||
export class JsonDatabase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use more comments in general to explain what's going on
} | ||
|
||
ul, li { | ||
-webkit-margin-before: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might add a comment about this.
</button> | ||
{{node.key}} | ||
</div> | ||
<ul [class]="nestedTreeControl.isExpanded(node) ? '' : 'tree-demo-invisible'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be better as ngClass
:
[ngClass]="{ 'tree-demo-invisible': nestedTreeControl.isExpanded(node) }"
this.nestedTreeControl = new NestedTreeControl<JsonNode>(this._getChildren); | ||
this.nestedDataSource = new MatTreeNestedDataSource(); | ||
|
||
database.dataChange.subscribe(data => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could omit {}
bfff5f0
to
beb641a
Compare
Comments addressed. Thanks for review! |
@@ -24,8 +24,10 @@ | |||
"paths": { | |||
"@angular/material/*": ["../../dist/packages/material/*"], | |||
"@angular/material": ["../../dist/packages/material/public-api"], | |||
"@angular/material-experimental/*": ["../../dist/packages/material-experimental/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should actually just move the tree into src/lib now that we're on for next major
beb641a
to
cc86aba
Compare
cc86aba
to
a40d8cc
Compare
Comments addressed. Please take a look. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a40d8cc
to
8b21b08
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Add two tree overview example