Angular2 Routing. The requested path contains undefined segment at index 1

后端 未结 2 1684
日久生厌
日久生厌 2021-02-11 18:12

I have a issue with routing in Angular 2. I call router.navigate from an action into a datatable. The rare is that sometimes when i click the button that calls this line its wor

2条回答
  •  春和景丽
    2021-02-11 18:15

    I faced the same issue. The basic reason was, It wasn't finding the LINK (url) for the the item. i.e.

    BEFORE

     {
        e2eId: '1',
        title: 'myTitle',
        link: null,
        icon: 'icon',
        isActive: false,
       }
    

    AFTER

    {
        e2eId: '1',
        title: 'myTitle',
        link: '/somelinehere',
        icon: 'icon',
        isActive: false,
       }
    

    This issue may also arise due to Null value of id or something else with null value as well.

提交回复
热议问题