Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7 AMD Module Loader with Dependencies
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:
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'
}
);
{
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'
}
);
{
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.
hi Belo , i'm having the same issue , did you find a solution ? thanks