refactor(igx-ts): control flow and class migration#1584
Conversation
Migrated carousel, dropdown, chip, select (default, groups, in-form), autocomplete (custom, extended), input-group, list, and tree templates from *ngIf/*ngFor to @if/@for syntax. Removed NgIf/NgFor imports. Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/375664ee-c0d9-49d6-a1d2-9efb61015c44 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
…ol flow Migrated awesome-grid, crm-grid, fintech-grid, fintech-tree-grid, login, weather-forecast, side-nav, and side-nav-auth templates from *ngIf/*ngFor to @if/@for syntax. Removed NgIf/NgFor imports. Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/375664ee-c0d9-49d6-a1d2-9efb61015c44 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates igx-ts standalone component templates from *ngIf/*ngFor to Angular built-in control flow (@if/@for) and removes now-unneeded NgIf/NgFor standalone imports.
Changes:
- Replaced structural directive usage in
igx-tstemplates with@if/@forblocks (includingtrackexpressions). - Removed
NgIf/NgForimports from@angular/commonand from standalone componentimportsarrays. - Kept other
@angular/commonimports that are still required (e.g.,NgTemplateOutlet,NgClass, pipes).
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/igx-templates/igx-ts/tree/default/files/src/app/path/filePrefix.ts | Drops NgIf/NgFor imports from standalone component. |
| packages/igx-templates/igx-ts/tree/default/files/src/app/path/filePrefix.html | Converts *ngFor/*ngIf to @for/@if in tree template. |
| packages/igx-templates/igx-ts/select/select-in-form/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/select/select-in-form/files/src/app/path/filePrefix.html | Converts select item loop to @for. |
| packages/igx-templates/igx-ts/select/select-groups/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/select/select-groups/files/src/app/path/filePrefix.html | Converts grouped select loops to nested @for. |
| packages/igx-templates/igx-ts/select/default/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/select/default/files/src/app/path/filePrefix.html | Converts select items rendering to @for. |
| packages/igx-templates/igx-ts/projects/side-nav/files/src/app/app.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/projects/side-nav/files/src/app/app.html | Converts route list rendering to @for. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login/login.ts | Removes NgIf from imports/imports-array. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login/login.html | Converts conditional social login section/buttons to @if. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login-dialog/login-dialog.ts | Removes NgIf from imports/imports-array. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login-dialog/login-dialog.html | Converts login/register toggling to @if. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts | Removes NgIf from imports/imports-array. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.html | Converts authenticated/unauthenticated UI toggles to @if. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/app.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/projects/side-nav-auth/files/src/app/app.html | Converts route list rendering to @for. |
| packages/igx-templates/igx-ts/list/default/files/src/app/path/filePrefix.ts | Removes NgIf/NgFor imports and keeps NgClass. |
| packages/igx-templates/igx-ts/list/default/files/src/app/path/filePrefix.html | Converts search suffix visibility and list rendering to @if/@for. |
| packages/igx-templates/igx-ts/input-group/default/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/input-group/default/files/src/app/path/filePrefix.html | Converts select-group/item loops to nested @for. |
| packages/igx-templates/igx-ts/dropdown/default/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/dropdown/default/files/src/app/path/filePrefix.html | Converts dropdown items rendering to @for. |
| packages/igx-templates/igx-ts/custom-templates/weather-forecast/files/src/app/path/filePrefix.ts | Removes NgIf/NgFor imports and keeps NgClass. |
| packages/igx-templates/igx-ts/custom-templates/weather-forecast/files/src/app/path/filePrefix.html | Converts conditional main/forecast rendering and loop to @if/@for. |
| packages/igx-templates/igx-ts/custom-templates/login/files/src/app/path/filePrefix.ts | Removes NgIf from imports/imports-array. |
| packages/igx-templates/igx-ts/custom-templates/login/files/src/app/path/filePrefix.html | Converts form/success visibility toggles to @if. |
| packages/igx-templates/igx-ts/custom-templates/fintech-tree-grid/files/src/app/path/filePrefix.ts | Removes NgIf import from @angular/common usage. |
| packages/igx-templates/igx-ts/custom-templates/fintech-tree-grid/files/src/app/path/filePrefix.html | Converts toolbar/text/icon conditionals to @if. |
| packages/igx-templates/igx-ts/custom-templates/fintech-grid/files/src/app/path/filePrefix.ts | Removes NgIf/NgFor imports, retains CurrencyPipe. |
| packages/igx-templates/igx-ts/custom-templates/fintech-grid/files/src/app/path/filePrefix.html | Converts toolbar visibility, editor item loops, and trend icon conditionals to @if/@for. |
| packages/igx-templates/igx-ts/custom-templates/crm-grid/files/src/app/path/filePrefix.ts | Removes NgIf from imports/imports-array. |
| packages/igx-templates/igx-ts/custom-templates/crm-grid/files/src/app/path/filePrefix.html | Converts multiple nested *ngIf cases to @if blocks. |
| packages/igx-templates/igx-ts/custom-templates/awesome-grid/files/src/app/path/filePrefix.ts | Removes NgIf/NgFor imports, keeps NgClass/DecimalPipe. |
| packages/igx-templates/igx-ts/custom-templates/awesome-grid/files/src/app/path/filePrefix.html | Converts top-3 overlays and badge visibility to @if/@for. |
| packages/igx-templates/igx-ts/chip/default/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/chip/default/files/src/app/path/filePrefix.html | Converts chips and dropdown items rendering to @for. |
| packages/igx-templates/igx-ts/carousel/default/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/carousel/default/files/src/app/path/filePrefix.html | Converts slides rendering to @for. |
| packages/igx-templates/igx-ts/autocomplete/autocomplete-extended/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/autocomplete/autocomplete-extended/files/src/app/path/filePrefix.html | Converts grouped dropdown rendering to nested @for. |
| packages/igx-templates/igx-ts/autocomplete/autocomplete-custom/files/src/app/path/filePrefix.ts | Removes NgFor from imports/imports-array. |
| packages/igx-templates/igx-ts/autocomplete/autocomplete-custom/files/src/app/path/filePrefix.html | Converts dropdown items rendering to @for. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/igx-templates/igx-ts/select/default/files/src/app/__path__/__filePrefix__.ts
Outdated
Show resolved
Hide resolved
...es/igx-templates/igx-ts/custom-templates/crm-grid/files/src/app/__path__/__filePrefix__.html
Outdated
Show resolved
Hide resolved
...mplates/igx-ts/autocomplete/autocomplete-extended/files/src/app/__path__/__filePrefix__.html
Outdated
Show resolved
Hide resolved
packages/igx-templates/igx-ts/select/default/files/src/app/__path__/__filePrefix__.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Damyan Petev <damyanpetev@users.noreply.github.com>
|
@copilot All the newly added |
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/a911e374-dc39-433e-900c-6252c2476d0b Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
Fixed in 2c37884 — all nested elements inside |
...es/igx-templates/igx-ts/custom-templates/crm-grid/files/src/app/__path__/__filePrefix__.html
Outdated
Show resolved
Hide resolved
…src/app/__path__/__filePrefix__.html
Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/55334d49-9474-41ec-a2cf-be8084c87a20 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
…f i >= 2 Agent-Logs-Url: https://github.com/IgniteUI/igniteui-cli/sessions/55334d49-9474-41ec-a2cf-be8084c87a20 Co-authored-by: damyanpetev <3198469+damyanpetev@users.noreply.github.com>
igx-tstemplates from structural directives to built-in Angular control flow[ngClass]→[class.*]bindings in list/default template[ngClass]→[class.*]bindings in awesome-grid template (2 usages)[ngClass]→[class]binding in weather-forecast templateNgClassimports from all 3 affected TS filesngStyleusages found — nothing to migrate✅ Integration Test Summary
Test: Create igx-ts project with all components and verify build
Steps performed:
yarn build— success)ig new test-app --framework=angular --type=igx-tsComponents added (all succeeded):
npm install— success)npx ng build— ✅ Build succeeded with zero errorsdist/test-app/Migration verification:
*ngFor/*ngIfreferences in any generated componentngClass/NgClass/ngStyle/NgStylereferences in any generated component@if,@for,@switch)[class.*]syntax instead of[ngClass]