我的情况就像我的应用程序正在iframe中加载。因此,首先它将从URL读取查询字符串,然后根据该值重定向应用。但是每次这样做都会将路由路径附加到查询字符串的末尾。我的代码。
app.component
ngOnInit(){
if (conditionmatch) {
this.router.navigate(['template-not-found'])
}
}
routing.module
{ path: 'template-not-found',component: TemplateNotFoundComponent },
例如,我的初始条件是https://localhost:44351/id=152&projId=130
因此,条件匹配后,它会转到该页面,但会在末尾附加路由路径。 https://localhost:44351/id=152&projId=130#/template-not-found
我应该如何处理它,使其出现在查询字符串之前?