I have an ExtJS singleton class.
As a test I am calling a method of it in app.js launch() function.
But the singleton static method is not defined.
I thought when I require the class the singleton becomes active?
Ext.Loader.setConfig({
enabled : true,
paths: {
'AM': 'app'
}
});
Ext.application({
name: 'AM',
autoCreateViewport: true,
requires: [
'AM.localization.ResourceManager'
],
controllers: [
'Users'
],
launch: function() {
alert(ResourceManager.initBundleLoader());
}
});
Ext.define('AM.localization.ResourceManager', {
alternateClassName: 'ResourceManager',
singleton: true,
init: function() {
this.initBundleLoader();
},
statics: {
test: 'here',
initBundleLoader: function() {
debugger;
Ext.applyIf(Ext.Loader, {
resourceBundles: new Object()
});
},
registerBundle: function(bundleName, locale) {
debugger;
if(!Ext.Loader.hasOwnProperty('resourceBundles')) {
this.initBundleLoader();
}
if(!Ext.Loader.resourceBundles.hasOwnProperty(bundleName)) {
if(Ext.ClassManager.isCreated('AM.locale.' + locale + '.resources.' + bundleName)) {
this.resourceBundles.bundleName = Ext.create('AM.locale.' + locale + '.resources.' + bundleName);
}
}
}
}
});