Tree
Usage
The <go-tree>
component should be used for any instance of "tree" like data, such as folder structures or groupings.
Bindings
@Input() nodeConfig: GoTreeNodeConfig[];
nodeConfig
The layout of the tree. This binding is required. The interface GoTreeNodeConfig
supports the following options:
interface GoTreeNodeConfig {
name: string;
children?: GoTreeNodeConfig[];
expanded?: boolean;
}
Default
View
Apple
Banana
Code
exampleTreeData: GoTreeNodeConfig[] = [
{
name: 'Fruit',
children: [{ name: 'Apple' }, { name: 'Banana' }],
expanded: true
},
{
name: 'Vegetables',
children: [
{
name: 'Green',
children: [{ name: 'Broccoli' }, { name: 'Brussel sprouts' }]
},
{
name: 'Orange',
children: [{ name: 'Pumpkins' }, { name: 'Carrots' }]
}
]
}
];
<go-tree [nodeConfig]="exampleDefaultTreeData"></go-tree>