Title: Pipe (`|`) operator has incorrect precedence (too tight) · Issue #27415 · angular/angular · GitHub
Open Graph Title: Pipe (`|`) operator has incorrect precedence (too tight) · Issue #27415 · angular/angular
X Title: Pipe (`|`) operator has incorrect precedence (too tight) · Issue #27415 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? Yes, the previous version in which this bug was not present was: 1.x Description AngularJS: a ? b : c | x means (a ? b : c) | x. Angular: a ...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? Yes, the previous version in which this bug was not present was: 1.x Description AngularJS: a ? b : ...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? Yes, the previous version in which this bug was not present was: 1.x Description AngularJS: a ? b : ...
Opengraph URL: https://github.com/angular/angular/issues/27415
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pipe (`|`) operator has incorrect precedence (too tight)","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/core\r\n\r\n\r\n### Is this a regression?\r\n\r\n\u003c!-- Did this behavior use to work in the previous version? -->\r\n\u003c!-- ✍️--> Yes, the previous version in which this bug was not present was: 1.x\r\n\r\n\r\n### Description\r\n\r\nAngularJS: `a ? b : c | x` means `(a ? b : c) | x`.\r\n\r\nAngular: `a ? b : c | x` means `a ? b : (c | x)`.\r\n\r\nIt is unexpected. E.g. see #19657, https://github.com/prettier/prettier/issues/5586.\r\n\r\nWho would write `a ? b : c | x` meaning `a ? b : (c | x)` given that `a ? b | x : c` even is not a valid expression? This does not look like an intentional design decision, more like a mistake (bug).\r\n\r\nThe natural expectation is that the pipe in the end of an expression should be applied to the whole expression, even if there is no parentheses. According to the [docs](https://angular.io/guide/pipes), pipes are _a way to write display-value transformations that you can declare in your HTML_. They are perceived as external to expressions, something that modifies the expression without really being part of it. For this intuition to be valid, pipes must have the lowest precedence. The current behavior breaks the intuition for no reason, without adding any value.\r\n\r\n## 🔬 Minimal Reproduction\r\n\r\n* https://stackblitz.com/edit/angularjs-ouvjdv?file=home%2Fhome.html\r\n* https://stackblitz.com/edit/angular-wn7zmz?file=src%2Fapp%2Fapp.component.html\r\n\r\n\r\n","author":{"url":"https://github.com/thorn0","@type":"Person","name":"thorn0"},"datePublished":"2018-12-03T13:28:06Z","url":"https://github.com/angular/angular/issues/27415"}
| 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:f218e8fb-02e2-0309-8b60-8c5be622b2d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1DA:D0E46:17BFB2F:1F47B75:6B013957 |
| html-safe-nonce | fd17d236bb77ed30e1f20767b06e165740bb1ff837ae486e904daa67bf944730 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMURBOkQwRTQ2OjE3QkZCMkY6MUY0N0I3NTo2QjAxMzk1NyIsInZpc2l0b3JfaWQiOiIzNTgyNDAxMjI2NjA5ODY3MDk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d52ba1648ace79c13b73cfcd3888a02d272db1fa359918c1d58c8e7197cf3d1a |
| hovercard-subject-tag | issue:386817582 |
| 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/27415/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dae1868349833c19d88b7955c508277a8b2ffe874e7994f774a2d5ee6ea1b401/angular/angular/issues/27415 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dae1868349833c19d88b7955c508277a8b2ffe874e7994f774a2d5ee6ea1b401/angular/angular/issues/27415 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/core Is this a regression? Yes, the previous version in which this bug was not present was: 1.x Description AngularJS: a ? b : ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | thorn0 |
| 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