diff --git a/src/cdk/tree/tree.ts b/src/cdk/tree/tree.ts index e6e485e733f5..6c9f225db6e6 100644 --- a/src/cdk/tree/tree.ts +++ b/src/cdk/tree/tree.ts @@ -603,6 +603,7 @@ export class CdkTree // Node context that will be provided to created embedded view const context = new CdkTreeNodeOutletContext(nodeData); + context.index = index; parentData ??= this._parents.get(key) ?? undefined; // If the tree is flat tree, then use the `getLevel` function in flat tree control