angular-docs-cn/packages
George Kalpakas 2a330a60ed fix(elements): fire custom element output events during component initialization (#36161)
Previously, event listeners for component output events attached on an
Angular custom element before inserting it into the DOM (i.e. before
instantiating the underlying component) didn't fire for events emitted
during initialization lifecycle hooks, such as `ngAfterContentInit`,
`ngAfterViewInit`, `ngOnChanges` (initial call) and `ngOnInit`.
The reason was that that `NgElementImpl` [subscribed to events][1]
_after_ calling [ngElementStrategy#connect()][2], which is where the
[initial change detection][3] takes place (running the initialization
lifecycle hooks).

This commit fixes this by:
1. Ensuring `ComponentNgElementStrategy#events` is defined and available
   for subscribing to, even before instantiating the component.
2. Ensuring `NgElementImpl` subscribes to `NgElementStrategy#events`
   before calling `NgElementStrategy#connect()` (which initializes the
   component instance).

Jira issue: [FW-2010](https://angular-team.atlassian.net/browse/FW-2010)

[1]: c0143cb2ab/packages/elements/src/create-custom-element.ts (L167-L170)
[2]: c0143cb2ab/packages/elements/src/create-custom-element.ts (L164)
[3]: c0143cb2ab/packages/elements/src/component-factory-strategy.ts (L158)

Fixes #36141

PR Close #36161
2020-06-05 10:36:39 -07:00
..
animations build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
bazel build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
benchpress build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
common fix(common): prevent duplicate URL change notifications (#37404) 2020-06-04 16:45:06 -07:00
compiler build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
compiler-cli fix(ngcc): find decorated constructor params on IIFE wrapped classes (#37436) 2020-06-05 09:22:04 -07:00
core fix(core): infinite loop if injectable using inheritance has a custom decorator (#37022) 2020-06-03 13:16:25 -07:00
docs docs(di): fix typo in advanced di doc (#36634) 2020-05-01 09:50:28 -07:00
elements fix(elements): fire custom element output events during component initialization (#36161) 2020-06-05 10:36:39 -07:00
examples build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
forms refactor(forms): use a type guard to get rid of casts (#32541) 2020-06-03 12:29:26 -07:00
language-service fix(language-service): Recover from error in analyzing Ng Modules (#37108) 2020-06-03 15:56:19 -07:00
localize build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
platform-browser build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
platform-browser-dynamic build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
platform-server build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
platform-webworker build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
platform-webworker-dynamic build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
private/testing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router docs(router): fix a typo in example code (#37309) 2020-06-01 17:19:45 -04:00
service-worker build: remove wombot proxy registry from package.jsons for release (#37378) 2020-06-01 12:41:19 -04:00
upgrade refactor(core): remove `looseIdentical` in favor of built-in `Object.is` (#37191) 2020-06-01 17:19:17 -04:00
zone.js refactor(dev-infra): small changes and fixes (#36800) 2020-06-03 13:12:30 -07:00
BUILD.bazel build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
circular-deps-test.conf.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
empty.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
goog.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
license-banner.txt build: bump year (#34651) 2020-01-13 07:21:43 -08:00
system.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json revert: "revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798)" (#36800) 2020-06-03 13:12:30 -07:00
types.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00

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