In my team's application, I'm trying to set up a singleton in each theme that handles branded information throughout the web app:
Code:
/** * @class ThemeA.verbiage.BitsAndPieces
*
*/
Ext.define("ThemeA.verbiage.BitsAndPieces", {
singleton: true,
alternateClassName: ['Verbiage'],
emailAddresses: {
contact: '[email protected]'
}
});
I am using a require statement with the alternate class name in the application.js file, and in a view I am trying to use it as such:
Code:
items: [
{
width: '100%',
html: [
'<ul>',
'<li>If you love bacon, please email <a href="mailto:' + Verbiage.emailAddresses.contact + '" target="emailwin">' + Verbiage.emailAddresses.contact + '</a>.</li>',
'</ul>'
].join("")
}
]
This works fine when using the built versions of the app with their individual themes, and the proper verbiage displays in each. It also works fine when using sencha app refresh or sencha app watch and navigating to the unbuilt app. However, after building the app using sencha app build, the unbuilt version stops working and reports "Uncaught ReferenceError: Verbiage is not defined" in the console.
Is there something else I need to do to ensure the singleton gets instantiated and available as the alternateClassName of Verbiage before the view complains?