Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(core): unable to retrieve defer blocks in tests when component injects ViewContainerRef #62156

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crisbeto
Copy link
Member

Fixes that getDeferBlocks wasn't accounting for the case where a component might be injecting ViewContainerRef. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes #62047.

…jects ViewContainerRef

Fixes that `getDeferBlocks` wasn't accounting for the case where a component might be injecting `ViewContainerRef`. When that happens, an additional wrapper is introduced that needs to be accounted for when traversing the tree.

Fixes angular#62047.
@crisbeto crisbeto requested a review from AndrewKushnir June 20, 2025 07:30
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 20, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jun 20, 2025
@ngbot ngbot bot added this to the Backlog milestone Jun 20, 2025
getDeferBlocks(lContainer[HOST], deferBlocks);
}

for (let j = CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated. I just renamed the i, because it was shadowing the i from the outer loop.

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @crisbeto 👍

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 20, 2025
@AndrewKushnir
Copy link
Contributor

(FYI, leaving it in the merge queue until Monday, since that might affect testing in g3 and may require attention/rollback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fixture.getDeferBlocks() returns empty array
2 participants