skipLocationChange: true 不起作用;显示 URL

skipLocationChange: true is not working ; shows URL

我是 angular 的新手,不知道怎么问这个问题。 当我使用路由器重定向到另一个组件时遇到问题,skipLocationChange: true 仍然在浏览器中显示当前(调用的)组件 URl,

路由器的语法如下

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

它在浏览器中 return http://localhost:4200/test-component2;skipLocationChange=true。 问题也被报告为错误 here。 是否有任何替代方案或当前问题的任何解决方案

在我看来像是一个语法错误。尝试:

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