I am using backbone.js in my mvc application and I have a scenario where I have to pass an array to my Post method in Rest API . I am trying to set an array property in my model and then calling this.collection.create(model). I am using properties of models like this
defaults: { Address: '', City: '', State: '', Zip: '', AddressArray: [] }and trying to call Post method as
e.models[0].set({ 'AddressArray': e.models}); this.collection.create(e.models[0]);Here e.models[0] is my object of my model and e.models is an array of models. The set property sets array address but then on create it is giving this error.
Uncaught TypeError: Converting circular structure to JSON
Please guide.