Skip to content
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

Description

@coryrylan

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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions