0.3.4 • Published 9 years ago

backbone-polymer v0.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

backbone-polymer

Polymer elements have .set and array manipulation methods, but using those you can't really separate your logic from presentation. Backbone is pretty good for framework-agnostic logic, and its event mechanism provides the same type of notifications that Polymer needs to render dynamically.

So backbone-polymer aims to let Polymer templates, data binding and dom-repeat, use Collections of Models as properties.

What it does

Registers event listeners on backbone and calls notifyPath on an element.

How to use

We require the lib with Webpack and do yobo mixins, but any call with the Collection as this is fine.

var c = new Backbone.Collection();
BackbonePolymerAttach.call(c, myPolymerElement, 'theCollectionPropertyName');

See the test folder for real examples.

Limitations

  • Only collection's .add does notify, so for .remove you need to re-render your dom-repeat.
  • Can't .add immediately after attaching the collection to Polymer (your added items will render as empty), so add right before or asynchronously after.
  • Tests pass only in Chrome so other browsers may be supported
0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago