加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular – EXCEPTION:根段不能有矩阵参数

发布时间:2020-12-17 07:25:43 所属栏目:安全 来源:网络整理
导读:HTML: [routerLink]="['',{'scrollTo': '#contact'}]" TS: this.route.params.forEach((params: Params) = { if (params['scrollTo']) { // some code here }}); 错误:EXCEPTION:根段不能有矩阵参数 我的routerLink中不能有’scrollTo’参数? 它明显出
HTML:
[routerLink]="['',{'scrollTo': '#contact'}]"

TS:

this.route.params.forEach((params: Params) => {
    if (params['scrollTo']) {
        // some code here
    }
});

错误:EXCEPTION:根段不能有矩阵参数

我的routerLink中不能有’scrollTo’参数?

它明显出现在角度2文档:https://angular.io/docs/ts/latest/guide/router.html#!#appendix-link-parameters-array

编辑:

似乎没有抱怨:< a [routerLink] =“['/ crisis-center',{scrollTo:'#contact'}]”>危机中心< / a>.但我需要用我的“根路线”.

最近,它在Angular 5中以这种方式完成:

< a [routerLink] =“['/']”[queryParams] =“{'tour':true}”>文字< / a>

做[routerLink] =“[‘/’,{‘tour’:true’}]”>文字< / a>会抛出错误

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读