Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ivy): fix flaky tests #23010

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions packages/core/src/render3/di.ts
Expand Up @@ -572,9 +572,6 @@ class ViewContainerRef implements viewEngine_ViewContainerRef {
createEmbeddedView<C>(
templateRef: viewEngine_TemplateRef<C>, context?: C|undefined,
index?: number|undefined): viewEngine_EmbeddedViewRef<C> {
// set current view to container node's view
enterView(this._node.view, null);

const viewRef = templateRef.createEmbeddedView(context !);
this.insert(viewRef, index);
return viewRef;
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/render3/instructions.ts
Expand Up @@ -431,9 +431,10 @@ export function renderEmbeddedTemplate<T>(
previousOrParentNode = null !;
let cm: boolean = false;
if (viewNode == null) {
// TODO: revisit setting currentView when re-writing view containers
const view = createLView(
-1, renderer, createTView(currentView.tView.directiveRegistry), template, context,
LViewFlags.CheckAlways);
-1, renderer, createTView(currentView && currentView.tView.directiveRegistry), template,
context, LViewFlags.CheckAlways);
viewNode = createLNode(null, LNodeType.View, null, view);
cm = true;
}
Expand All @@ -443,7 +444,7 @@ export function renderEmbeddedTemplate<T>(
refreshDynamicChildren();
refreshDirectives();
} finally {
leaveView(currentView !.parent !);
leaveView(currentView && currentView !.parent !);
isParent = _isParent;
previousOrParentNode = _previousOrParentNode;
}
Expand Down