Title: `firstChange` not set properly in `ngOnChanges` for pre-bound properties · Issue #36130 · angular/angular · GitHub
Open Graph Title: `firstChange` not set properly in `ngOnChanges` for pre-bound properties · Issue #36130 · angular/angular
X Title: `firstChange` not set properly in `ngOnChanges` for pre-bound properties · Issue #36130 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Is this a regression? No. Description When a property is set on an element prior to it being attached to the DOM, the initial call to ngOnChanges does not hav...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Is this a regression? No. Description When a property is set on an element prior to it being attached to the DOM, the ...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Is this a regression? No. Description When a property is set on an element prior to it being attached to the DOM, the ...
Opengraph URL: https://github.com/angular/angular/issues/36130
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`firstChange` not set properly in `ngOnChanges` for pre-bound properties","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\nThe issue is caused by package @angular/elements\r\n\r\n### Is this a regression?\r\nNo.\r\n\r\n### Description\r\nWhen a property is set on an element prior to it being attached to the DOM, the initial call to `ngOnChanges` does not have `firstChange` properties set to `true`.\r\n\r\nThis requires code from #36114, to fix #30848 in order for `ngOnChanges` to fire at all -- this is a follow-on issue.\r\n\r\n## 🔬 Minimal Reproduction\r\nhttps://github.com/antch/angular-elements-lifecycle-hooks\r\nYou can look at console logs to see lifecycle events for both the Native Angular element, and the Custom Element. The reproduction uses artifacts from a [CI build](https://circleci.com/gh/angular/angular/657041#artifacts/containers/0) associated with #36114.\r\n\r\nThere is a secondary issue here, that is -- event listeners on component outputs won't fire during `ngOnInit`, `ngOnChanges`, `ngAfterViewInit`, and `ngAfterContentInit`. This is in contrast to the native element which does fire the callback during these hooks. You can see this by examining the `ul` and `li` elements in each section.\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n*Warning:* This is a build off of CI assets, so this isn't entirely accurate.\r\n\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 9.0.6\r\nNode: 10.14.2\r\nOS: darwin x64\r\n\r\nAngular: 9.1.0-next.4\r\n... animations, common, compiler, compiler-cli, core, elements\r\n... forms, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.900.6\r\n@angular-devkit/build-angular 0.900.6\r\n@angular-devkit/build-optimizer 0.900.6\r\n@angular-devkit/build-webpack 0.900.6\r\n@angular-devkit/core 9.0.6\r\n@angular-devkit/schematics 9.0.6\r\n@angular/cli 9.0.6\r\n@ngtools/webpack 9.0.6\r\n@schematics/angular 9.0.6\r\n@schematics/update 0.900.6\r\nrxjs 6.5.4\r\ntypescript 3.6.5\r\nwebpack 4.41.2\r\n\u003c/code>\u003c/pre>\r\n","author":{"url":"https://github.com/antch","@type":"Person","name":"antch"},"datePublished":"2020-03-18T20:01:22Z","url":"https://github.com/angular/angular/issues/36130"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:abf32bc5-69e8-1586-7887-d189b3cb7866 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDDC:24ACB9:E98A86:1345BC4:6B00FD78 |
| html-safe-nonce | 44e3cfc9b5e8352cf2950f01844fbd3a0995f60bd0399aec3f826eead91c3296 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRERDOjI0QUNCOTpFOThBODY6MTM0NUJDNDo2QjAwRkQ3OCIsInZpc2l0b3JfaWQiOiI3OTUyNDk1NTMyMjA1NzM1Mjg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6443acd345007c0a6c721f6d08eddb3feac55d6802cb8d935cabc33226f3dfd6 |
| hovercard-subject-tag | issue:583970446 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/36130/issue_layout |
| twitter:image | https://opengraph.githubassets.com/504b6b7a733ae46fb26f7d9aae459c90ffc724c4a9118be3eb3ef1d8263effe7/angular/angular/issues/36130 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/504b6b7a733ae46fb26f7d9aae459c90ffc724c4a9118be3eb3ef1d8263effe7/angular/angular/issues/36130 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/elements Is this a regression? No. Description When a property is set on an element prior to it being attached to the DOM, the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | antch |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width