angular/packages
Dylan Hunn dba6a60861 fix(forms): Value and RawValue should be part of the public API. (#45978)
Consider a typed group for storing contact information:

```
declare interface ContactControls {
	name: FormControl<string|null>;
}

contactForm: FormGroup<ContactControls> = ...;

saveForm(form: FormGroup<ContactControls>) {
	service.newContact(contactForm.value);
}
```

What should be the type of `newContact`? The answer, of course, is the value type:

```
declare interface Contact {
	name: string|null;
}

class ContactService {
	newContact(c: Contact) {}
}
```

This is quite redundant, and therefore, we should allow the value type to be generated automatically. We already have the helper types to do this -- we just need to document and export them. Then, this becomes possible:

```
class ContactService {
	newContact(c: RawValue<FormGroup<ContactControls>>) {}
}
```

PR Close #45978
2022-05-16 18:36:53 +00:00
..
animations feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) 2022-04-21 11:09:39 -07:00
bazel refactor(bazel): add support for starlark's unused_inputs_list (#45946) 2022-05-11 11:21:56 -07:00
benchpress build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00
common build: disable bazel nodejs linker to improve stability on windows (#45872) 2022-05-04 16:20:57 -07:00
compiler fix(compiler): exclude empty styles from emitted metadata (#45459) 2022-05-03 09:38:36 -07:00
compiler-cli fix(language-service): Add resource files as roots to their associated projects (#45601) 2022-05-10 09:36:26 -07:00
core refactor(core): avoid code duplication in standalone-related logic (#45949) 2022-05-16 10:05:23 -07:00
docs refactor: fix various typos across different packages (#44523) 2022-01-07 18:11:10 +00:00
elements feat(core): drop support for Node.js 12 (#45286) 2022-03-08 12:05:03 -08:00
examples refactor(core): drop all .ngfactory and .ngsummary imports (#44957) 2022-02-07 15:31:49 -08:00
forms fix(forms): Value and RawValue should be part of the public API. (#45978) 2022-05-16 18:36:53 +00:00
language-service fix(language-service): Fix detection of Angular for v14+ projects (#45998) 2022-05-16 10:03:53 -07:00
localize fix(localize): ensure transitively loaded compiler code is tree-shakable (#45405) 2022-04-21 11:09:39 -07:00
misc/angular-in-memory-web-api build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00
platform-browser perf(platform-browser): avoid including Testability by default in bootstrapApplication (#45885) 2022-05-10 13:34:28 -07:00
platform-browser-dynamic feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) 2022-04-21 11:09:39 -07:00
platform-server refactor(core): make Testability compatible with tree-shaking (#45657) 2022-05-05 11:50:23 -07:00
private/testing test: remove Ivy/ViewEngine switch helpers and obsolete tests (#44120) 2021-11-24 19:42:39 +00:00
router refactor(router): Only create the Route injector when the path matches (#45990) 2022-05-13 12:19:16 -07:00
service-worker feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) 2022-04-21 11:09:39 -07:00
upgrade feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405) 2022-04-21 11:09:39 -07:00
zone.js build: update to TypeScript 4.7 RC (#45966) 2022-05-13 09:36:46 -07:00
BUILD.bazel build: Auto-gen tsec tsconfig files (#43440) 2021-09-17 17:17:34 +00:00
circular-deps-test.conf.js refactor: replace deprecated String.prototype.substr() (#45397) 2022-03-24 11:48:09 -07:00
empty.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
goog.d.ts refactor(core): replace references to goog.LOCALE with goog.getLocale() (#43089) 2021-08-10 10:35:26 -07:00
license-banner.txt build: bump license year (#44590) 2022-01-04 12:05:25 -08:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
system.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tsconfig-build.json build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
tsconfig-legacy-saucelabs.json build: bundle spec files for saucelabs legacy job (#44281) 2021-11-30 11:56:04 -05:00
tsconfig-test.json build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
tsconfig-tsec-base.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00
tsconfig.json build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
tsec-exemption.json build: Enable tsec checks for critical packages. (#43108) 2021-09-13 14:45:57 -07:00
types.d.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT