Handling max quantity magically

This commit is contained in:
Will Marshall
2014-07-31 12:23:10 +10:00
parent d70ed02977
commit 0f76892a5b

View File

@@ -0,0 +1,6 @@
Darkswarm.directive "max", ->
restrict: 'A'
link: (scope, elem, attr)->
elem.bind 'input', ->
if elem.val() > +attr.max
elem.val attr.max