Angular Material 6.0.1 Tree default opened and expand/collapse all

后端 未结 2 1207
太阳男子
太阳男子 2021-02-08 05:39

I\'m using the Angular Material Tree in my project. Is it possible to have the tree opened by default.

And could there be a way to expand/collapse all the nodes at once

2条回答
  •  无人共我
    2021-02-08 06:01

    In addition make sure that treeControl nodes are set. After loading data you should

    treeControl.dataNodes = nodes; 
    treeControl.expandAll()
    

    See this github issue

提交回复
热议问题