In Javascript, there exists a function which inherits the Backbone Model
window.MyModel = Backbone.Model.extend({ .. .. });
window.MyCollection = Backbone.Collection.extend({ .. .. });
In another, JS file we access this function as
var MyModelInstance = new window.MyModel();
Requirement is, all functions needs to be prefixed with specific global namespace (for example, company name 'Google') instead of generic keyword 'window'. How can we achieve it?
I tried the following, but with no success.
var googleNameSpace= defineNamespace("Google");
googleNameSpace.MyModel = Backbone.Model.extend({ .. .. });
googleNameSpace.MyCollection = Backbone.Collection.extend({ .. .. });
var MyModelInstance = new Google.MyModel();