Refer to “link.path” while redirecting to root using [routerLink]

前端 未结 1 1817
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-28 04:03

I have an application that uses a typescript file for setting up links and within the template I use ngFor to interpolate through the links and build a navigation b

1条回答
  •  一生所求
    2021-01-28 04:27

    In Angular you can compose URL with respect of any path; [routerLink] provide the facility to provide string token or variables to make final path

    [routerLink]="['/', var, 'str']" = /var/str

    {{ link.text }}
    

    Angular official reference for RouterLink : https://angular.io/api/router/RouterLink

    0 讨论(0)
提交回复
热议问题