Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fixup! fix(required): correctly validate when required on non-input e…
Browse files Browse the repository at this point in the history
…lement is surrounded by ngIf
  • Loading branch information
Narretz committed Feb 25, 2019
1 parent 9be1198 commit 603f4eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/directive/validators.js
Expand Up @@ -69,7 +69,7 @@ var requiredDirective = ['$parse', function($parse) {
link: function(scope, elm, attr, ctrl) {
if (!ctrl) return;
// For boolean attributes like required, presence means true
var value = 'required' in attr || $parse(attr.ngRequired)(scope);
var value = attr.hasOwnProperty('required') || $parse(attr.ngRequired)(scope);

if (!attr.ngRequired) {
// force truthy in case we are on non input element
Expand Down

0 comments on commit 603f4eb

Please sign in to comment.