(value)
| 12279 | attr.required = true; // force truthy in case we are on non input element |
| 12280 | |
| 12281 | var validator = function(value) { |
| 12282 | if (attr.required && (isEmpty(value) || value === false)) { |
| 12283 | ctrl.$setValidity('required', false); |
| 12284 | return; |
| 12285 | } else { |
| 12286 | ctrl.$setValidity('required', true); |
| 12287 | return value; |
| 12288 | } |
| 12289 | }; |
| 12290 | |
| 12291 | ctrl.$formatters.push(validator); |
| 12292 | ctrl.$parsers.unshift(validator); |
no test coverage detected