Title: Unable to overwrite ngDestroy inside the component · Issue #36776 · angular/angular · GitHub
Open Graph Title: Unable to overwrite ngDestroy inside the component · Issue #36776 · angular/angular
X Title: Unable to overwrite ngDestroy inside the component · Issue #36776 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... Is this a regression? Yes, the previous version in which this bug was not present was: 8.2 Description Please take a look here for a source code: https://github.c...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... Is this a regression? Yes, the previous version in which this bug was not present was: 8.2 Description Please take a look ...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/.... Is this a regression? Yes, the previous version in which this bug was not present was: 8.2 Description Please take a look ...
Opengraph URL: https://github.com/angular/angular/issues/36776
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to overwrite ngDestroy inside the component","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\n\u003c!-- Can you pin-point one or more @angular/* packages as the source of the bug? -->\r\n\u003c!-- ✍️edit: --> The issue is caused by package @angular/....\r\n\r\n\r\n### Is this a regression?\r\n\r\nYes, the previous version in which this bug was not present was: 8.2\r\n\r\n\r\n### Description\r\n\r\nPlease take a look here for a source code:\r\nhttps://github.com/xtephan/ng-destroy-test/blob/master/src/app/destroyable/destroyable.component.ts\r\n\r\nWhen the `DestroyableComponent` is being destroyed, the `ngOnDestroy` method as defined on line 16 is called, instead of as defined on line 11.\r\n\r\nIf inspecting the component using the devtools, `ngOnDestroy` method points to being located on line 11:\r\n\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\nhttps://github.com/xtephan/ng-destroy-test\r\n\r\nThe `master` branch contains ng9, where bug can be seen present. \r\n\r\nThe `ng8` branch contains ng8, where the bug was not present. \r\n\r\nRun the app with `ng serve` and access `http://localhost:4200`. In the webpage, press the toggle button to destroy the inner component. \r\n\r\nThe expected result would to see `this.ngOnDestroy called` outputed in the console. \r\nActual behaviour is that `DestroyableComponent.ngOnDestroy called` is being outputed.\r\n\r\n## 🔥 Exception or Error\r\nNone\r\n\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\n _ _ ____ _ ___\r\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\r\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\r\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\r\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\r\n |___/\r\n \r\n\r\nAngular CLI: 9.1.3\r\nNode: 12.4.0\r\nOS: darwin x64\r\n\r\nAngular: 9.1.3\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router\r\nIvy Workspace: Yes\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.901.3\r\n@angular-devkit/build-angular 0.901.3\r\n@angular-devkit/build-optimizer 0.901.3\r\n@angular-devkit/build-webpack 0.901.3\r\n@angular-devkit/core 9.1.3\r\n@angular-devkit/schematics 9.1.3\r\n@ngtools/webpack 9.1.3\r\n@schematics/angular 9.1.3\r\n@schematics/update 0.901.3\r\nrxjs 6.5.5\r\ntypescript 3.8.3\r\nwebpack 4.42.0\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\n\u003c!-- ✍️Is this a browser specific issue? If so, please specify the browser and version. -->\r\n\r\n\u003c!-- ✍️Do any of these matter: operating system, IDE, package manager, HTTP server, ...? If so, please mention it below. -->\r\n","author":{"url":"https://github.com/xtephan","@type":"Person","name":"xtephan"},"datePublished":"2020-04-23T06:39:18Z","url":"https://github.com/angular/angular/issues/36776"}
| 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:89aac525-fd06-db0d-61c3-a4f44a20c017 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D720:E9D16:EEBFCF:12E6DCE:6B0144A6 |
| html-safe-nonce | b64d60d4a14400ef23b3d5389276ac35312f86524041d7f0db099efd8a8345ed |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzIwOkU5RDE2OkVFQkZDRjoxMkU2RENFOjZCMDE0NEE2IiwidmlzaXRvcl9pZCI6IjgwODczMDM3OTI0MzkxNDk3MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f33ea5a7142572f8319a3475369cbbf9b5241cf74d5a1c1c4b34701a13052867 |
| hovercard-subject-tag | issue:605279652 |
| 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/36776/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d038ce4566b956ce44c44d8418bdddd757a8ff6366202aea209571225f51fdeb/angular/angular/issues/36776 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d038ce4566b956ce44c44d8418bdddd757a8ff6366202aea209571225f51fdeb/angular/angular/issues/36776 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/.... Is this a regression? Yes, the previous version in which this bug was not present was: 8.2 Description Please take a look ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xtephan |
| 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