Categories
Angular Answers

How to fix no base href set error with Angular router?

Spread the love

Sometimes, we want to fix no base href set error with Angular router.

In this article, we’ll look at how to fix no base href set error with Angular router.

How to fix no base href set error with Angular router?

To fix no base href set error with Angular router, we add the base element into the index.html file.

For instance, we write

<head>
  <base href="/" />
  ...
</head>

to add the <base href="/" /> into the head element in index.html to clear the error.

Conclusion

To fix no base href set error with Angular router, we add the base element into the index.html file.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *