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

Binding in checkBoxValue when value in model is undefined. #45

Open
hynekmusil opened this issue Apr 1, 2016 · 0 comments
Open

Binding in checkBoxValue when value in model is undefined. #45

hynekmusil opened this issue Apr 1, 2016 · 0 comments

Comments

@hynekmusil
Copy link

Example see : https://jsfiddle.net/ee424v3e/12/

My code modification:
Bacon.$.checkBoxValue = function(element, initValue) {
return Bacon.Binding({
initValue: initValue,
get: function() {
return element.prop("checked") || false;
},
events: element.asEventStream("change"),
set: function(value) {
return element.prop("checked", value || false);
}
});
};

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

No branches or pull requests

1 participant