Better explained with code, is there a way around this error? Im trying to simulate a namespace.
window.SomeNamespace = {
Notification: Backbone.Model.extend(),
Notifications: Backbone.Collection.extend({
model: SomeNamespace.Notification //error here. SomeNamespace is not defined
}),
};
window.SomeNamespaceand thus the globalSomeNamespacewill not be defined until the right side of the=has been executed. So you’ll have to split it into two parts.Of course you can do it in a nicer way by using the
extend()method.