News for hackers. Stuff that matters.
Re:Backbone.Rel: Backbone lightweight model relationship man... by rohitnair on Monday April 02, 2012 @02:27PM (#3789389)
This looks neat! But obvious question, how does this compare to the Backbone-relational library? One useful feature in Backbone-relational is the includeInJSON option, which can be used to either include/ignore or select a single attribute from the related model to be included in the toJSON output of the parent model. Would you have to manually do that here?
Re:Backbone.Rel: Backbone lightweight model relationship man... by bmelton on Monday April 02, 2012 @02:50PM (#3789515)
That's what I was going to ask.

I am by no means an expert, but syntactically, I prefer how backbone-relational does things so that it looks and feels more like working with native Backbone objects, but I honestly don't know what's different about this otherwise.

Re:Backbone.Rel: Backbone lightweight model relationship man... by bryanh on Monday April 02, 2012 @02:12PM (#3789317)
Awesome. Does this simplify the whole retrieval and setting of relationship as they are loaded via the standard fetch mechanism?

A real pain point for us at with Backbone is transversing these relationships in JS. We end up doing redundant renders as related models finally come into memory.

Re:Backbone.Rel: Backbone lightweight model relationship man... by crescentfresh on Monday April 02, 2012 @02:27PM (#3789386)
It's a simple abstraction around filtering objects in a collection by an id. Your collection must be already fetched.