I’m trying to create a namespace for my backbone app so I can make calls globally.
Normally, I’d just do it like this:
var myNamespace = window.myNamespace || {};
myNamespace.SomeView = Backbone.View.extend(..);
Not sure how to achieve this using require js
You can do the same in your
requireordefinecalls,window‘s still there (if you work in browsers).The question is why would you need it? Ideally all your modules would be defined with requireJS, so you don’t need to refer to them through global object.