cf37c003ff
Angular View Engine uses global knowledge to compile the following code: ```typescript export class Base { constructor(private vcr: ViewContainerRef) {} } @Directive({...}) export class Dir extends Base { // constructor inherited from base } ``` Here, `Dir` extends `Base` and inherits its constructor. To create a `Dir` the arguments to this inherited constructor must be obtained via dependency injection. View Engine is able to generate a correct factory for `Dir` to do this because via metadata it knows the arguments of `Base`'s constructor, even if `Base` is declared in a different library. In Ivy, DI is entirely a runtime concept. Currently `Dir` is compiled with an ngDirectiveDef field that delegates its factory to `getInheritedFactory`. This looks for some kind of factory function on `Base`, which comes up empty. This case looks identical to an inheritance chain with no constructors, which works today in Ivy. Both of these cases will now become an error in this commit. If a decorated class inherits from an undecorated base class, a diagnostic is produced informing the user of the need to either explicitly declare a constructor or to decorate the base class. PR Close #34460 |
||
---|---|---|
.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 | ||
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.