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 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
http | ||
language-service | ||
localize | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
platform-webworker | ||
platform-webworker-dynamic | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
zone.js | ||
BUILD.bazel | ||
README.md | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build-no-strict.json | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
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