Answer the question
In order to leave comments, you need to log in
How to fix unstable module loading in RequireJS?
Hello. There is such a simple pseudo-code (I often use it in my project)
require(['MyView', 'MyCollection'], function(View, Collection) {
var collection = new Collection,
view = new View({collection: collection});
// каким-либо образом загружаем данные во view
collection.fetch().done(function() {
$('wrapper').html(view.render().el);
});
});
Answer the question
In order to leave comments, you need to log in
It never happened that require.js didn't load something. Are you sure that the problem is in the loading of the modules, and not in the fact that you collection.fetch()
received 500 from the server? What is visible in the console?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question