Skip to content

control flow: migration does not preserve i18n attribute on ng-template #52517

Closed

Description

@zip-fa

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

Hi.
This code:

<ng-container *ngIf="cond; else testTpl">
bla bla
</ng-container>
   
<ng-template #testTpl i18n="@@test_key">Some text</ng-template>

Got migrated to this:

@if (cond) {
  bla bla
} @else {
  Some text
}

I guess this is not fixable, because of strange setup with i18n attribute on ng-template. But maybe consider migrating this code to </ng-container

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.0-rc.3
Node: 18.18.1
Package Manager: npm 9.8.1
OS: win32 x64

Angular: 17.0.0-rc.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0-rc.3
@angular-devkit/build-angular   17.0.0-rc.3
@angular-devkit/core            17.0.0-rc.3
@angular-devkit/schematics      17.0.0-rc.3
@angular/cli                    17.0.0-rc.3
@angular/ssr                    17.0.0-rc.3
@schematics/angular             17.0.0-rc.3
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.0

Anything else?

No response

Activity

  1. changed the title [-]control flow: migration does not preserve i18n attribute on ng-container[/-] [+]control flow: migration does not preserve i18n attribute on ng-tempalte[/+] on Nov 5, 2023
  2. changed the title [-]control flow: migration does not preserve i18n attribute on ng-tempalte[/-] [+]control flow: migration does not preserve i18n attribute on ng-template[/+] on Nov 5, 2023
  3. added
    area: migrations
    on Nov 5, 2023
  4. added this to the needsTriage milestone on Nov 5, 2023
  5. added
    core: control flow
    on Nov 5, 2023
  6. self-assigned this
    on Nov 6, 2023
  7. added a commit that references this issue on Nov 8, 2023
    70d30c2
  8. angular-automatic-lock-bot commented on Dec 9, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Dec 9, 2023
  10. added a commit that references this issue on Jan 23, 2024
    d462138
  11. added a commit that references this issue on Jan 26, 2024
    12f979d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: migrationscore: control flow

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions