Skip to content

Commit 29f074a

Browse files
mmalerbathePunderWoman
authored andcommitted
fix(forms): Rename signal form [field] to [formField]
This completes the rename started in #66136. `[field]` is too generic of a selector for the forms system to own, and likely to cause naming collisions with existing components. Therefore it is being renamed to `[formField]` (cherry picked from commit 5671f2c)
1 parent 62d7533 commit 29f074a

File tree

49 files changed

+1935
-4789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1935
-4789
lines changed

adev/shared-docs/components/search-dialog/search-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<docs-text-field
44
[autofocus]="true"
55
[hideIcon]="true"
6-
[field]="searchForm"
6+
[formField]="searchForm"
77
[resetLabel]="'Clear the search'"
88
class="docs-search-input"
99
placeholder="Search docs"

adev/shared-docs/components/search-dialog/search-dialog.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*/
88

99
import {
10+
afterNextRender,
1011
ChangeDetectionStrategy,
1112
Component,
1213
DestroyRef,
13-
ElementRef,
14-
Injector,
15-
afterNextRender,
1614
effect,
15+
ElementRef,
1716
inject,
17+
Injector,
1818
output,
1919
viewChild,
2020
viewChildren,
@@ -26,7 +26,7 @@ import {Search, SearchHistory} from '../../services';
2626

2727
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
2828
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
29-
import {Field, form} from '@angular/forms/signals';
29+
import {form, FormField} from '@angular/forms/signals';
3030
import {Router, RouterLink} from '@angular/router';
3131
import {fromEvent} from 'rxjs';
3232
import {RelativeLink} from '../../pipes';
@@ -40,7 +40,7 @@ import {TextField} from '../text-field/text-field.component';
4040
imports: [
4141
ClickOutside,
4242
TextField,
43-
Field,
43+
FormField,
4444
SearchItem,
4545
AlgoliaIcon,
4646
RelativeLink,

adev/src/app/features/references/api-reference-list/api-reference-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ <h1>API Reference</h1>
44

55
<div class="adev-reference-list-filter">
66
<div class="adev-reference-list-query-filter">
7-
<docs-text-field placeholder="Filter" [field]="form.query" />
7+
<docs-text-field placeholder="Filter" [formField]="form.query" />
88

99
<docs-select
1010
selectId="package-entry-filter"
1111
[options]="packageOptions()"
12-
[field]="form.selectedPackage"
12+
[formField]="form.selectedPackage"
1313
/>
1414
</div>
1515

adev/src/app/features/references/api-reference-list/api-reference-list.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
viewChild,
2222
} from '@angular/core';
2323
import {Select, SelectOption, TextField} from '@angular/docs';
24-
import {Field, form} from '@angular/forms/signals';
24+
import {FormField, form} from '@angular/forms/signals';
2525
import {MatChipsModule} from '@angular/material/chips';
2626
import {Params, Router} from '@angular/router';
2727
import ApiItemLabel from '../api-item-label/api-item-label.component';
@@ -52,7 +52,7 @@ export const DEFAULT_STATUS = STATUSES.stable | STATUSES.developerPreview | STAT
5252
MatChipsModule,
5353
KeyValuePipe,
5454
Select,
55-
Field,
55+
FormField,
5656
],
5757
templateUrl: './api-reference-list.component.html',
5858
styleUrls: ['./api-reference-list.component.scss'],

adev/src/content/examples/signal-forms/src/comparison/app/signal-forms.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import {Component, signal, ChangeDetectionStrategy} from '@angular/core';
2-
import {form, Field, required, email, minLength} from '@angular/forms/signals';
1+
import {ChangeDetectionStrategy, Component, signal} from '@angular/core';
2+
import {email, form, FormField, minLength, required} from '@angular/forms/signals';
33

