0

Need to show only single url for navigating through all the pages

For example : http://localhost:8100/ (login page) http://localhost:8100/ (home page) http://localhost:8100/ (about-us page)

instead of http://localhost:8100/home,,, http://localhost:8100/login,,, http://localhost:8100/about-us,,,

Need help to achieve this.

Thanks in advance.

2

1 Answer 1

2

you can use this in your component

public ngOnInit(): void { this.location.replaceState("/"); } 

or you can do following

this.router.navigate(['/about-us'], { skipLocationChange: true }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.