Title: Projected templates do not update when using ChangeDetectionStrategy.OnPush · Issue #16012 · angular/angular · GitHub
Open Graph Title: Projected templates do not update when using ChangeDetectionStrategy.OnPush · Issue #16012 · angular/angular
X Title: Projected templates do not update when using ChangeDetectionStrategy.OnPush · Issue #16012 · angular/angular
Description: I'm submitting a ... [x] bug report [ ] feature request [ ] support request Current behavior I am dynamically creating a component (using viewContainer.createComponent) which uses ChangeDetectionStrategy.OnPush and that component instant...
Open Graph Description: I'm submitting a ... [x] bug report [ ] feature request [ ] support request Current behavior I am dynamically creating a component (using viewContainer.createComponent) which uses ChangeDetectionSt...
X Description: I'm submitting a ... [x] bug report [ ] feature request [ ] support request Current behavior I am dynamically creating a component (using viewContainer.createComponent) which uses ChangeDetecti...
Opengraph URL: https://github.com/angular/angular/issues/16012
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Projected templates do not update when using ChangeDetectionStrategy.OnPush","articleBody":"**I'm submitting a ...**\r\n```\r\n[x] bug report\r\n[ ] feature request\r\n[ ] support request\r\n```\r\n\r\n**Current behavior**\r\nI am dynamically creating a component (using `viewContainer.createComponent`) which uses ChangeDetectionStrategy.OnPush and that component instantiates a template provided by the parent component with `viewContainerRef.createEmbeddedView(templateRef)`. When the parent component updates the template, the dynamically created component does not update.\r\n\r\n**Expected behavior**\r\nIt should update\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nHere is a plnkr which has implemented a way to show a callout when clicking on an element. I have hooked up two different callout components (one uses OnPush and one uses Default).\r\n\r\nhttps://plnkr.co/edit/vYCuDwHj64qIp6GEShC9?p=preview\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nRight now we're having to use some hacky workarounds which register child change detector refs with the parent components, and having the parent component mark the children for check. Using OnPush is necessary for the performance of our app.\r\n\r\n* **Angular version:** 4.0.2\r\n\r\n* **Browser:** all\r\n \r\n* **Language:** all\r\n","author":{"url":"https://github.com/stringham","@type":"Person","name":"stringham"},"datePublished":"2017-04-15T01:33:12Z","url":"https://github.com/angular/angular/issues/16012"}
| 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:bf1103f5-9db8-a40e-5f2c-671296436664 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C78A:96DDF:1C47960:23CCDAD:6B01510B |
| html-safe-nonce | 0b71780c127e3b6eba1322b24c2608f82c0bd6db71f50df3691bf5c4121bb27c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzhBOjk2RERGOjFDNDc5NjA6MjNDQ0RBRDo2QjAxNTEwQiIsInZpc2l0b3JfaWQiOiI1ODU3NTM0Nzg1ODY1NDcwMjE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | df8fc0752b1776b7a81312227279d35493f2c170e5d5f8fcae2910da4799af1e |
| hovercard-subject-tag | issue:221918693 |
| 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/16012/issue_layout |
| twitter:image | https://opengraph.githubassets.com/951230562c2ab79b47b02fd3215123db1135b2991f00d5cd8561b42f6a98a185/angular/angular/issues/16012 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/951230562c2ab79b47b02fd3215123db1135b2991f00d5cd8561b42f6a98a185/angular/angular/issues/16012 |
| og:image:alt | I'm submitting a ... [x] bug report [ ] feature request [ ] support request Current behavior I am dynamically creating a component (using viewContainer.createComponent) which uses ChangeDetectionSt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stringham |
| 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