According the Backbone.js documentation Model-parse does the following:
parse is called whenever a model's data is returned by the server, in fetch, and save.
To augment models I've already loaded I use Model.parse()
. I accomplish this by using fetch
to make an additional request for data, then use that data to add properties to an existing model.
Example:
the fetch object is {age: 19}
after the parser will be {age: 19, isAdult: true}
When I perform the save request, in the PUT request I also have other parameters not needed (for example isAdult). I would like to have the original model (without additional parameters in PUT request).
What is the best way to achieve my goal in Backbone?