Commit graph

25 commits

Author SHA1 Message Date
Kristiyan Kostadinov
f5b50ec20d refactor: clean up explicit standalone flags from tests (#63963)
Since standalone is the default, we can dropn the `standalone: true` flags from our tests.

PR Close #63963
2025-09-22 14:27:34 +00:00
Andrew Kushnir
be7c8d4fc6 refactor(forms): convert scripts within packages/forms to relative imports (#60624)
This commit updates scripts within `packages/forms` to relative imports as a prep work to the upcoming infra updates.

PR Close #60624
2025-03-31 19:22:09 +00:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Joey Perrott
a2aca69bd3 refactor: migrate forms to prettier formatting (#55423)
Migrate formatting to prettier for forms from clang-format

PR Close #55423
2024-04-19 13:49:24 -07:00
Matthieu Riegler
b9577adeb2 refactor(forms): cleanup type any in forms tests (#48624)
Removing every type any in forms with a reference to #9100

PR Close #48624
2023-01-05 14:52:03 -08:00
Matthieu Riegler
d321880440 fix(forms): FormBuilder.group return right type with shorthand parameters. (#48084)
Extract AbstractControlOptions from type when used in shorthand parameters on FormBuilder.group

Fixes 48073

PR Close #48084
2022-11-17 11:04:54 -08:00
Cédric Exbrayat
426af91a42 feat(forms): add FormBuilder.record() method (#46485)
The new `FormRecord` entity introduced in Angular v14 does not have its builder method.
This commit adds it, allowing to write:

```
const fb = new FormBuilder();
fb.record({ a: 'one' });
```

This works for both the `FormBuilder` and the `NonNullableFormBuilder`

PR Close #46485
2022-07-15 22:02:44 +00:00
Cédric Exbrayat
089efa1ac9 refactor(forms): simplify group builder function (#46844)
Applies the same logic that we have in the `control` function.

PR Close #46844
2022-07-15 22:02:20 +00:00
Dylan Hunn
43ba4ab9da fix(forms): Allow NonNullableFormBuilder to be injected. (#45904)
Based on early feedback, calling `fb.nonNullable.group(...)` continues to be clunky for a form with many such groups. Allowing `NonNullableFormBuilder` to be directly injected enables the following:

```
constructor(private fb: NonNullableFormBuilder) {}
```

PR Close #45904
2022-05-09 17:31:48 -07:00
Dylan Hunn
fe0e42a996 fix(forms): Make UntypedFormBuilder assignable to FormBuilder, and vice versa. (#45421)
There was a subtle bug involving the opt-out class for FormBuilder, which I discovered during the ongoing migration. The types must be structurally the same, because people pass around FormBuilders, in addition to passing around the controls they produce. This PR ensures FormBuilder and UntypedFormBuilder are assignable to each other.

PR Close #45421
2022-03-24 10:49:10 -07:00
Dylan Hunn
5da31d6d25 test(forms): Add more tests for FormBuilder method argument shapes. (#44452)
It is possible to pass arguments to `FormBuilder` using four different formats: value-only, boxed value, control config, and value-array. Currently, these different methods are not well-tested, especially as they interact. This PR will add tests for the variety of different argument shapes.

This was originally inspired by typed forms: when `FormBuilder` becomes typed, all these argument shapes should just work, with correct inferred types.

PR Close #44452
2021-12-14 16:11:29 -05:00
Dylan Hunn
65717999c8 refactor(forms): Make the minimum changes to the forms unit tests in order to support the typed forms PR (#43834). (#44451)
Currently, many of our unit tests are written to use heterogenous groups and arrays, and controls that accept heterogenous values. This PR will make the minimum possible alterations to prepare those usages, mainly by annotating them as untyped controls, etc.

This PR is *not* intended to test typed forms, merely to minimize the size of the upcoming PR. This will allow that PR to be focused on the actual features and tests, rather than boilerplate fixes.

PR Close #44451
2021-12-14 16:10:08 -05:00
Dylan Hunn
1d9d02696e feat(forms): add hasValidators, addValidators, and removeValidators methods (for both sync and async) (#42838)
Several new functionalities are possible with this change: the most requested is that callers can now check whether a control has a required validator. Other uses include incrementally changing the validators set without doing an expensive operation to reset all validators.

Closes #13461.

PR Close #42838
2021-07-22 16:31:00 +00:00
Kristiyan Kostadinov
a787f78074 test: clean up internal testing utilities (#42177)
We have some internal proxies for all of the Jasmine functions, as well as some other helpers. This code hasn't been touched in more than 5 years, it can lead to confusion and it isn't really necessary since the same can be achieved using Jasmine.

These changes remove most of the code and clean up our existing unit tests.

PR Close #42177
2021-05-26 20:07:25 +00:00
Joey Perrott
d1ea1f4c7f build: update license headers to reference Google LLC (#37205)
Update the license headers throughout the repository to reference Google LLC
rather than Google Inc, for the required license headers.

PR Close #37205
2020-05-26 14:26:58 -04:00
Andrew Kushnir
7d0af179e3 style(forms): reformat of the forms package after clang update (#36466)
PR Close #36466
2020-04-07 09:47:09 -07:00
Lars Gyrup Brink Nielsen
e9e804fb02 feat(forms): add updateOn option to FormBuilder (#24599)
PR Close #24599
2018-11-01 15:31:11 -07:00
Igor Minar
b43f8bc7d3 feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)
PR Close #22573
2018-03-19 21:51:51 -07:00
Oussama Ben Brahim
54a14312d1 test(forms): update test name with correct wording (#21833)
Use the term primitive value instead of standalone

Fixes #21831

PR Close #21833
2018-02-07 12:07:14 -08:00
harunurhan
941e88ff79 feat(forms): multiple validators for array method (#20766)
Change array method signature so that array of validator and/or async
validatior functions can be passed.

Fixes #20665

PR Close #20766
2018-02-07 12:04:48 -08:00
Oussama Ben Brahim
170885c51b fix(forms): allow FormBuilder to create controls with any formState type (#20917)
Align formState type in FormBuilder#control with FormControl#constructor

Fixes #20368

PR Close #20917
2018-01-25 22:17:43 -08:00
Misko Hevery
3d50fd7cac build: add bazel test rules for remainder of packages (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Misko Hevery
47e251a80a build: remove main() from specs (#21053)
PR Close #21053
2017-12-22 13:10:51 -08:00
Jason Aden
8573e36574 build: fix file paths after moving modules/@angular/* to packages/* 2017-03-08 16:29:28 -08:00
Jason Aden
3e51a19983 refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
Renamed from modules/@angular/forms/test/form_builder_spec.ts (Browse further)