JavaScript modules encapsulate code into useful units that export their functions. Structuring an application this way makes it easier to work with in these ways:

  • Other modules can explicitly require this piece of code.
  • Structuring an application this way makes it easier to see the broader scope.
  • Modular applications keep related functionality close together.
  • Modularized code makes it easier to find what you’re looking for.

This section contains tutorials relating to the different JavaScript Module Loaders included present on the Liferay platform.

Configuring Modules for Liferay Portal’s Loaders

To load your modules in Liferay Portal, you need to know when they are needed, where they are located at build time, if you want to bundle them together or load them independently, and you must...

Read More

Using External Libraries

You can use external (i.e., anything but Metal.js, jQuery, or Lodash, which are included in Liferay Portal) JavaScript libraries in your portlets. There are a few methods you can use to make...

Read More

Liferay AMD Module Loader

The Liferay AMD Module Loader is a JavaScript module loader. What is a JavaScript module? A JavaScript module encapsulates a piece of code into a useful unit that exports its capability/value. This...

Read More

Loading Modules with AUI Script in Liferay Portal

The aui:script tag is a JSP tag that loads JavaScript in script tags on the page, while ensuring that certain resources are loaded before executing. Using aui:script The aui:script tag supports the...

Read More
0 (0 Votes)
AlloyEditor Previous