# Getting Started with the Kendo UI for Angular TreeList

This guide provides the information you need to start using the Kendo UI for Angular TreeList—it includes instructions about the recommended installation approach, the code for running the project, and links to additional resources.

> As of version `17.0.0`, Angular makes [standalone component](https://angular.dev/guide/components/importing) enabled by default. If you use `NgModules`, refer to these articles:
>
> * [Using Kendo Angular Components with NgModules](https://www.telerik.com/kendo-angular-ui-develop/components/installation/using-modules)
> * [Using Hybrid Configuration](https://www.telerik.com/kendo-angular-ui-develop/components/installation/using-modules#ngmodules-vs-standalone-components-pros-and-cons-in-kendo-ui-for-angular)

The standalone components in Angular streamline development by removing the need for `NgModules`, reducing complexity, and enhancing component reuse and modularity. This approach simplifies dependency management, making applications more maintainable and scalable.

<CtaPanelOverview></CtaPanelOverview>

After the completion of this guide, you will be able to achieve an end result as demonstrated in the following example.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/getting-started/source.txt)

## Before You Begin

Before you start with the installation of any Kendo UI for Angular control, ensure that you have a running Angular project. The prerequisites to accomplish the installation of the components are always the same regardless of the Kendo UI for Angular package you want to use, and are fully described in the [section on setting up your Angular project](https://www.telerik.com/kendo-angular-ui-develop/components/getting-started#quick-start).

## Installing the Component

The following command demonstrates an efficient, automated method for adding packages using the [Angular CLI](https://angular.dev/tools/cli) through the [`ng-add`](https://angular.dev/tools/cli/schematics-for-libraries#providing-installation-support) command. This approach saves time and effort by executing a series of commands in a single step, which otherwise need to be run individually. Refer to the [Manual Setup](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/installation/manual-setup) for more details.

To add the Kendo UI for Angular TreeList package:

1. Run the following command:

   ```sh
   ng add @progress/kendo-angular-treelist
   ```

   As a result, the `ng-add` command will perform the following actions:

   * Add the `@progress/kendo-angular-treelist` package as a dependency to the `package.json` file.
   * Add all required [peer dependencies](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/installation/dependecies-and-utils#kendo-angular-treelist-dependencies) to the `package.json` file.
   * Register the [Kendo UI Meridian theme](https://www.telerik.com/kendo-angular-ui-develop/components/styling#including-a-theme) in the `angular.json` file.
   * Trigger `npm install` to install the theme and all peer packages that are added.

2. Import the `KENDO_TREELIST` utility array in your standalone component to enable the entire feature set of the TreeList:

   > The utility array is available starting from `v16.6.0`. If you use an older version of the package, please follow the approach from the [Using Kendo Angular Components with NgModules](https://www.telerik.com/kendo-angular-ui-develop/components/installation/using-modules) article.

   ```ts
   import { Component } from '@angular/core';
   import { KENDO_TREELIST } from '@progress/kendo-angular-treelist';

   @Component({
       standalone: true,
       selector: 'my-app',
       imports: [KENDO_TREELIST]
   })
   ```

## Using the Component

1. After successfully installing the TreeList package and importing its component, add the following code in the `app.component.html` file:

   ```html
   <kendo-treelist
     [kendoTreeListFlatBinding]="data"
     kendoTreeListExpandable
     idField="id"
     parentIdField="managerId"
   >
       <kendo-treelist-column [expandable]="true" field="name" title="Name"> </kendo-treelist-column>
       <kendo-treelist-column field="title" title="Title"></kendo-treelist-column>
       <kendo-treelist-column field="phone" title="Phone"></kendo-treelist-column>
   </kendo-treelist>
   ```

2. Create the data source in your `app.component.ts` file:

   ```ts
   export class AppComponent {
       public data: unknown[] = [
           { id: 1, name: 'Daryl Sweeney', title: 'CEO', phone: '482-345-7925', managerId: null },
           { id: 2, name: 'Guy Wooten', title: 'Chief Technical Officer', phone: '309-543-7814', managerId: 1 },
           { id: 3, name: 'Priscilla Frank', title: 'Chief Operations Officer', phone: '175-298-9077', managerId: 1 },
           { id: 4, name: 'Ursula Holmes', title: 'EVP, Product Strategy', phone: '121-292-2766', managerId: 3 }
       ];
   }
   ```

3. Build and serve the application by running the following command in the root folder.

   ```sh
   ng serve
   ```

4. Point your browser to [http://localhost:4200](http://localhost:4200/) to see the Kendo UI for Angular TreeList component on the page.

## Activating Your License Key

As of December 2020, using any of the UI components from the Kendo UI for Angular library requires either a commercial license key or an active trial license key. If your application does not contain a Kendo UI license file, [activate your license key](https://www.telerik.com/kendo-angular-ui-develop/components/licensing).

## Next Steps

* [TreeList Dependencies & Standalone Utilities](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/installation/dependecies-and-utils)
* [TreeList Data Binding](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/data-binding/basics)
* [Defining the TreeList Columns](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/columns/define-columns)
* [Editing the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/editing)
* [TreeList Paging](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/paging/basics)
* [Filtering the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/filtering/basics)
* [TreeList Sorting](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/sorting/basics)
* [TreeList Selection](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/selection)
* [Row Reordering](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/row-reordering)
* [PDF Export of the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/export/pdf-export)
* [Excel Export of the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/export/excel-export)
* [TreeList Persist the Expanded State](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/expanded-state)
* [Keyboard Navigation in the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/keyboard-navigation)
* [Globalization of the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/globalization)
* [API Reference of the TreeList](https://www.telerik.com/kendo-angular-ui-develop/components/treelist/api)

## Learning Resources

* [TreeList Overview](https://www.telerik.com/kendo-angular-ui-develop/components/treelist)
* [Angular TreeList Homepage](https://www.telerik.com/kendo-angular-ui/treelist)
* [Get Started with Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui-develop/components/getting-started)
* [Using Kendo UI for Angular with Angular CLI](https://www.telerik.com/kendo-angular-ui-develop/components/installation/angular-cli)
* [Styling Overview](https://www.telerik.com/kendo-angular-ui-develop/components/styling)
* [Theme Builder](https://www.telerik.com/kendo-angular-ui-develop/components/styling/theme-builder)
* [Customizing the Themes](https://www.telerik.com/kendo-angular-ui-develop/components/styling/custom-themes)
* [Activating Your License Key](https://www.telerik.com/kendo-angular-ui-develop/components/licensing)
* [Video Courses](https://www.telerik.com/kendo-angular-ui-develop/components/getting-started/video-onboarding)
