Title: RouterLink should add a class "router-link" to HTML · Issue #4532 · angular/angular · GitHub
Open Graph Title: RouterLink should add a class "router-link" to HTML · Issue #4532 · angular/angular
X Title: RouterLink should add a class "router-link" to HTML · Issue #4532 · angular/angular
Description: Given the following template, I can assign a class for the active route because router-link-active is added by Angular2 to the element. But I cannot style the inactive router links. For now, I can add my own router-link class to each ele...
Open Graph Description: Given the following template, I can assign a class for the active route because router-link-active is added by Angular2 to the element. But I cannot style the inactive router links. For now, I can ...
X Description: Given the following template, I can assign a class for the active route because router-link-active is added by Angular2 to the element. But I cannot style the inactive router links. For now, I can ...
Mail addresses
notifications@github.com
notifications@github.com
Opengraph URL: https://github.com/angular/angular/issues/4532
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RouterLink should add a class \"router-link\" to HTML","articleBody":"Given the following template, I can assign a class for the active route because `router-link-active` is added by Angular2 to the element. But I cannot style the inactive router links. For now, I can add my own `router-link` class to each element. \n\nhere is what I currently do ..\n\n```\n \u003ca [router-link]=\"['/${Routes.dashboard.as}']\" class=\"router-link\">Dashboard\u003c/a>\n \u003ca [router-link]=\"['/${Routes.heroes.as}']\" class=\"router-link\">Heroes\u003c/a>\n \u003crouter-outlet>\u003c/router-outlet>\n```\n\nand the CSS\n\n```\n .router-link {padding: 5px;text-decoration: none;}\n .router-link:visited {color: #444;}\n .router-link.router-link-active {color: white; background-color: #52b9e9; text-decoration: none;}\n```\n\nI propose that Angular2 add `router-link` to all router link elements and additionally add `router-link-active` to the active one. This way i could just do this:\n\n```\n \u003ca [router-link]=\"['/${Routes.dashboard.as}']\">Dashboard\u003c/a>\n \u003ca [router-link]=\"['/${Routes.heroes.as}']\">Heroes\u003c/a>\n \u003crouter-outlet>\u003c/router-outlet>\n```\n\ncc / @btford \n","author":{"url":"https://github.com/johnpapa","@type":"Person","name":"johnpapa"},"datePublished":"2015-10-05T19:09:02Z","url":"https://github.com/angular/angular/issues/4532"}
| 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:34cf05e7-64b9-7e03-b86c-fc117e15173f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1A4:2D40DE:EF46F1:12FAE8C:6B01478F |
| html-safe-nonce | 3d3d48092a5fb5fe4b1d48a683778cc10acfba7d1236c682e0f4cd55f4707c92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUE0OjJENDBERTpFRjQ2RjE6MTJGQUU4Qzo2QjAxNDc4RiIsInZpc2l0b3JfaWQiOiI0OTYyOTA0NDg0MDY2OTY5NDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1ed569476b73f2ec9b80e1962d5424255982807a93bcd72ac72e5d178d44695c |
| hovercard-subject-tag | issue:109864871 |
| 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/4532/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe92a8a8245b5d39137ceb86d5cc6cff424f74cec2f2a8d3d0641db0b73007de/angular/angular/issues/4532 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe92a8a8245b5d39137ceb86d5cc6cff424f74cec2f2a8d3d0641db0b73007de/angular/angular/issues/4532 |
| og:image:alt | Given the following template, I can assign a class for the active route because router-link-active is added by Angular2 to the element. But I cannot style the inactive router links. For now, I can ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | johnpapa |
| 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