This repository was archived by the owner on Dec 4, 2017. It is now read-only.
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
docs: (discussion) router examples should use [routerLink] where possible #3494
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels