


Hi,
I ma trying to consume js use API in sightly but it is not working. Following are my js and htl files:-
abc.js:-
'use strict';
use(function () {
alert("inside");
var message = "Hello World";
return {
hello: message
};
});
abc.html:-
<div data-sly-use.logic="abc.js">
${logic.hello}
</div>
Ideally it should print "Hello world". Also that alert is not coming.
Am i missing out something?
Thanks in advance.
Regards,
Lovepreet
Views
Replies
Total Likes
Within your sample, you need to make sure that you placed your js next to abc.html.
Here is an example for We.Retail:
The code sample is from HTL and the JavaScript Use-API
Views
Replies
Total Likes
Here is an article - Creating a Tab layout component for Adobe Experience Manager
Views
Replies
Total Likes