Message Boards

Liferay 7 AMD Module Loader with Dependencies

thumbnail
N. Belo, modified 5 Years ago.

Liferay 7 AMD Module Loader with Dependencies

Junior Member Posts: 33 Join Date: 3/17/09 Recent Posts

Hi Team,

 

I've read this tutorial...

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/liferay-amd-module-loader

 

 

I've added a Module by using a BND File + Configuration File according with this tutorial:

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/configuring-modules-for-products-loaders

 

 

But I'm still having trouble configuring a Module that depends on another. Example:

 

My Config.Js

Liferay.Loader.addModule(
  {
    dependencies: [],
    name: 'chart',
    anonymous: true,
    path: MODULE_PATH + '/js/libs/Chart.bundle.min.js'
  }
);
Liferay.Loader.addModule(
  {
    dependencies: [],
    name: 'chartRounded',
    anonymous: true,
    path: MODULE_PATH + '/js/libs/Chart.helper.roundedBarTop.js'
  }
);

 

And In my View.jsp I use Require to Load the Modules:

require('chart', function(Chart) {
...

 

Since the "Chartrounded" module depends on the Chart Object that is defined in the Chart Module, How can I make It use the Chart object inside the ChartRounded Module?

 

I allways get the message that the Chart isn't defined when it get's in the ChartRounded module.

 

Thank you

N.

omar harrari, modified 4 Years ago.

RE: Liferay 7 AMD Module Loader with Dependencies

New Member Posts: 5 Join Date: 2/26/18 Recent Posts
hi Belo , i'm having the same issue , did you find a solution ? thanks