Title: AsyncPipe breaks change detection with NaN values · Issue #15721 · angular/angular · GitHub
Open Graph Title: AsyncPipe breaks change detection with NaN values · Issue #15721 · angular/angular
X Title: AsyncPipe breaks change detection with NaN values · Issue #15721 · angular/angular
Description: I'm submitting a ... [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/ma...
Open Graph Description: I'm submitting a ... [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see ht...
X Description: I'm submitting a ... [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, inst...
Opengraph URL: https://github.com/angular/angular/issues/15721
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AsyncPipe breaks change detection with NaN values","articleBody":"**I'm submitting a ...**\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior**\r\n\r\nIt seems that the `AsyncPipe` emits a `WrappedValue` (which appears below as `'[object Object]'`) *then* the `NaN`, which causes an expression change:\r\n\r\n```\r\nERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '[object Object]'. Current value: 'NaN'.\r\n at viewDebugError (errors.ts:30) [angular]\r\n at expressionChangedAfterItHasBeenCheckedError (errors.ts:29) [angular]\r\n at checkBindingNoChanges (util.ts:145) [angular]\r\n at checkNoChangesNodeInline (view.ts:438) [angular]\r\n at checkNoChangesNode (view.ts:519) [angular]\r\n at debugCheckNoChangesNode (services.ts:387) [angular]\r\n at debugCheckRenderNodeFn (services.ts:330) [angular]\r\n at Object.eval [as updateRenderer] (AppComponent.html:1) [angular]\r\n at Object.debugUpdateRenderer [as updateRenderer] (services.ts:307) [angular]\r\n at checkNoChangesView (view.ts:368) [angular]\r\n at callViewAction (view.ts:694) [angular]\r\n at execComponentViewsAction (view.ts:644) [angular]\r\n at checkNoChangesView (view.ts:368) [angular]\r\n at callWithDebugContext (services.ts:645) [angular]\r\n```\r\n\r\n**Expected behavior**\r\n`NaN` should be handled by `| async` without breaking change detection.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\n\r\n```\r\n@Component({\r\n selector: 'my-app',\r\n template: `\u003ch1>Hello {{ name$ | async }}\u003c/h1>`\r\n})\r\nexport class AppComponent { \r\n name$ = Observable.of(NaN); \r\n}\r\n```\r\n\r\nPlunkr: https://plnkr.co/edit/Dc6jwz?p=preview\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nWe have various pipes that operate on numbers (to generate friendly and consistent representations) that are loaded asynchronously, so we have quite a few lines that look like:\r\n\r\n```\r\n{{ something$ | async | customPipe }}\r\n```\r\n\r\n**Please tell us about your environment:**\r\n\r\n* **Angular version:** 4.0.1\r\n\r\n* **Browser:** Chrome 57.0.2987.110, IE 11.0.9600.18537\r\n \r\n* **Language:** TypeScript 2.1.6 (local), 2.2.1 (Plunkr)\r\n","author":{"url":"https://github.com/textbook","@type":"Person","name":"textbook"},"datePublished":"2017-04-03T10:23:06Z","url":"https://github.com/angular/angular/issues/15721"}
| 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:3f84110e-84e6-52b9-270e-a149b2619def |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D948:358871:1B60F9F:24053AF:6B014C02 |
| html-safe-nonce | cd15264a39bb03c67c075353873f5900f496f42b992e4ccbffa391f74d65e951 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTQ4OjM1ODg3MToxQjYwRjlGOjI0MDUzQUY6NkIwMTRDMDIiLCJ2aXNpdG9yX2lkIjoiMTg5MDI2NzM4NzEwNjc3NDAxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f59d19efca32f98fff5a383773fd68e1790d3f6cdffcf4f407798535e89ea610 |
| hovercard-subject-tag | issue:218889912 |
| 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/15721/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8e5b389c7751227e58819df424688ce051aca6cace5177167c6a119ee1cb58ab/angular/angular/issues/15721 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8e5b389c7751227e58819df424688ce051aca6cace5177167c6a119ee1cb58ab/angular/angular/issues/15721 |
| og:image:alt | I'm submitting a ... [x] bug report => search github for a similar issue or PR before submitting [ ] feature request [ ] support request => Please do not submit support request here, instead see ht... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | textbook |
| 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