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

can-value shows "undefined" if bound to undefined value #580

Merged
merged 2 commits into from Dec 3, 2013

Conversation

Projects
None yet
4 participants
@ghost

ghost commented Nov 27, 2013

When using the super-cool can-value-attribute in mustache, I recently ran into the situation of a database-model, that would actually only contain fields that contained data, i.e. that not set the rest of the fields to some default or undefined.

While (probably) saving some conneciton-overhead (think json with 500 empty + 2 non-empty fields vs. just 2 fields), this happens to make can-value show undefined in the view - something you would never want to show to the user :-)

This pull-request will fix only the view-binding, i.e. the value still is undefined (which is totally intended!).

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Dec 3, 2013

Contributor

Awesome! Thanks for the test!

Contributor

justinbmeyer commented Dec 3, 2013

Awesome! Thanks for the test!

daffl added a commit that referenced this pull request Dec 3, 2013

Merge pull request #580 from simpleTechs/can-value-no-undefined
can-value shows "undefined" if bound to undefined value

@daffl daffl merged commit fb0fca6 into canjs:master Dec 3, 2013

1 check passed

default The Travis CI build passed
Details
@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Dec 3, 2013

Contributor

Sweet! Ran into that yesterday myself, thanks for the fix!

Contributor

daffl commented Dec 3, 2013

Sweet! Ran into that yesterday myself, thanks for the fix!

@simpleTechs simpleTechs deleted the simpleTechs:can-value-no-undefined branch Dec 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment