Preventing / dealing with double button clicks in angular

前端 未结 13 1219
我寻月下人不归
我寻月下人不归 2020-11-27 19:53

In angular we can set up a button to send ajax requests like this in view:

... ng-click=\"button-click\"

and in controller:



        
13条回答
  •  感动是毒
    2020-11-27 20:29

    A simple solution I found and I think is better than other answer here is preventing browser default behavior on mousedown event.

    ng-mousedown="$event.preventDefault();"
    

    It does NOT prevent click event but it prevents double-click event :)

提交回复
热议问题