Skip to content

Commit 074bf86

Browse files
committed
signalforms: use direct ARIA attribute bindings
1 parent 09b3971 commit 074bf86

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

blog/2025-10-signal-forms-part1/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ The `registrationForm.email` field returns an array of `FieldTree` objects that
215215
<input
216216
type="email"
217217
[field]="emailField"
218-
[ariaLabel]="'E-Mail ' + $index"
218+
[aria-label]="'E-Mail ' + $index"
219219
/>
220220
<button type="button" (click)="removeEmail($index)">-</button>
221221
</div>
@@ -346,7 +346,7 @@ After the asynchronous operation is complete, it switches back to `false`.
346346
<button
347347
type="submit"
348348
[disabled]="registrationForm().submitting()"
349-
[ariaBusy]="registrationForm().submitting()"
349+
[aria-busy]="registrationForm().submitting()"
350350
>
351351
@if (registrationForm().submitting()) { Registering ... } @else { Register }
352352
</button>
@@ -457,7 +457,7 @@ Practically, this means that we can check the overall form validity by calling `
457457
<button
458458
type="submit"
459459
[disabled]="!registrationForm().valid() || registrationForm().submitting()"
460-
[ariaBusy]="registrationForm().submitting()"
460+
[aria-busy]="registrationForm().submitting()"
461461
>
462462
@if (registrationForm().submitting()) {
463463
Registering ...

blog/2025-10-signal-forms-part2/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ export class RegistrationForm {
5454
}
5555
```
5656

57-
In our template, we can now use a `[ariaInvalid]` binding on the input elements to reflect the invalid state:
57+
In our template, we can now use an `[aria-invalid]` binding on the input elements to reflect the invalid state:
5858

5959
```html
6060
<label
6161
>Username
6262
<input
6363
type="text"
6464
[field]="registrationForm.username"
65-
[ariaInvalid]="ariaInvalidState(registrationForm.username)"
65+
[aria-invalid]="ariaInvalidState(registrationForm.username)"
6666
/>
6767
<app-form-error [fieldRef]="registrationForm.username" />
6868
</label>
@@ -110,8 +110,8 @@ The validation messages will be displayed in the UI since we included our generi
110110
<input
111111
type="email"
112112
[field]="emailField"
113-
[ariaLabel]="'E-Mail ' + $index"
114-
[ariaInvalid]="ariaInvalidState(emailField)"
113+
[aria-label]="'E-Mail ' + $index"
114+
[aria-invalid]="ariaInvalidState(emailField)"
115115
/>
116116
<button type="button" (click)="removeEmail($index)">-</button>
117117
</div>
@@ -205,7 +205,7 @@ Errors can be assigned to individual fields (`pw1`) or to the grouping node (`pa
205205
type="password"
206206
autocomplete
207207
[field]="registrationForm.password.pw1"
208-
[ariaInvalid]="ariaInvalidState(registrationForm.password.pw1)"
208+
[aria-invalid]="ariaInvalidState(registrationForm.password.pw1)"
209209
/>
210210
<app-form-error [fieldRef]="registrationForm.password.pw1" />
211211
</label>
@@ -215,7 +215,7 @@ Errors can be assigned to individual fields (`pw1`) or to the grouping node (`pa
215215
type="password"
216216
autocomplete
217217
[field]="registrationForm.password.pw2"
218-
[ariaInvalid]="ariaInvalidState(registrationForm.password.pw2)"
218+
[aria-invalid]="ariaInvalidState(registrationForm.password.pw2)"
219219
/>
220220
<app-form-error [fieldRef]="registrationForm.password.pw2" />
221221
</label>
@@ -395,7 +395,7 @@ We can use this state to provide user feedback in the UI:
395395
<input
396396
type="text"
397397
[field]="registrationForm.username"
398-
[ariaInvalid]="ariaInvalidState(registrationForm.username)"
398+
[aria-invalid]="ariaInvalidState(registrationForm.username)"
399399
/>
400400
@if (registrationForm.username().pending()) {
401401
<small>Checking availability ...</small>

0 commit comments

Comments
 (0)