Passive Link in Angular 2 - equivalent

后端 未结 16 2748
谎友^
谎友^ 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:16

    you need to prevent event's default behaviour as follows.

    In html

    view
    

    In ts file

    view(event:Event){
     event.preventDefault();
     //remaining code goes here..
    }
    

提交回复
热议问题