I have two files: main.js and events.js.
In main.js i have defined some functions, which look's like this:
define(["jquery"], function() {
var a = {
function_a: function(){
some_actions;
}
}
var b = {
function_b: function(){
some_actions;
}
}
return a, b;
});
and in events.js i have some calls for this functions:
require(['jquery','app/main'], function($, a){
selector.on('click', function(){
a.function_a();
});
});
require(['jquery','app/main'], function($, b){
selector.on('click', function(){
b.function_b();
});
});
Something is wrong because i can't call more than one of this functions, can anybody help?
return a, b;- this line doesn't work like you seem to think.