Skip to content

Instantly share code, notes, and snippets.

@etgryphon
Created October 5, 2010 15:38
Show Gist options
  • Save etgryphon/611746 to your computer and use it in GitHub Desktop.
Save etgryphon/611746 to your computer and use it in GitHub Desktop.
/**
One-way boolean transform binding that returns YES if the 'from' end of the binding equals
'testValue', and NO otherwise.
*/
SC.Binding.equals = function(testValue) {
return this.oneWay().transform(function(value) {
value = (value === testValue) ? YES : NO;
return value;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment