Title: Angular Element inside dynamic components gets destroyed twice. · Issue #29606 · angular/angular · GitHub
Open Graph Title: Angular Element inside dynamic components gets destroyed twice. · Issue #29606 · angular/angular
X Title: Angular Element inside dynamic components gets destroyed twice. · Issue #29606 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Description We are creating a plugin based dashboard where plugins are angular libraries which are injected dynamically. Libraries expose regular angular comp...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Description We are creating a plugin based dashboard where plugins are angular libraries which are injected dynamicall...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/elements Description We are creating a plugin based dashboard where plugins are angular libraries which are injected dynamicall...
Opengraph URL: https://github.com/angular/angular/issues/29606
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Angular Element inside dynamic components gets destroyed twice.","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n The issue is caused by package @angular/elements\r\n\r\n### Description\r\n\r\nWe are creating a plugin based dashboard where plugins are angular libraries which are injected dynamically. Libraries expose regular angular components which can be instantiated at run time. Also, libraries expose **angular elements** components which can be used by other libraries.\r\n\r\nLet's say there are 2 libraries\r\n1. Product Library : Exposes `ProductDetailComponent` as regular angular component. \r\n2. Cart Library : Exposes `AddToCartComponent` as angular element.\r\n\r\n`ProductDetailComponent` refers to `AddToCartComponent` through HTML template.\r\n```html\r\n\u003cdiv>\r\n...\r\n\u003cadd-to-cart>\u003c/add-to-cart>\r\n\u003c/div>\r\n```\r\n\r\nThe Cart button renders perfectly as required. Problem occurs when we navigate away from the `ProductDetailComponent`.\r\n\r\n```\r\ne.html:1 ERROR TypeError: Cannot read property 'nativeNode' of null\r\n at removeDebugNodeFromIndex (core.js:18995)\r\n at DebugRenderer2.push../node_modules/@angular/core/fesm5/core.js.DebugRenderer2.destroyNode (core.js:24233)\r\n at destroyViewNodes (core.js:23461)\r\n at destroyView (core.js:23449)\r\n at callWithDebugContext (core.js:24176)\r\n at Object.debugDestroyView [as destroyView] (core.js:23884)\r\n at ViewRef_.push../node_modules/@angular/core/fesm5/core.js.ViewRef_.destroy (core.js:21710)\r\n at ComponentRef_.push../node_modules/@angular/core/fesm5/core.js.ComponentRef_.destroy (core.js:21546)\r\n at elements.js:236\r\n at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)\r\n```\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 7.3.6\r\nNode: 9.11.1\r\nOS: win32 x64\r\nAngular: 7.2.10\r\n... animations, common, compiler, compiler-cli, core, elements\r\n... forms, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\nPackage Version\r\n------------------------------------------------------------\r\n@angular-devkit/architect 0.13.6\r\n@angular-devkit/build-angular 0.13.6\r\n@angular-devkit/build-ng-packagr 0.13.6\r\n@angular-devkit/build-optimizer 0.13.6\r\n@angular-devkit/build-webpack 0.13.6\r\n@angular-devkit/core 7.3.6\r\n@angular-devkit/schematics 7.3.6\r\n@angular/cdk 7.3.5\r\n@angular/cli 7.3.6\r\n@angular/material 7.3.5\r\n@ngtools/json-schema 1.1.0\r\n@ngtools/webpack 7.3.6\r\n@schematics/angular 7.3.6\r\n@schematics/update 0.13.6\r\nng-packagr 4.7.1\r\nrxjs 6.3.3\r\ntypescript 3.2.4\r\nwebpack 4.29.0\r\n\u003c/code>\u003c/pre>","author":{"url":"https://github.com/Kartik1607","@type":"Person","name":"Kartik1607"},"datePublished":"2019-03-30T04:51:01Z","url":"https://github.com/angular/angular/issues/29606"}
| 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:7682bdda-fe99-91d3-1e1b-c0364f0b834b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E394:28815B:164E639:1DA5507:6B013948 |
| html-safe-nonce | 8e0301df53efeaecf7216b9d38773398de215031098b7729f905b6ecd930350c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzk0OjI4ODE1QjoxNjRFNjM5OjFEQTU1MDc6NkIwMTM5NDgiLCJ2aXNpdG9yX2lkIjoiNTQzMjE4MDg5NDc5NzE1MTQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 58922e019c21a7aba649cdc585ca2d4a384a25cb56ba2f3d77c7cec69bb5f63a |
| hovercard-subject-tag | issue:427242977 |
| 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/29606/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ecd43979b39877b6947ebd71d099c85c123e489c6e4e0efaa5a89c61b43ad0d/angular/angular/issues/29606 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ecd43979b39877b6947ebd71d099c85c123e489c6e4e0efaa5a89c61b43ad0d/angular/angular/issues/29606 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/elements Description We are creating a plugin based dashboard where plugins are angular libraries which are injected dynamicall... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Kartik1607 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width