How can I conditionally disable the routerLink attribute?

后端 未结 6 2036
时光取名叫无心
时光取名叫无心 2020-11-27 05:56

In my Angular 2 application I\'m trying to disable a routerLink without any success. I\'ve tried to handle the click event on the click event (with event.

6条回答
  •  有刺的猬
    2020-11-27 06:42

    I've just had some success with a similar issue: having an array of nav links in an ngFor, some required [routerLink], while others required (click) - my issue was that all links relied on [routerLink] for [routerLinkActive], so I had to stop routerLink, without touching it's value.

    `
        
                                                            
提交回复
热议问题