Attaching click to anchor tag in angular

前端 未结 13 1678
臣服心动
臣服心动 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:53

    I had issues with the page reloading but was able to avoid that with routerlink=".":

    My Function
    

    I received inspiration from the Angular Material docs on buttons: https://material.angular.io/components/button/examples

提交回复
热议问题