Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

fix(backend): skip node if there is no associated TViewData #804

Merged
merged 2 commits into from May 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion projects/ng-devtools-backend/src/lib/directive-forest/ltree.ts
Expand Up @@ -71,6 +71,15 @@ export class LTreeStrategy {
const tNode = data[idx];
const node = lView[idx][ELEMENT];
const element = (node.tagName || node.nodeName).toLowerCase();
if (!tNode) {
return {
nativeElement: node,
children: [],
element,
directives: [],
component: null,
};
}
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
const instance = lView[i];
const dirMeta = data[i];
Expand All @@ -88,7 +97,7 @@ export class LTreeStrategy {
}
}
return {
nativeElement: lView[idx][ELEMENT],
nativeElement: node,
children: [],
element,
directives,
Expand Down