Comments (3)
I agree that could be useful (especially if you need to access a lot of related object), but I'm not sure I want to encourage calling toJSON
for template rendering, due to performance issues? See #18 for an example. I usually pass model.attributes
into templates, which works fine most of the time.
from backbone-relational.
Thks for the link, You are right that could bring some performances issues.
from backbone-relational.
While I agree it would be nice (and certainly faster) to pass model.attributes into the template, most commonly used Backbone template engines (Handlebars, Underscore's) won't work without toJSON being called as far as I can tell. Also, the Backbone docs state that toJSON should always be preferred over calling attributes -- http://documentcloud.github.com/backbone/#Model-attributes
I would really love the functionality that @pgherveou described in his initial post.
from backbone-relational.
Related Issues (20)
- Backbone send null for unset relations HOT 1
- Backbone Relational dealing with model instances with the same ID HOT 2
- Retain model in collection when unsetting on another relationship HOT 1
- Models without id (only cid) are not registered in Backbone.Relational.Store HOT 1
- Doesn't work with lodash 4.1.0 HOT 1
- Is this project abandoned? HOT 6
- Backbone 1.3.2 support HOT 2
- using toJSON to serialize data HOT 3
- Update documentation for ES2015/CommonJS importing
- JSBin example HOT 1
- Rename Backbone-relational to backbone.relational HOT 4
- Double imports for using with webpack HOT 5
- ES2015 Refactor (Release Checklist) HOT 1
- Store causing huge memory retention and cleanup takes forever HOT 2
- How do I get Backbone-relational working with ES6? HOT 6
- Problem defining relations: "model does not inherit from Backbone.RelationalModel" HOT 6
- getAsync() fails when retrieving to many models using set URL HOT 4
- don't initialize related Model/Collection in defaults HOT 2
- Collection instances share `options` object by reference which is unexpected
- Backbone-relational compactibility with typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backbone-relational.