Skip to content

Commit 0225906

Browse files
committed
feat: enhance hobbies section with remove button and update add hobby button style
1 parent 8d6017e commit 0225906

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/examples/signal-form/example4/example4.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ <h2>Example 4: Signal Form Signup with Dynamic Hobbies & Validation</h2>
4040
<div>
4141
<h3>Hobbies</h3>
4242
@for (hobby of userForm.hobbies; track hobby; let i = $index) {
43-
<div>
44-
<input [control]="hobby.name" placeholder="Enter hobby" />
43+
<div class="flex gap-2 items-center mb-2">
44+
<input [control]="hobby.name" placeholder="Enter hobby" />
45+
<button mat-flat-button color="warn" type="button" (click)="removeHobby(i)" >X</button>
4546
@if(hobby.name().touched() || hobby.name().dirty()) {
4647
@for (err of hobby.name().errors(); track err.kind) {
4748
<p style="color:red">{{ err.message }}</p>
4849
}
4950
}
50-
<button mat-stroked-button color="primary" type="button" (click)="removeHobby(i)" >Remove</button>
5151
</div>
5252
}
5353
@empty {
5454
<p class="text-gray-500 py-2">No hobbies added yet.</p>
5555
}
56-
<button mat-stroked-button color="primary" type="button" (click)="addHobby()" >+ Add Hobby</button>
56+
<button mat-flat-button color="primary" type="button" (click)="addHobby()" >+ Add</button>
5757
</div>
5858

5959
<div>

0 commit comments

Comments
 (0)