Manoj Ghediya
Manoj Ghediya

Reputation: 597

How to hide routes in address bar in angular 5+?

I want to hide routes from browser's address bar.
Ex:
http://localhost:4200/user/profile
to
http://localhost:4200

can we hide routes?

Upvotes: 0

Views: 3303

Answers (1)

Amit Baranes
Amit Baranes

Reputation: 8122

You can do that by adding : { skipLocationChange: true }) after navigation.

Read more about navigation extras here .

I created the following stackblitz example that shows how to achieve what you are looking for.

As mentioned in comments, This feature is not recommended.

Upvotes: 2

Related Questions