Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Backbone.sync.parsers({
- MyDocumentsModel: {
- url: "/documents",
- parse: function(response){
- return response.documents;
- }
- },
- ...
- });
- // actually, this would probably be a better idea so we don't get such a high level of cohesion between names and strings...
- Backbone.sync.parsers[MyDocumentsModel] = {
- url: "/documents",
- parse: function(response){ return response.documents; }
- }
- Backbone.sync.parsers[MyTags] = {
- url: "/documents",
- parse: function(response){ return _.map(response.documents, function(d){ return d.tags }); }
- }
Add Comment
Please, Sign In to add comment