Angular2 RouterLink breaks routes by replacing slash with /

后端 未结 5 1089
失恋的感觉
失恋的感觉 2020-12-03 22:11

Since the latest Angular2 version (2.0.0-beta.14) it is possible to have query parameters that contain multiple slashes, like /foo/bar.

This works great, however whe

5条回答
  •  囚心锁ツ
    2020-12-03 22:28

    Instead of trying to use strings with slashes in routerLink, we simply let the router handle it in the component.

    Link
    
    url = 'group/8';
    
    goToPage(url) {
        this.router.navigateByUrl(url);
    }
    

提交回复
热议问题