Passive Link in Angular 2 - equivalent

后端 未结 16 2766
谎友^
谎友^ 2020-12-04 13:36

In Angular 1.x I can do the following to create a link which does basically nothing:

My Link

But the same tag

16条回答
  •  隐瞒了意图╮
    2020-12-04 14:30

    If you have Angular 5 or above, just change

    Click me
    

    into

    Click me
    

    A link will be displayed with a hand icon when hovering over it and clicking it won't trigger any route.

    Note: If you want to keep the query parameters, you should set queryParamsHandling option to preserve:

    Click me
    

提交回复
热议问题