Title: feat(router): improve typings for RouterLink boolean inputs · Issue #47100 · angular/angular · GitHub
Open Graph Title: feat(router): improve typings for RouterLink boolean inputs · Issue #47100 · angular/angular
X Title: feat(router): improve typings for RouterLink boolean inputs · Issue #47100 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? router Description Boolean inputs of RouterLink (and RouterLinkWithHref) should also accept empty string '' (and coerce that value to true). Actually, such inputs a...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? router Description Boolean inputs of RouterLink (and RouterLinkWithHref) should also accept empty string '' (and coerce that...
X Description: Which @angular/* package(s) are relevant/related to the feature request? router Description Boolean inputs of RouterLink (and RouterLinkWithHref) should also accept empty string '' (and coe...
Opengraph URL: https://github.com/angular/angular/issues/47100
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(router): improve typings for RouterLink boolean inputs","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\nrouter\n\n### Description\n\nBoolean inputs of `RouterLink` (and `RouterLinkWithHref`) should also accept empty string `''` (and coerce that value to `true`).\r\n\r\nActually, such inputs are already coerced to boolean when they are read. Instead, they should be coerced by a setter to allow simpler template bindings, such as `\u003ca routerLink=\"/\" skipLocationChange>` instead of `\u003ca routerLink=\"/\" [skipLocationChange]=\"true\">`. Currently, a compile-time error is thrown with the former syntax.\r\n\r\nThese inputs are: `preserveFragment`, `skipLocationChange` and `replaceUrl`.\n\n### Proposed solution\n\nAdd getter/setter to `preserveFragment`, `skipLocationChange` and `replaceUrl` fields of `RouterLink` and `RouterLinkWithHref` directives, for example:\r\n\r\n```ts\r\nprivate _skipLocationChange: boolean = false;\r\n\r\nget skipLocationChange(): boolean { return this._skipLocationChange; }\r\n\r\n@Input() set skipLocationChange(skipLocationChange: boolean | '' | null | undefined) {\r\n this._skipLocationChange = coerceToBoolean(skipLocationChange);\r\n}\r\n```\n\n### Alternatives considered\n\nNo alternative, more verbose template syntax is required.","author":{"url":"https://github.com/EmmanuelRoux","@type":"Person","name":"EmmanuelRoux"},"datePublished":"2022-08-09T20:30:28Z","url":"https://github.com/angular/angular/issues/47100"}
| 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:79f50e20-fdcd-24ec-a8f4-adb51d36e995 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B668:134361:E04037:1280BFE:6B00FD6D |
| html-safe-nonce | 37946d21f0222787a2922e5780a2de94df5869f680bab3cc3500a18dffbd9121 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjY4OjEzNDM2MTpFMDQwMzc6MTI4MEJGRTo2QjAwRkQ2RCIsInZpc2l0b3JfaWQiOiI5MDc5MTcyNTY2MTM1OTMwMjIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e47d3ce6214bc2e0a38bbc5d0a8751b39c9c9c70dee0126ab6a8eedd267a9a61 |
| hovercard-subject-tag | issue:1333752801 |
| 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/47100/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58c006cd3ac2041daebc3c7ccba99678b3a1aa69f4853fe5331ed401c1f82f5e/angular/angular/issues/47100 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58c006cd3ac2041daebc3c7ccba99678b3a1aa69f4853fe5331ed401c1f82f5e/angular/angular/issues/47100 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? router Description Boolean inputs of RouterLink (and RouterLinkWithHref) should also accept empty string '' (and coerce that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | EmmanuelRoux |
| hostname | github.com |
| expected-hostname | github.com |
| None | e208d86428ec00a57ade75058166297440e8128a01e5287c31a53dc042bbf187 |
| 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 | 7dafd017fb7809a839c443dba08622af38e63c09 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width