コードを正しく実装する最善の方法について質問があります。
私はapp.jsにこれを持っています
/*** EXT LOADER ENABLE & PATH ***/
Ext.Loader.setConfig(
{
enabled : true,
application : 'MyApp'
});
Ext.log('--- APPLICATION --- Loading Elasticsearch configuration');
Ext.define('MyApp.configuration.elastic',
{
singleton : true,
...
loadElasticConfiguration: function()
{
// ExtDirect or ajax call in order to set configuration
}
});
MyApp.configuration.elastic.loadElasticConfiguration();
Ext.onReady(function()
{});
Ext.create('MyApp.Application');
これはうまく機能していますが、app.js に多くのコードを含めるのは好きではありません。「MyApp.configuration.elastic」コードを特定のファイルに「エクスポート」して呼び出す方法はありますか。私はExt.require経由で試しましたが、この設定を必要とする他のファイルは前にロードされています...
誰かが手がかりを持っているなら。
良い一日を過ごしてください !