Lets have the following code :
( function($) {
TeacherModel = Backbone.Model.extend({
defaults : {
uid : -1,
name : ""
}
});
TeachersCollection = Backbone.Collection.extend({
model : TeacherModel,
url : function() {
return "/path/to/api" + "/teacher";
}
});
}());
I want to have "/path/to/api" as a global setting to Backbone (I know i can export it globally in window, but i want to set it somewhere in Backbone)
Is there a way and what is the best practice for this ?
The way I usually tackle this is to create a base collection and inherit from it, like so: