You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CdkTreeNodeOutletContext has the following properties:
/** Depth of the node. */
level: number;/** Index location of the node. */
index?: number;/** Length of the number of total dataNodes. */
count?: number;
All of them should be populated when creating the context and before embedding the node (see code reference).
What is the current behavior?
Only level is populated. index and count are not populated and cannot be used in the TreeNode's template to track the current position or total count. I assume that index should be the index of the node, relative to its siblings in its branch at the same level, and count should be the total number of siblings in the same branch at that level.
What are the steps to reproduce?
When using all three properties of the context, only level is populated - see Stackblitz example
What is the use-case or motivation for changing an existing behavior?
Developers should have access to the node's current position in their template, similarly to how they can track index in ngFor.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All
The text was updated successfully, but these errors were encountered:
Have the same issue. I can't connect node data to formArray because I need row's index which is not provided.
I've just tried to add context.index = index in insertNode() function and everything worked out perfectly. Is that a correct solution?
I noticed that index is still not populated, is there a timeframe for when this will be added or at least removed from the docs? Unless I am trying to get the index wrong.
Bug, feature request, or proposal:
Bug
What is the expected behavior?
CdkTreeNodeOutletContext
has the following properties:All of them should be populated when creating the context and before embedding the node (see code reference).
What is the current behavior?
Only
level
is populated.index
andcount
are not populated and cannot be used in the TreeNode's template to track the current position or total count. I assume thatindex
should be the index of the node, relative to its siblings in its branch at the same level, andcount
should be the total number of siblings in the same branch at that level.What are the steps to reproduce?
When using all three properties of the context, only
level
is populated - see Stackblitz exampleWhat is the use-case or motivation for changing an existing behavior?
Developers should have access to the node's current position in their template, similarly to how they can track index in
ngFor
.Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All
The text was updated successfully, but these errors were encountered: