# ionic-tree-view

> This library is used to generate a treeview from an object list, you will find an example of a list below:

Latest version **0.4.3** (published 2021-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install ionic-tree-view
pnpm add ionic-tree-view
yarn add ionic-tree-view
bun add ionic-tree-view
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2021-04-29 |
| First published | 2018-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 337.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Gregory Heyligen |
| Maintainers | heylgreg |
| Keywords | angular, ionic, treeview |

## Links

- npm: https://www.npmjs.com/package/ionic-tree-view
- Repository: https://github.com/heyligengregory/ionic-tree-view
- Homepage: https://github.com/heyligengregory/ionic-tree-view#readme
- Issues: https://github.com/heyligengregory/ionic-tree-view/issues
- npm.io page: https://npm.io/package/ionic-tree-view

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.0.0

## Recent versions

- 0.4.3 (latest) — 2021-04-29
- 0.4.2 — 2021-01-15
- 0.4.1 — 2021-01-15
- 0.4.0 — 2021-01-13
- 0.3.8 — 2021-01-13
- 0.3.7 — 2021-01-13
- 0.3.6 — 2019-09-22
- 0.3.5 — 2019-09-22
- 0.3.4 — 2019-02-20
- 0.3.3 — 2019-02-20
- 0.3.2 — 2019-02-20
- 0.3.0 — 2019-01-18
- 0.2.9 — 2019-01-18
- 0.2.8 — 2019-01-16
- 0.2.7 — 2019-01-16
- … 26 more at https://npm.io/package/ionic-tree-view/versions

## README

# Tree-view

This library is used to generate a treeview from an object list, you will find an example of a list below:

```json
[
    { "id": 1, "name": "features" },
    { "id": 2, "name": "Add", "parentId": 1 },
    { "id": 3, "name": "Remove", "parentId": 1 },
    { "id": 9, "name": "Update", "parentId": 1 },
    { "id": 11, "name": "UpdateDel", "parentId": 9 },
    { "id": 27, "name": "Add", "parentId": 2 },
    { "id": 28, "name": "master" }
]
```

## Rendering

![alt text](https://user-images.githubusercontent.com/17003290/37466561-5949cd60-285e-11e8-93a2-4b33662a20ed.png)

## Installation

To install this library, run:

```bash
$ npm install ionic-tree-view --save
```

## Use library into Ionic Project

Once you have installed, you can import library in any Ionic application by doing:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import library
import { IonicTreeViewModule } from 'ionic-tree-view';

@NgModule({
    declarations: [AppComponent],
    imports: [
        BrowserModule,

        // Specify library as an import
        IonicTreeViewModule.forRoot(),
    ],
    providers: [],
    bootstrap: [AppComponent],
})
export class AppModule {}
```

Once your library is imported, you can use component in your Ionic application:

```xml
<!-- You can now use component in home.html -->
  <tree-view
              [items]="items"
              [persistedName]="persistedName"
              [treeViewName]="treeViewName"
              (itemCheckedEvent)="itemChecked($event)"></tree-view>
```

```typescript
  public items = [..];
  public persistedName = "MyItemsPersisted";
  public treeViewName = "MyItemsTreeView";
```

## Inputs

1. items
   This represents the elements that will form the treeview

2. persistedName
   This allows you to save checked items in the local storage.

3. treeViewName
   This is the name of your treeview

## License

MIT © [Gregory Heyligen](mailto:cudderheyl@gmail.com)

---
_Source: https://npm.io/package/ionic-tree-view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
