【问题标题】:Is there a way to pass multiple parameters in routing url in angular 11? [duplicate]有没有办法在角度 11 的路由 url 中传递多个参数? [复制]
【发布时间】:2021-12-12 00:40:39
【问题描述】:
app-routing.module.ts
{ path: 'projectmodel/:projectmodelname/salespack', component: componentname}

所以在这里我想在导航时成为这样的 url(点击按钮我想导航到这个页面) 我试过这样

  this.router.navigate(['/projectmodel', this.salesPackName, '/salespack'])
this.salesPackName = this.route.snapshot.paramMap.get('projectmodelname');

但它给出的页面未找到,即我给出了错误的 url。我在哪里失踪?我是角度的新手。任何帮助都会有帮助..

【问题讨论】:

    标签: angular typescript


    【解决方案1】:

    你不应该需要斜线。

    你绑了吗:

      this.router.navigate(['projectmodel', this.salesPackName, 'salespack'])
    

    【讨论】:

      猜你喜欢
      • 2018-12-02
      • 2012-02-25
      • 2015-03-31
      • 1970-01-01
      • 2013-06-19
      • 1970-01-01
      • 2018-08-10
      • 2023-01-24
      • 2018-03-20
      相关资源
      最近更新 更多