-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Control-Flow migration does not support NgFor's ngForTemplate input #53068
Comments
This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068
Thanks for reporting this! You're correct in that it's a rare use case. I have a PR up that should address this use case and ensure it migrates properly. We'll discuss the performance implications with the team. |
This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068
This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068
This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068
…ngular#53076) This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068 PR Close angular#53076
…ngular#53076) This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068 PR Close angular#53076
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ngular#53076) This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068 PR Close angular#53076
…ngular#53076) This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068 PR Close angular#53076
…ngular#53076) This adds code to cover the rare use case of an ngFor with a template param. fixes: angular#53068 PR Close angular#53076
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
After running
ng generate @angular/core:control-flow
one of my components ended up being broken. The reason for this is that the migration is not accounting for NgFor's ngForTemplate input.before the migration:
after the automated migration:
As there doesn't seem to be an equivalent available with the new @for-block for this use case,
one would have to use the following workaround to get it running:
Although this is easy to do manually, I think the automated migration should either properly handle this case or at least notify the user to take manual action! Otherwise, this issue might be hard to detect in bigger applications.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
While I know this is some rare use-case, I was wondering whether the above replacement is acceptable in terms of performance!? It will basically stamp out multiple template outlets which in turn render the specific template rather than rendering that template directly. If this indeed has performance drawbacks, should there maybe be an alternative solution for this use case with the new @for-block syntax?
The text was updated successfully, but these errors were encountered: