Skip to content

Instantly share code, notes, and snippets.

@ukyo
Created April 28, 2014 02:58
Show Gist options
  • Save ukyo/11360737 to your computer and use it in GitHub Desktop.
Save ukyo/11360737 to your computer and use it in GitHub Desktop.
連続でクリックするのを防止するためのdirective
# button or input[submit]で使うように
angular.module('foo', []).directive 'clickAndDisable', ->
link: (scope, element, attr) ->
element.on 'click', -> element.attr 'disabled': true
<button click-and-disable>クリックしたら押せなくなるボタン</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment