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

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

Merged
merged 2 commits into from
Dec 3, 2013

Conversation

simpleTechs
Copy link

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
Copy link
Contributor

Awesome! Thanks for the test!

daffl added a commit that referenced this pull request Dec 3, 2013
can-value shows "undefined" if bound to undefined value
@daffl daffl merged commit fb0fca6 into canjs:master Dec 3, 2013
@daffl
Copy link
Contributor

daffl commented Dec 3, 2013

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

@simpleTechs simpleTechs deleted the can-value-no-undefined branch December 6, 2013 11:12
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.

None yet

4 participants