Skip to content

Commit 1fc41ee

Browse files
Avcharovhawkgs
authored andcommitted
feat(devtools): add support for @for control flow blocks in directive explorer
- Handle @for data in tree strategies and view extraction - Show @for details in the UI and property tab - Persist @for state and update UI accordingly
1 parent d072791 commit 1fc41ee

30 files changed

Lines changed: 1106 additions & 104 deletions

devtools/projects/ng-devtools-backend/src/lib/client-event-subscribers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ const prepareForestForSerialization = (
437437
children: prepareForestForSerialization(node.children, includeResolutionPath),
438438
hydration: node.hydration,
439439
defer: node.defer,
440+
forLoop: node.forLoop,
440441
onPush: node.component ? isOnPushDirective(node.component) : false,
441442

442443
// native elements are not serializable

devtools/projects/ng-devtools-backend/src/lib/directive-forest/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ts_project(
1616
"//devtools/projects/ng-devtools-backend/src/lib:utils",
1717
"//devtools/projects/ng-devtools-backend/src/lib:version",
1818
"//devtools/projects/ng-devtools-backend/src/lib/ng-debug-api",
19+
"//devtools/projects/ng-devtools-backend/src/lib/state-serializer",
1920
"//devtools/projects/protocol",
2021
],
2122
)

devtools/projects/ng-devtools-backend/src/lib/directive-forest/ltree.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class LTreeStrategy {
9292
component: null,
9393
hydration: null, // We know there is no hydration if we use the LTreeStrategy
9494
defer: null, // neither there will be any defer
95+
forLoop: null, // neither there will be any @for
9596
};
9697
}
9798
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
@@ -118,6 +119,7 @@ export class LTreeStrategy {
118119
component,
119120
hydration: null, // We know there is no hydration if we use the LTreeStrategy
120121
defer: null, // neither there will be any defer
122+
forLoop: null, // neither there will be any @for
121123
};
122124
}
123125

0 commit comments

Comments
 (0)