File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/app/examples/signal-form/example4 Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments