Skip to content

Instantly share code, notes, and snippets.

@asolove
Created November 18, 2013 18:56
Show Gist options
  • Save asolove/7533284 to your computer and use it in GitHub Desktop.
Save asolove/7533284 to your computer and use it in GitHub Desktop.
Two-way binding through rangeContent()
describe("makeRangeContentBinder", function () {
it("should work", function () {
var o = Bindings.defineBindings({
source: [1, 2, 3]
}, {
target: {"<->": "source.rangeContent()"}
});
expect(o.target).toEqual([1,2,3]);
o.target = [1, 2];
expect(o.source).toEqual([1,2]);
o.source = [2,3,4];
expect(o.target).toEqual([2,3,4]); // Fails, it's still [1,2]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment