gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Epoxy.View mixin issue #92

Closed adamyonk closed 10 years ago

adamyonk commented 10 years ago

I'm trying to go the mixin route for setting up an Epoxy.View so that I have a little more control over when applyBindings() gets called, but I'm having trouble getting the view to recognize some bindings/computeds and I'm assuming it has to do with this:

When initializing your view instances, you'll need to manually resolve the Epoxy constructor options and then call applyBindings to reproduce Epoxy view setup.

But I'm not sure exactly what it looks like to 'manually resolve' the Epoxy constructor options. Can anyone lend a hand?

georgefrick commented 10 years ago

Generally requires these steps: 1) Have defaults on your model. 2) call Backbone.Epoxy.View.mixin(this) in initialize() of the view. 3) call this.applyBindings() at the end of your view's render. 4) Have a bindings {} element in the view.

If you are using the latest minified version; try the non-minified. I'm having trouble with the minified and haven't looked into it yet.

georgefrick commented 10 years ago

I'm actually now having troubles with this myself. Is there a step the author knows about that we're missing here?

gmac commented 10 years ago

Good report. I merged a pull request a while back that broke the test suite on this specific point. Looks like it's been broken for about a month. I've updated source and posted a new build, all tests pass.