Skip to content

control flow: buggy migration #52516

@zip-fa

Description

@zip-fa

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

core

Is this a regression?

No

Description

Hi. Control flow migration gets out of control with my component.

Output is:

<svg xmlns="http://www.w3.org/2000/svg" [attr.viewBox]="_getViewBox()">
    <defs>
      @if (parsedGradient) {
<ng-container
        [

@switch (parsedGradient.type) {        <r@case ('radial') {
  adialGradient id="gradient"
          *          [attr.cx]="parsedGradient.cx"
          [attr.cy]="parsedGradient.cy"
          [attr.r]="parsedGradient.r"
          [attr.gradientTransform]="parsedGradient.transform"
          gradientUnits="userSpaceOnUse">
            <s@for (stop of parsedGradient.stops; track stop) {
  top *               [attr.offset]="stop[0]"
               [attr.stop-color]="stop[1]"
               [attr.stop-opacity]="stop[2]"></stop>

}        </radialGradient>

}        <l@case ('linear') {
  inearGradient id="gradient"
          *
            <s@for (stop of parsedGradient.stops; track stop) {
  top *               [attr.offset]="stop[0]"
               [attr.stop-color]="stop[1]"
               [attr.stop-opacity]="stop[2]"></stop>

}        </linearGradient>

}      </}
ng-container>
}
    </defs>
      <circle
        fill="none"
        [attr.cx]="radius"
        [attr.cy]="radius"
        [attr.r]="radius - stroke / 2"
        [style.stroke]="resolveColor(background)"
        [style.stroke-width]="stroke"/>
      <path
        #path
        fill="none"
        [style.stroke-width]="stroke"
        [style.stroke]="color"
        [style.stroke-linecap]="rounded ? 'round' : ''"
        [attr.transform]="getPathTransform()"/>
    </svg>

Please provide a link to a minimal reproduction of the bug

https://gist.github.com/zip-fa/86783a2895ac2900f56693d4b07e0e86

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

Metadata

Metadata

Assignees

Labels

area: migrationsIssues related to `ng update`/`ng generate` migrationscore: control flowIssues related to the built-in control flow (@if, @for, @switch)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions