Created
April 7, 2015 22:22
-
-
Save CullenShane/ebe103df0790a0d86262 to your computer and use it in GitHub Desktop.
Fix angular-placeholder in IE9 when the input is required.
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
angular.module('apruve.checkout.util').directive 'required', -> | |
priority: 1 | |
restrict: 'A' | |
require: '?ngModel' | |
link: (scope, elm, attr, ctrl) -> | |
return if !ctrl | |
origRequired = ctrl.$validators.required | |
ctrl.$validators.required = (modelValue, viewValue) -> | |
return !(viewValue == attr.placeholder) and origRequired(modelValue, viewValue) | |
attr.$observe 'required', -> | |
ctrl.$validate() | |
return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment