50bf17aca0
Prior to this change, the template type checker would always allow a value of type `undefined` to be passed into a directive's inputs, even if the input's type did not allow for it. This was due to how the type constructor for a directive was generated, where a `Partial` mapped type was used to allow for inputs to be unset. This essentially introduces the `undefined` type as acceptable type for all inputs. This commit removes the `Partial` type from the type constructor, which means that we can no longer omit any properties that were unset. Instead, any properties that are not set will still be included in the type constructor call, having their value assigned to `any`. Before: ```typescript class NgForOf<T> { static ngTypeCtor<T>(init: Partial<Pick<NgForOf<T>, 'ngForOf'|'ngForTrackBy'|'ngForTemplate'>>): NgForOf<T>; } NgForOf.ngTypeCtor(init: {ngForOf: ['foo', 'bar']}); ``` After: ```typescript class NgForOf<T> { static ngTypeCtor<T>(init: Pick<NgForOf<T>, 'ngForOf'|'ngForTrackBy'|'ngForTemplate'>): NgForOf<T>; } NgForOf.ngTypeCtor(init: { ngForOf: ['foo', 'bar'], ngForTrackBy: null as any, ngForTemplate: null as any, }); ``` This change only affects generated type check code, the generated runtime code is not affected. Fixes #32690 Resolves FW-1606 PR Close #33066 |
||
---|---|---|
.circleci | ||
.devcontainer | ||
.github | ||
.vscode | ||
aio | ||
docs | ||
integration | ||
modules | ||
packages | ||
scripts | ||
third_party | ||
tools | ||
.bazelignore | ||
.bazelrc | ||
.clang-format | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.nvmrc | ||
BUILD.bazel | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
WORKSPACE | ||
browser-providers.conf.js | ||
gulpfile.js | ||
karma-js.conf.js | ||
package.json | ||
protractor-perf.conf.js | ||
renovate.json | ||
shims_for_IE.js | ||
test-events.js | ||
test-main.js | ||
tslint.json | ||
yarn.lock | ||
yarn.lock.readme.md |
README.md
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.