Answer the question
In order to leave comments, you need to log in
RequireJS, how to solve the problem with dependent modules?
So, there is a schematic code:
//RequireJS 2.1.14
define('UI', ['API'], function (API) { // файл UI.js
//API - object
});
define('API', ['UI'], function (UI) { // файл API.js
//UI - undefined
});
require(['UI', 'API'], function(UI, API) {}); // вызываем все из файла min.'s
Answer the question
In order to leave comments, you need to log in
Your problem is that both modules depend on each other.
In general, this is not entirely correct (architecturally).
See this question on Stackoverflow
stackoverflow.com/questions/4881059/how-to-handle-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question