I'm trying to use multiple Applications inside one parent Application.
Here is example fiddle like this:
Ext.application({ name : 'Parent app', launch : function() { Ext.application({ name: 'ChildApp1', sayHello: function(){ console.log('ChildApp 1'); } }); Ext.application({ name: 'ChildApp2', sayHello: function(){ console.log('ChildApp 2'); } }); But when I'm trying to interact between apps, it seems that last App rewrites whole primary namespace.
I am trying to dynamically access a specific App, but I get only the App created last.
const appName = 'ChildApp1'; Ext.app.Application.instance.getApplication(appName).sayHello(); // calls ChildApp2 method How is it possible to dynamicly call (I don't know app name in advance) multiple applications methods from each other ?
Am I right with classes architecture/definition or not?
Further thoughts:
If I had looked more closely, the error is obvious, because the global variable Ext is redefined, and the last created variable overwrites everything that was before.