1

Currently I have an Angular app that routes to a to the "Home` location when the user clicks the logo like this:

  home() {
    this.router.navigate([''])
  }

Is there a more SEO friendly / best practice way to do this?

4
  • Are you wrapping the logo in a link to the home page when it renders? Nov 30, 2020 at 18:55
  • I will now :) - Thanks for the hint!
    – Ole
    Nov 30, 2020 at 22:23
  • I've never used Angular so I'm not sure how it works by default. Does your code end up changing the URL using pushState? Nov 30, 2020 at 23:16
  • Yes I believe that's how it works
    – Ole
    Dec 1, 2020 at 0:36

1 Answer 1

3

There is more SEO friendly way. Instead of calling function that will do redirect, you can do it directly in HTML.

<a [routerLink]="'/'">Home</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.