Recently, I started learning javascript and extjs, and while following the extjs 4.1 MVC Architecture tutorial, I ran into an issue. Everything was working fine initially, but when I tried to add the controller to the application, something went wrong. Both the applications launch function and the controllers init function were not being called. I referenced the sample code from this site, but couldn't get the 'defining a controller' step to work. Even though it detected the Users.js file without any error messages, it still didn't call the controllers init function. Interestingly, if I remove 'controllers: ['Users'],' from the app.js file, the applications launch function gets called. Any suggestions on what I might be missing?
app.js:
Ext.application({
requires: ['Ext.container.Viewport'],
name: 'Account Manager',
appFolder: 'app',
controllers: ['Users'],
launch: function() {...}
Users.js:
Ext.define('app.controller.Users', {
extend: 'Ext.app.Controller',
init: function() {
console.log('Initialized Users!');
}
});
Thank you for taking the time to read this.