Reputation: 3313
I want to execute Nav.init(), Nav1.init()
both after dom ready so I call DomReady
module inside Nav, Nav1
each module before.
Now I try edit the code to call DomReady
module before require them both, then just need to write one time but because there is a require
parameter I don't know how should I do?
Does it like this define(['require','DomReady!'], function (require, DomReady) {
?
define(['DomReady!'], function (require, DomReady) {
var Nav = require('custom/Nav');
Nav.init();
var Nav1 = require('custom/Nav1');
Nav1.init();
});
Upvotes: 0
Views: 27
Reputation: 3025
Try this
define(['DomReady!'], function (DomReady) {
require(['custom/Nav'], function(Nav){
Nav.init();
});
require(['custom/Nav1'], function(Nav1){
Nav1.init();
});
});
Upvotes: 1