Hi folks,
I have a requirement where We are supposed to bring our JS file to a modular pattern because of ever growing size in our plugin. The challenge is that we need to call other JS files from the base file, however I am not getting a way. I tried registering the JS file in VM, did AJS.$.getScript and many other methods which didn't work. I also registered file in the resources, but invoking is not happening.
Here are the two sample JS files
test1.js
+function(AJS) {
'use strict';
...
function anyMethod(){
alert("Hello from another file");
}
...
}(AJS)
test2.js
+function(AJS) {
'use strict';
function helloWorld(){
alert("Hello from another file");
}
}(AJS) I want to invoke the helloWorld of test2.js from test1.js file. Please let me know how should I invoke this.
P.S. We are using this design and changing the design for our JS files is not in the scope.