We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a405a02 commit ea7cdf8Copy full SHA for ea7cdf8
packages/elements/src/component-factory-strategy.ts
@@ -172,6 +172,9 @@ export class ComponentNgElementStrategy implements NgElementStrategy {
172
const hostView = this.componentRef!.hostView as EmbeddedViewRef<unknown>;
173
const viewNode = hostView?.rootNodes?.[0] as HTMLElement;
174
const parent = viewNode?.parentElement!;
175
+ if (!parent) {
176
+ return;
177
+ }
178
const index = parent && Array.from(parent.childNodes).indexOf(viewNode);
179
const beforeOf = parent && parent.childNodes.item(index + 1);
180
return {parent, viewNode, beforeOf};
0 commit comments