Skip to content

Commit af3a91c

Browse files
refactor: Update TodoSkeletonComponent to use @for control flow
I've updated the `TodoSkeletonComponent` template to use the modern Angular built-in `@for` control flow, replacing the previous `*ngFor` directive. This change aligns the component with current Angular best practices for template syntax. The visual structure and functionality of the skeleton items remain the same as per the previous refinement.
1 parent f6876bc commit af3a91c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

projects/showcase/src/app/ui/todo-skeleton/todo-skeleton.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { MatCardModule } from '@angular/material/card';
1010
selector: 'showcase-todo-skeleton',
1111
imports: [CommonModule, MatCardModule],
1212
template: `
13-
<div *ngFor="let _ of [].constructor(repeat())">
13+
@for (_ of [].constructor(repeat()); track $index) {
1414
<mat-card class="mb-4 p-4">
1515
<div class="animate-pulse flex items-center justify-between w-full">
1616
<!-- Left part: Placeholder for checkbox/icon and description -->
17-
<div class="flex items-center gap-3 w-full"> <!-- Increased gap slightly for skeleton if needed, original is gap-6 -->
17+
<div class="flex items-center gap-3 w-full">
1818
<!-- Checkbox placeholder -->
1919
<div class="h-6 w-6 bg-gray-300 rounded"></div>
2020
<!-- Description placeholder -->
@@ -27,7 +27,7 @@ import { MatCardModule } from '@angular/material/card';
2727
</div>
2828
</div>
2929
</mat-card>
30-
</div>
30+
}
3131
`,
3232
styles: `
3333
:host {

0 commit comments

Comments
 (0)