what if do not provide url to Backbone.Model?
My collection is :
var MyCollection = PageableCollection.extend({
model: MyModel,
url: util.baseURL + 'g/myentity',
....
});
My model is :
var MyModel= new Backbone.Model.extend({
//here i have not defined any url
});
What will be the request url when i do:
var newModel = new MyModel(data);
newModel.save({
success: function() {
MyCollection.add(newModel);
},
failure: function(result) {
util.notification('Error : ' + result.error);
}
});
In my case when i do the above, and save model i get the error :
Uncaught Error: A "url" property or function must be specified
Why is this so. The model should fetch the url from the collection then
why i get this error??
No comments:
Post a Comment