Passive Link in Angular 2 - equivalent

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

    I am using this workaround with css:

    /*** Angular 2 link without href ***/
    a:not([href]){
        cursor: pointer; 
        -webkit-user-select: none; 
        -moz-user-select: none; 
        user-select: none
    }
    

    html

    My link
    

    Hope this helps

提交回复
热议问题