Guides
Guides

Inputs to Tree component:

<tree-root [nodes]="nodes" [options]="options"></tree-root>

nodes

Array of root nodes of the tree.
Each node may contain the following fields:

PropertyDescription
idUnique ID for the node.
If one is not supplied it will be created by the tree library.
nameWill be displayed by default in the tree.
childrenAn array of the node's children.
Each child is an object with the same structure as the parent node.
hasChildrenFor async data load. Denotes that this node might have children, even when 'children' attr is empty.
isExpandedDetermines whether the node starts as expanded by default. Notice that this field is not bindable, meaning that changing it doesn't affect the tree and vice versa.

Example:

[
  {
    id: 1,
    name: 'root1',
    children: [
      {
        id: 2,
        name: 'child1'
      }, {
        id: 3,
        name: 'child2'
      }
    ]
  }
]

focused

Whether the tree should be focused. Key navigation only works when the tree is focused.
Default value: false.