How can I conditionally disable the routerLink attribute?

后端 未结 6 2064
时光取名叫无心
时光取名叫无心 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:27

    Unfortunately, Angular doesn't seem to have a null value support for the routerLink.

    However, this works for me. An example of my menu implementation:

    Simply put, if a category has any subcategories, don't redirect, but open the subcategories.

提交回复
热议问题