Sohail Anwar
Sohail Anwar

Reputation: 450

skipLocationChange: true is not working ; shows URL

I am very new to angular and don't know how to ask this question. I am facing an issue when I redirect to another component using router, skipLocationChange: true still shows current (called) component URL in browser,

syntax for router is as below

this.myRouter.navigate(['test-component2',{skipLocationChange:true}])

and it return http://localhost:4200/test-component2;skipLocationChange=true in the browser. Issue is also reported as bug here. Is there any alternative to it or any solution of current issue

Upvotes: 0

Views: 1638

Answers (1)

Etoon
Etoon

Reputation: 296

Looks like a syntax mistake to me. Try:

this.myRouter.navigate(['test-component2'],{skipLocationChange:true});

Upvotes: 3

Related Questions