44
@Component({
55
selector: 'app-login',
6-
imports: [Field],
6+
imports: [FormField],
77
template: `
88
<form (submit)="onSubmit()">
99
<div>
1010
<label>
1111
Email
12-
<input type="email" [field]="loginForm.email" />
12+
<input type="email" [formField]="loginForm.email" />
1313
</label>
1414
@if (loginForm.email().touched() && loginForm.email().invalid()) {
1515
<span class="error">
@@ -21,7 +21,7 @@ import {form, Field, required, email, minLength} from '@angular/forms/signals';
2121
<div>
2222
<label>
2323
Password
24-
<input type="password" [field]="loginForm.password" />
24+
<input type="password" [formField]="loginForm.password" />
2525
</label>
2626
@if (loginForm.password().touched() && loginForm.password().invalid()) {
2727
<span class="error">

adev/src/content/examples/signal-forms/src/compat-form-control-integration/app/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<div>
33
<label>
44
Email:
5-
<input [field]="f.email" />
5+
<input [formField]="f.email" />
66
</label>
77
</div>
88

99
<div>
1010
<label>
1111
Password:
12-
<input [field]="f.password" type="password" />
12+
<input [formField]="f.password" type="password" />
1313
</label>
1414

1515
@if (f.password().touched() && f.password().invalid()) {

adev/src/content/examples/signal-forms/src/compat-form-control-integration/app/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {signal, Component, computed} from '@angular/core';
2-
import {FormControl, Validators, AbstractControl} from '@angular/forms';
3-
import {Field} from '@angular/forms/signals';
4-
import {compatForm} from '@angular/forms/signals/compat';
51
import {JsonPipe} from '@angular/common';
2+
import {Component, computed, signal} from '@angular/core';
3+
import {AbstractControl, FormControl, Validators} from '@angular/forms';
4+
import {FormField} from '@angular/forms/signals';
5+
import {compatForm} from '@angular/forms/signals/compat';
66

77
// Dummy enterprisePasswordValidator for the example
88
function enterprisePasswordValidator() {
@@ -16,7 +16,7 @@ function enterprisePasswordValidator() {
1616

1717
@Component({
1818
selector: 'app',
19-
imports: [Field, JsonPipe],
19+
imports: [FormField, JsonPipe],
2020
templateUrl: './app.html',
2121
styleUrl: './app.css',
2222
})

adev/src/content/examples/signal-forms/src/compat-form-group-integration/app/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h3>Shipping Details</h3>
44
<div>
55
<label>
66
Customer Name:
7-
<input [field]="f.customerName" />
7+
<input [formField]="f.customerName" />
88
</label>
99

1010
@if (f.customerName().touched() && f.customerName().invalid()) {

adev/src/content/examples/signal-forms/src/compat-form-group-integration/app/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {signal, Component, computed} from '@angular/core';
2-
import {FormControl, FormGroup, Validators, ReactiveFormsModule} from '@angular/forms';
3-
import {Field} from '@angular/forms/signals';
4-
import {compatForm} from '@angular/forms/signals/compat';
51
import {JsonPipe} from '@angular/common';
2+
import {Component, computed, signal} from '@angular/core';
3+
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
4+
import {FormField} from '@angular/forms/signals';
5+
import {compatForm} from '@angular/forms/signals/compat';
66

77
@Component({
88
selector: 'app',
9-
imports: [ReactiveFormsModule, Field, JsonPipe],
9+
imports: [ReactiveFormsModule, FormField, JsonPipe],
1010
templateUrl: './app.html',
1111
styleUrl: './app.css',
1212
})

adev/src/content/examples/signal-forms/src/login-simple/app/app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<form>
22
<label>
33
Email:
4-
<input type="email" [field]="loginForm.email" />
4+
<input type="email" [formField]="loginForm.email" />
55
</label>
66

77
<label>
88
Password:
9-
<input type="password" [field]="loginForm.password" />
9+
<input type="password" [formField]="loginForm.password" />
1010
</label>
1111

1212
<p>Hello {{ loginForm.email().value() }}!</p>

0 commit comments

Comments
 (0)