Gathering detailed insights and metrics for @samotics/ngx-treeview
Gathering detailed insights and metrics for @samotics/ngx-treeview
Gathering detailed insights and metrics for @samotics/ngx-treeview
Gathering detailed insights and metrics for @samotics/ngx-treeview
npm install @samotics/ngx-treeview
Typescript
Module System
Node Version
NPM Version
TypeScript (83.95%)
HTML (13.04%)
JavaScript (2.03%)
SCSS (0.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
86 Commits
1 Forks
9 Branches
11 Contributors
Updated on Jul 02, 2025
Latest Version
18.0.2
Package Id
@samotics/ngx-treeview@18.0.2
Unpacked Size
267.58 kB
Size
57.45 kB
File Count
38
NPM Version
10.2.4
Node Version
18.19.1
Published on
Jun 24, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
This library is a fork of ngx-treeview that is compatible with Angular 16, 17 and 18. This fork does not have the intention to continue the support of this library and comes with no guarantees. Please use at your own discretion.
An Angular treeview component with checkbox
This component is currently supporting Bootstrap 4. If you are using Bootstrap 4 alpha 6, please downgrade to the older version 1.0.10.
You can customize CSS yourself to break down dependencies to Bootstrap.
https://leovo2708.github.io/ngx-treeview/
After install the above dependencies, install ngx-treeview
via:
1npm install ngx-treeview --save
Once installed you need to import our main module in your application module:
1import { TreeviewModule } from 'ngx-treeview'; 2 3@NgModule({ 4 declarations: [AppComponent, ...], 5 imports: [TreeviewModule.forRoot(), ...], 6 bootstrap: [AppComponent] 7}) 8export class AppModule { 9}
1<ngx-treeview 2 [config]="config" 3 [items]="items" 4 (selectedChange)="onSelectedChange($event)" 5 (filterChange)="onFilterChange($event)" 6> 7</ngx-treeview>
1<ngx-dropdown-treeview 2 [buttonClass]="buttonClass" 3 [config]="config" 4 [items]="items" 5 (selectedChange)="onSelectedChange($event)" 6 (filterChange)="onFilterChange($event)" 7> 8</ngx-dropdown-treeview>
config
is optional. This is the default configuration:
1{ 2 hasAllCheckBox: true, 3 hasFilter: false, 4 hasCollapseExpand: false, 5 decoupleChildFromParent: false, 6 maxHeight: 500 7}
You can change default configuration easily because TreeviewConfig is injectable.
ngxTreeview
:To map your JSON objects to TreeItem objects.
1<ngx-dropdown-treeview 2 [config]="config" 3 [items]="items | ngxTreeview:'textField'" 4 (selectedChange)="onSelectedChange($event)" 5> 6</ngx-dropdown-treeview>
1const itCategory = new TreeviewItem({ 2 text: "IT", 3 value: 9, 4 children: [ 5 { 6 text: "Programming", 7 value: 91, 8 children: [ 9 { 10 text: "Frontend", 11 value: 911, 12 children: [ 13 { text: "Angular 1", value: 9111 }, 14 { text: "Angular 2", value: 9112 }, 15 { text: "ReactJS", value: 9113 }, 16 ], 17 }, 18 { 19 text: "Backend", 20 value: 912, 21 children: [ 22 { text: "C#", value: 9121 }, 23 { text: "Java", value: 9122 }, 24 { text: "Python", value: 9123, checked: false }, 25 ], 26 }, 27 ], 28 }, 29 { 30 text: "Networking", 31 value: 92, 32 children: [ 33 { text: "Internet", value: 921 }, 34 { text: "Security", value: 922 }, 35 ], 36 }, 37 ], 38});
You can pass the second paramater 'autoCorrectChecked' with value=true (default is false) in constructor of TreeviewItem to correct checked value of it and all of its descendants. In some cases, you need to push or pop children flexibly, checked of parent may be not correct. Then you need to call function correctChecked() to help to correct from root to its descendants.
1const vegetableCategory = new TreeviewItem({ 2 text: "Vegetable", 3 value: 2, 4 children: [ 5 { text: "Salad", value: 21 }, 6 { text: "Potato", value: 22 }, 7 ], 8}); 9vegetableCategory.children.push( 10 new TreeviewItem({ text: "Mushroom", value: 23, checked: false }) 11); 12vegetableCategory.correctChecked(); // need this to make 'Vegetable' node to change checked value from true to false
Extract data from list of checked TreeviewItem and send it in parameter of event selectedChange. Some built-in TreeviewEventParser:
See example 4 & 5.
I am very appreciate for your ideas, proposals and found bugs which you can leave in github issues. Thanks in advance!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 1/17 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More