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

Fix checkValid error #145

Merged
merged 1 commit into from
Oct 21, 2015
Merged

Fix checkValid error #145

merged 1 commit into from
Oct 21, 2015

Conversation

lvarayut
Copy link
Collaborator

This PR fixed an error when no argument, undefined, or null passed to the checkValid function.

return false;
}
return (form && form.$valid === true);
return !!form && !!form.$valid;
Copy link
Owner

Choose a reason for hiding this comment

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

cannot be
return form && form.$valid ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

return form && form.$valid will return undefined or null instead of false, in case of the form is undefined or null respectively. I just want this function to return boolean as we expected.

Copy link
Owner

Choose a reason for hiding this comment

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

!!(form && form.$valid) more understandable?

Copy link
Owner

Choose a reason for hiding this comment

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

whatever it is, should be okay 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the same for me, but I could change it if you want.

Copy link
Owner

Choose a reason for hiding this comment

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

Ok then !!(form && form.$valid)

@hueitan
Copy link
Owner

hueitan commented Oct 21, 2015

👍 Small change makes perfect 👍

@lvarayut
Copy link
Collaborator Author

Done! Need your confirmation. If it's ok, I'll merge it now. :)

@hueitan
Copy link
Owner

hueitan commented Oct 21, 2015

when travis ready, then sure 👍

lvarayut added a commit that referenced this pull request Oct 21, 2015
@lvarayut lvarayut merged commit 09aed2e into hueitan:master Oct 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants