Skip to content
This repository has been archived by the owner on Dec 4, 2017. It is now read-only.

docs: (discussion) router examples should use [routerLink] where possible #3494

Open
coryrylan opened this issue Apr 1, 2017 · 0 comments
Open
Assignees

Comments

@coryrylan
Copy link
Contributor

coryrylan commented Apr 1, 2017

In the documentation the router example under the imperative example 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.

// Should use routerLink instead
onSelect(hero: Hero) {
    this.router.navigate(['/hero', hero.id]);
  }

We should come up with a use case to use the imperative API when a routerLink is not appropriate.
I 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants