mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Angular generally supports cycles between components in the same NgModule. We have a mechanism of moving the component scope declaration into the NgModule file in this case. This ensures that Angular never itself introduces an import which creates a cycle. What happens if the cycle already exists in the user's program, though, is a bit different. In these cases, the "correct" emit for Angular is to generate the component scope (whether direct or remote) inside of a closure, to prevent evaluating the scope's references until module evaluation is complete and all cyclic imports have been resolved. We don't want to do this for *all* scopes because the code size cost of emitting a function wrapper is non-zero. In this fix, we take the presence of a `forwardRef` in a component's `imports` or in an NgModule `declarations` or `imports` as a sign that component scopes emitted into those files need to be protected against cyclic references. In a future commit, we may introduce a warning or error if cyclic imports are not protected behind `forwardRef` in these cases, but this will take some time to implement. PR Close #46139 |
||
|---|---|---|
| .. | ||
| animations | ||
| bazel | ||
| benchpress | ||
| common | ||
| compiler | ||
| compiler-cli | ||
| core | ||
| docs | ||
| elements | ||
| examples | ||
| forms | ||
| language-service | ||
| localize | ||
| misc/angular-in-memory-web-api | ||
| platform-browser | ||
| platform-browser-dynamic | ||
| platform-server | ||
| private/testing | ||
| router | ||
| service-worker | ||
| upgrade | ||
| zone.js | ||
| BUILD.bazel | ||
| circular-deps-test.conf.js | ||
| empty.ts | ||
| goog.d.ts | ||
| license-banner.txt | ||
| README.md | ||
| system.d.ts | ||
| tsconfig-build.json | ||
| tsconfig-legacy-saucelabs.json | ||
| tsconfig-test.json | ||
| tsconfig-tsec-base.json | ||
| tsconfig.json | ||
| tsec-exemption.json | ||
| types.d.ts | ||
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