Если вам требуются два модуля (как в примере), то Require JS будет:
- загружать их асинхронно;
- загружать их зависимости;
- вставлять модули для вашего обратного вызова, каждый в качестве отдельного аргумента.
Итак, у вас есть ошибка в вашем коде, ваш обратный вызов получит фактически два аргумента, поэтому вам нужно иметь два параметра:
// require two modules async,
// when they are loaded,
// they are injected to your callback
require(['mifosXComponents.js', 'mifosXStyles.js'], function (mifosXComponents, mifosXStyles) {
// now you can use both modules,
// seems that first one is a function which returns promise,
// but I have no idea what is the second one :)
mifosXComponents().then(function(){
require(['test/testInitializer'], function (testMode) {
if (!testMode) {
angular.bootstrap(document, ['MifosX_Application']);
}
});
});
});