Since p-tree
from PrimeNG
does not have way of using rowIndex
.
How do I display/get the Index of nodes each node using ng-template
.
Is there any workaroud?
Since p-tree
from PrimeNG
does not have way of using rowIndex
.
How do I display/get the Index of nodes each node using ng-template
.
Is there any workaroud?
Copyright © 2021 Jogjafile Inc.
Within the
ng-template
, you can call the indexOf() method on your collection and pass the current item as the argument. This will either return the index of the first instance of that item or-1
if that item isn't found. You can display the result of that call within curly braces in the HTML.