Skip to content
Snippets Groups Projects
Commit 8d308dc4 authored by Paul Gschwendtner's avatar Paul Gschwendtner Committed by Alex Rickabaugh
Browse files

fix(migrations): prevent migrations from updating external templates multiple times (#44013)

The `NgComponentTemplateVisitor` helper was always referring back to the original source file on disk
rather than the virtual file in the migration. This meant that some template migrations could attempt
to modify the template multiple times resulting in invalid output.

As an example the `migration-v13-router-link-empty-expression` migrates the following template:

```
<div [routerLink]></div>
```

to

```
<div [routerLink]="[]"></div>
```

But if the template was referenced multiple times in the program, such as when the component was
referenced in the source and test entry-points, the migration would result in things like:

```
<div [routerLink]="[]"="[]"></div>
```

Fixes #44005.

PR Close #44013
parent 3fada9ee
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment