3.3.2.12. Accessing a module from a script

Sometimes it is required to access a module from a script, RequireJS provides such capability by using the require function to execute a function in the managed context:

require(["SHARED/ModuleA"], function(a) {
  // Codes of interacting with module A
  a.doSomething();
});

In such a situation, you need to use the AMD module name of the module on which you need to depend, this case uses PORTLET/ModuleA. The prefix in uppercase is the module scope among SHARED, PORTLET and PORTAL.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus