Skip to content

Commit d45b1f0

Browse files
committed
fix: remove duplicate imports when migrating standalone components
1 parent b9edacd commit d45b1f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/cli/src/angular/migrations/standalone/0002-import-standalone-component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ async function migrateAngularComponentClass(
154154
componentClassName,
155155
"@ionic/angular/standalone",
156156
);
157+
/**
158+
* This removes the import from the class, if it is present.
159+
* An example where it may exist is when the developer has
160+
* a @ViewChild decorator that references an ionic component.
161+
*/
162+
removeImportFromClass(sourceFile, componentClassName, "@ionic/angular");
157163
} else if (ngModuleSourceFile) {
158164
const componentClassName = kebabCaseToPascalCase(ionicComponent);
159165

0 commit comments

Comments
 (0)