In my app, I am keeping a baseCollection, from the baseCollection, i am extending further collections to fetch the data.. But i am getting a error saying:
Uncaught TypeError: Object [object Object] has no method 'extend'
what would be the reason..?
here is my base collection:
define(["backbone","models/model"], function (Backbone,model) {
var baseCollection = Backbone.Collection.extend({
//this is the base url
url:"https://recordsmanager.mahindrasatyam.com/EDMSWSStatic/rest/",
model:model,
initialize:function(){
console.log("base collection initialized");
}
});
return new baseCollection;
})
my navigation collection: (extending the base collection):
define(["backbone","models/model","collection/baseCollection"], function (Backbone,model,baseCollection) {
var headerCollection = baseCollection.extend({
//i am getting navigation Json my url should be (https://recordsmanager.mahindrasatyam.com/EDMSWSStatic/rest/edms/navigationLinks)
url:"edms/navigationLinks",
model:model,
initialize:function(){
console.log(baseCollection);
},
parse:function(response){
console.log(response);
}
});
new headerCollection;
})
But I am not able to extend the base collection. is the way i am doing is wrong..? if so what would be the correct way to extend the base url (I do have no.of views, so i have no.of collection need to extend from base url).
Thanks in advance.