Title: routerLink support of null/undefined · Issue #6971 · angular/angular · GitHub
Open Graph Title: routerLink support of null/undefined · Issue #6971 · angular/angular
X Title: routerLink support of null/undefined · Issue #6971 · angular/angular
Description: I think it would be convenient to allow routerLink to support a case where the binding resolves to null, empty array or undefined. In that case I'd expect an tag to be created without a href attribute (or empty). This is useful for c...
Open Graph Description: I think it would be convenient to allow routerLink to support a case where the binding resolves to null, empty array or undefined. In that case I'd expect an tag to be created without a href at...
X Description: I think it would be convenient to allow routerLink to support a case where the binding resolves to null, empty array or undefined. In that case I'd expect an <a> tag to be created without...
Opengraph URL: https://github.com/angular/angular/issues/6971
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"routerLink support of null/undefined","articleBody":"I think it would be convenient to allow `routerLink` to support a case where the binding resolves to null, empty array or undefined. In that case I'd expect an `\u003ca>` tag to be created without a `href` attribute (or empty). This is useful for cases where something should be a link only if isn't the current item, or should be a link if some property is set, but keeping two different HTML structures and `*ngIf` seems overcomplicated.\n\nI.e. something like this\n\n``` html\n\u003ca [routerLink]=\"foo && ['Foo', {bar:foo}]\">Here's my item\u003c/a>\n```\n\n...instead of today's\n\n``` html\n\u003ca *ngIf=\"foo\" [routerLink]=\"['Foo', {bar:foo}]\">Here's my item\u003c/a>\n\u003ca *ngIf=\"!foo\">Here's my item\u003c/a>\n```\n\nI could make a PR if it's not in the workings. What do you think?\n","author":{"url":"https://github.com/staeke","@type":"Person","name":"staeke"},"datePublished":"2016-02-09T13:40:09Z","url":"https://github.com/angular/angular/issues/6971"}
| 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:f3b0cb2d-d5f3-e20a-7ef5-65cc0fe1e2cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC60:1EB1:5F96F5:7CD8C6:6B013D9E |
| html-safe-nonce | 772428ee75a009805caece192db51d89bafdabb6db3d3409261b09b8a8110a3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzYwOjFFQjE6NUY5NkY1OjdDRDhDNjo2QjAxM0Q5RSIsInZpc2l0b3JfaWQiOiI1NjIxMzkxMTAxNjA5OTgzMzkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a9620481358f6c56ee491445f9c970eb455fd677b89d78df57303c22c0aec114 |
| hovercard-subject-tag | issue:132421926 |
| 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/6971/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f860209de2072a4eaed1f9dc5b460051a1693e830fdb38676d9966f8f4b329f3/angular/angular/issues/6971 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f860209de2072a4eaed1f9dc5b460051a1693e830fdb38676d9966f8f4b329f3/angular/angular/issues/6971 |
| og:image:alt | I think it would be convenient to allow routerLink to support a case where the binding resolves to null, empty array or undefined. In that case I'd expect an tag to be created without a href at... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | staeke |
| 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