Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#257 Fix for initialValidity set up #259

Merged
merged 1 commit into from
Dec 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/validator.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@
/**
* Set initial validity to undefined if no boolean value is transmitted
*/
var initialValidity;
if (typeof scope.initialValidity === 'boolean') {
initialValidity = scope.initialValidity;
var initialValidity = void 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why void 0 here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

void 0 is the best way to initialize any variable in Javascript. What it actually does is evaluating the expression and returning undefined.

if (typeof attrs.initialValidity === 'boolean') {
initialValidity = attrs.initialValidity;
}

/**
Expand Down