While building my angular application using ng build, I have provided the --base-href flag for my application as foo. So the URL for my application looks like https://10.10.10.19:8080/foo. However I want to navigate to a page that has bar instead in the URL, i.e. https://10.10.10.19:8080/bar.
I tried router.navigateByUrl('/bar') but it creates a URL https://10.10.10.19:8080/foo/bar which is not what I am looking for.
Can someone help me with what is missing or going wrong here?