# Tree View

Tree view plugin is powered by a third party plugin. Please refer there documentation for further celebrations. <https://angular2-tree.readme.io/docs>

## Importing

First import it to your app module or any submodule as you wish

```typescript
import { TreeModule } from 'angular-tree-component';
@NgModule({
  imports: [TreeModule,...]
})
export class AppModule(){}
```

## How to use&#x20;

Basic Select with Search

{% tabs %}
{% tab title="HTML" %}

```markup
<tree-root [nodes]="simpleNodes" [options]="options" class="tree-wrapper bold-node-text level1-document-icon-only m-b-20"></tree-root>
```

{% endtab %}

{% tab title="Typescript" %}

```typescript
simpleNodes = [
    {
        id: 1,
        name: 'item1 with key and tooltip'
    },
    {
        id: 2,
        name: 'item2'
    },
    {
        id: 3,
        name: 'Folder with some children',
        children: [
        { id: 4, name: 'Sub-item 3.1',
            children:[
            {id: 5, name: 'Sub-item 3.1.1'},
            {id: 6, name: 'Sub-item 3.1.2'}
            ]
        },
        { id: 7, name: 'Sub-item 3.2',
            children:[
            {id: 8, name: 'Sub-item 3.2.1'},
            {id: 9, name: 'Sub-item 3.2.2'}
            ]
        }
        ]
    },
    {
        id: 10,
        name: 'Document with some children (expanded on init)',
        isExpanded:true,
        children: [
        { id: 11, name: 'Sub-item 4.1  (active and focus on init)',
        isFocused:true
        }
        ]
    },
];

options = {
    animateExpand:true,
};
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pages.revox.io/angular/ui-components/tree-view.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
