Go to file
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
.circleci docs: fix various typos (#37443) 2020-06-04 16:03:54 -07:00
.devcontainer build: update the recommended `Dockerfile` for VSCode remote development (#34697) 2020-01-09 13:31:14 -08:00
.github docs: update the stackblitz in the GitHub Issue template (#37219) 2020-06-03 15:55:44 -07:00
.ng-dev refactor(dev-infra): change required base commit sha (#37424) 2020-06-04 10:44:14 -07:00
.vscode build: fix @bazel/bazel to bazelisk leftovers (#36132) 2020-03-19 08:58:47 -07:00
.yarn build: update to latest version of yarn (#36464) 2020-04-14 12:47:30 -07:00
aio docs: fix minor error in the "Structural directives" guide (#37452) 2020-06-05 09:20:43 -07:00
dev-infra refactor(dev-infra): move GitClient to common util (#37318) 2020-06-05 09:46:40 -07:00
docs docs: add blank line before header (#37391) 2020-06-04 09:20:26 -07:00
goldens build: fix integration payload sizes 2020-06-02 10:51:06 -07:00
integration fix(core): reenable decorator downleveling for Angular npm packages (#37317) 2020-05-29 18:52:01 -04:00
modules refactor(dev-infra): small changes and fixes (#36800) 2020-06-03 13:12:30 -07:00
packages fix(elements): fire custom element output events during component initialization (#36161) 2020-06-05 10:36:39 -07:00
scripts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
third_party ci: Remove old vendoring solution in favor of relying on yarn-path (#35083) 2020-02-06 15:30:51 -08:00
tools refactor(dev-infra): small changes and fixes (#36800) 2020-06-03 13:12:30 -07:00
.bazelignore build: add npm package manifest to npm_integration_test (#35669) 2020-02-26 12:58:35 -08:00
.bazelrc build: do not build runfile trees unnecessarily (#36914) 2020-05-05 12:00:04 -07:00
.bazelversion build: depend on bazelisk rather than directly on Bazel (#36078) 2020-03-16 10:58:06 -07:00
.clang-format
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.gitattributes test: fix ts api guardian and public guard tests on windows (#30105) 2019-04-26 16:32:22 -07:00
.gitignore ci: do not run benchmark measurements in circleci (#34753) 2020-01-29 09:22:27 -08:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: migrate to node@12.14.1 (#34955) 2020-01-27 09:31:22 -08:00
.pullapprove.yml revert: "revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798)" (#36800) 2020-06-03 13:12:30 -07:00
.yarnrc build: update to latest version of yarn (#36464) 2020-04-14 12:47:30 -07:00
BUILD.bazel revert: "revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798)" (#36800) 2020-06-03 13:12:30 -07:00
CHANGELOG.md docs: release notes for the v10.0.0-rc.2 release 2020-06-01 11:14:39 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md docs(dev-infra): update triage and contributing docs for dev-infra (#35995) 2020-03-10 21:02:17 -04:00
LICENSE build: bump year (#34651) 2020-01-13 07:21:43 -08:00
README.md docs: remove browserstack badge from readme (#35684) 2020-03-17 09:29:43 -07:00
WORKSPACE refactor(dev-infra): small changes and fixes (#36800) 2020-06-03 13:12:30 -07:00
browser-providers.conf.js ci: temporarily disable Android 10 browser unit tests on Saucelabs (#37399) 2020-06-02 17:32:34 -04:00
gulpfile.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
karma-js.conf.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build: add dev-infra to tslint selected files (#37233) 2020-06-04 12:44:46 -07:00
shims_for_IE.js
test-events.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test-main.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tslint.json build: Update file-header lint rule to Google LLC (#37205) 2020-05-26 14:26:58 -04:00
yarn.lock fix(core): disable tsickle pass when producing APF packages (#37221) 2020-05-21 09:14:47 -07:00
yarn.lock.readme.md build: remove travisci leftovers (#27979) 2019-01-09 10:41:16 -08:00

README.md

CircleCI Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

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.