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
Backbone + Vue #316
Comments
Vue uses plain objects as models, in general it's not compatible with Backbone's Model. Also it's not necessary to use Backbone models with Vue because with plain objects it's fairly simple to implement your own validation/ajax functionalities with other libraries. |
Which other libraries are you thinking of for example? |
Thank you! |
What about using adapters à la Rivets? I'm integrating Vue into an application written in Backbone and since my models have the parse and save logic already built and tested I either have to serialize back and forth by hand or buy in all the way and run multiple code paths. Most APIs I've worked with (that are not big web startups) are kinda crappy and require some parsing before being passed into the web-app so I don't think that this use case would be so uncommon. This would be an especially rad feature with something like &model and other front end data modeling tools.
|
When I started this issue I was coming precisely from Rivets adapters |
There is a need in js land for good stand data modeling and it's absence is being made conspicuously obvious by the new wave of view layer frameworks like Vue, React, Ractive etc. Full featured libraries saw the need but haven't opened up to the wider community yet. Ember has ember-data, Angular has $resource Backbone has Backbone.Model. The best tool I've seen so far is ampersand-model and since it allows access to data with the @yyx990803 I'm sure sure super busy getting 0.11 out the door but do you have any thoughts on how vue-resource would work or if adapters are possible? |
There's an example I once wrote using Vue with a Backbone Model: http://jsfiddle.net/x1jeawzv/2/ |
@yyx990803 This is awesome. |
I made a test, it works partially : http://jsfiddle.net/x1jeawzv/4/ then if you do this it works partially
incomplete, as I see a lot to do before it is complete: too much work (sync the other way, update newly added models because the stuff created() must be performed on them, ..) it ends up in maintainning two arrays of objects syncrhonized, unless you choose to refresh the full array at each array change. |
Is it possible to use Backbone models with Vue?
The text was updated successfully, but these errors were encountered: