Created
April 25, 2014 22:37
-
-
Save apolzon/11305497 to your computer and use it in GitHub Desktop.
angular character count directive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HuntersAlley.directive "haCharacterCount", [ -> | |
scope: | |
object: "=" | |
maxlength: "@" | |
template: """ | |
<div class='listing-form__charactersRemaining'> | |
<span>Characters remaining:</span> | |
<span class='listing-form__count' ng-class="{'listing-form__countDanger': (maxlength - object.length) < 11}"> | |
{{maxlength - object.length}} | |
</span> | |
</div> | |
""" | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment