I know that you can hide the URL when routing using this.router.navigate(["/Pages"], { skipLocationChange: true });
but when i use window.open("/Pages")
it has the URL.
Is there any way to hide the URL when using window.open()
or a way to use the angular2 router to open the URL in a new tab?
Spitzbueb :
You can inject the Location like this:\n\nconstructor(private readonly location: Location) {\n //...\n}\n\n\nAnd then in ngOnInit() run this:\n\npublic ngOnInit(): void {\n this.location.replaceState(\"/\");\n}\n\n\nThis replaced the URL in the browser with the URL you specify in replaceState().",
2017-07-14T10:56:03