René's URL Explorer Experiment


Title: Control Flow: Null Checks with usage of conditional expression results not working · Issue #52855 · angular/angular · GitHub

Open Graph Title: Control Flow: Null Checks with usage of conditional expression results not working · Issue #52855 · angular/angular

X Title: Control Flow: Null Checks with usage of conditional expression results not working · Issue #52855 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? No Description We have the following code before the migration

X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? No Description We have the following code before the migration <ng-container *ngIf=" check1&& check...

Opengraph URL: https://github.com/angular/angular/issues/52855

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Control Flow: Null Checks with usage of conditional expression results not working","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore\n\n### Is this a regression?\n\nNo\n\n### Description\n\nWe have the following code before the migration \r\n\r\n\r\n```html\r\n\r\n\u003cng-container\r\n    *ngIf=\"\r\n        check1&&\r\n        check2&& {\r\n            allowed: service.BehaviorSubject$ | async\r\n        } as viewData\r\n    \"\r\n>\r\n...\r\n\u003c/ng-container>\r\n\r\n```\r\n\r\nafter migration to the new control flow we get following error:\r\n\r\n`NG1: Object is possibly 'null'. [plugin angular-compiler]`\r\n\r\nwhen we try to access check1 or check2 with this code:\r\n\r\n```html\r\n@if (check1 && check2 &&\r\n        {\r\n            allowed: service.BehaviorSubject$ | async\r\n        };\r\n        as viewData ) {\r\n     ...\r\n}\r\n\r\n```\r\n\r\n\r\nif we rewrite the code to this everything works as expected\r\n\r\n```html\r\n@if (check1 && check2) {\r\n    @if (\r\n        {\r\n            allowed: service.BehaviorSubject$ | async\r\n        };\r\n        as viewData ) {\r\n     }\r\n    ...\r\n}\r\n```\r\n\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n```true\n`NG1: Object is possibly 'null'. [plugin angular-compiler]`\n```\n\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n_No response_\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/stefannikolei","@type":"Person","name":"stefannikolei"},"datePublished":"2023-11-13T12:38:42Z","url":"https://github.com/angular/angular/issues/52855"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:208d47f1-d173-89ca-cee4-a32c8f353052
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAD2E:3F8AB1:1CFB9D9:24D7E7C:6B0143EA
html-safe-nonce822cc523ddbec24aa0e2484f87d34b5b2206158026868a298c9c5a87a12b10c7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDJFOjNGOEFCMToxQ0ZCOUQ5OjI0RDdFN0M6NkIwMTQzRUEiLCJ2aXNpdG9yX2lkIjoiNTQ1OTY5MzI5NjY3Njg0ODYxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac465351d15deda876b1df9d2a560c0b15c65fac4012c87d53242a7548f1f28fd8
hovercard-subject-tagissue:1990581615
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/52855/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f0098d3589af434fb0a9c105bd7df71cc72bffaf052e4f0ea6f5fd54562753c3/angular/angular/issues/52855
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f0098d3589af434fb0a9c105bd7df71cc72bffaf052e4f0ea6f5fd54562753c3/angular/angular/issues/52855
og:image:altWhich @angular/* package(s) are the source of the bug? core Is this a regression? No Description We have the following code before the migration