I am using ngx-dropdown treeview for the tree dropdown structure. When I am selecting in the dropdown only child ids are getting.
the response is like
[
{id:1,categoryName:Test,subCategory:[{id:2,categoryName:child1},{id:3,categoryName:child2}]}
{id:4,categoryName:Test2,subCategory:[{id:5,categoryName:child3},{id:6,categoryName:child4}]}
]
<ngx-dropdown-treeview
[items]="items"
[config]="config"
(selectedChange)="onSelectedChange($event)"
(filterChange)="onFilterChange($event)"
>
</ngx-dropdown-treeview>
onSelectedChange(event){
console.log(event)
}
If we select parent category Test, then the response is coming in the console like [2,3]
.
Is there any way to get the id
of the parent category also? Like [1,2,3]