-
Notifications
You must be signed in to change notification settings - Fork 480
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
tree.treeModel.roots returns [] #58
Comments
When are you doing console.log? Have you tried in ngAfterViewInit ? Or in By the way, you can use the 'isExpanded' field for initial expand or collapse of nodes. |
I have one root, with many children.
It seems like the getter for roots in treeModel is buggy, since the first one prints the treeModel with roots array of length 1, but the second log prints an empty array |
Can you try using the (onInitialized) event instead of ngAfterViewInit? BTW, the getter is fine. By the time you check the treeModel in the console
On Tue, Sep 27, 2016 at 10:05 AM, Alexander Ciesielski <
|
html
ts
Same result as above |
I'm assuming you initialize reports with an empty array, and only later
On Tue, Sep 27, 2016 at 12:34 PM, Alexander Ciesielski <
|
Using |
I want to collapse, expand roots after initialization.
I have initialized a tree with 1 root, which has several children.
I have defined the tree as a ViewChild, and after
console.logging the tree
I can see in the console, that roots in treeModel is an array of length 1. But after console.loggingtree.treeModel.roots
I get empty array.The text was updated successfully, but these errors were encountered: