Attaching click to anchor tag in angular

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

    I had to combine several of the answers to get a working solution.

    This solution will:

    • Style the link with the appropriate 'a' styles.
    • Call the desired function.
    • Not navigate to http://mySite/#

      Link

提交回复
热议问题