{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/angular.io/issues/3494","repository_url":"https://api.github.com/repos/angular/angular.io","labels_url":"https://api.github.com/repos/angular/angular.io/issues/3494/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.io/issues/3494/comments","events_url":"https://api.github.com/repos/angular/angular.io/issues/3494/events","html_url":"https://github.com/angular/angular.io/issues/3494","id":218729955,"number":3494,"title":"docs: (discussion) router examples should use [routerLink] where possible","user":{"login":"coryrylan","id":2021067,"avatar_url":"https://avatars0.githubusercontent.com/u/2021067?v=3","gravatar_id":"","url":"https://api.github.com/users/coryrylan","html_url":"https://github.com/coryrylan","followers_url":"https://api.github.com/users/coryrylan/followers","following_url":"https://api.github.com/users/coryrylan/following{/other_user}","gists_url":"https://api.github.com/users/coryrylan/gists{/gist_id}","starred_url":"https://api.github.com/users/coryrylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coryrylan/subscriptions","organizations_url":"https://api.github.com/users/coryrylan/orgs","repos_url":"https://api.github.com/users/coryrylan/repos","events_url":"https://api.github.com/users/coryrylan/events{/privacy}","received_events_url":"https://api.github.com/users/coryrylan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-01T23:30:31Z","updated_at":"2017-04-01T23:30:31Z","closed_at":null,"body":"In the documentation the router example under the [imperative example](https://angular.io/docs/ts/latest/guide/router.html#!#navigate-to-hero-detail-imperatively) it shows how to call the router via the TS API. This could be improved as we wouldn't want to encourage the usage of this API when a proper link should be used. This improves accessibility and SEO. This was pointed out by Marcy Sutton on twitter. \r\n\r\n``` typescript\r\n// Should use routerLink instead\r\nonSelect(hero: Hero) {\r\n    this.router.navigate(['/hero', hero.id]);\r\n  }\r\n```\r\n\r\nWe should come up with a use case to use the imperative API when a routerLink is not appropriate.\r\nI don't have any ideas of hand yet but working on brainstorming some. Maybe some kind of redirect use case? Maybe if not a specific use case we could add some information about why routerLink would be the better default option. "}}
{"actor":{"display_login":"coryrylan"}}