Attaching click to anchor tag in angular

前端 未结 13 1700
臣服心动
臣服心动 2020-12-13 12:02

I am trying to attach click event to anchor tags (coming from ajax) and block the default redirection. How can I do it in angular ?



        
13条回答
  •  孤街浪徒
    2020-12-13 12:43

    You can use routerLink (which is an alternative of href for angular 2+) with click event as below to prevent from page reloading

    Go to page
    

提交回复
热议问题