How can i use javascript to controller a component with AEM | Community
Skip to main content
New Participant
March 13, 2021
Solved

How can i use javascript to controller a component with AEM

  • March 13, 2021
  • 2 replies
  • 1226 views

Can i use Javascript to controller a component in AEM 6.4? How configure to build a script JS in UI.Frontend to Clientlib-site.JS? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohit_Utreja

Hi @thionor ,

 

ui.frontend has a "clientlib.config.js", which contains configuration to store generated Clientlib-site.JS in the ui.app repository.

You can modify this as per your project structure to store generated js file in your project.

 

If you want to use JavaScript controller in the HTL/sightly file, please refer to the below link for the same.

https://adobemarketingclub.com/2015/12/05/javascript-use-api-with-a-simple-component-in-sightly/

 

2 replies

Rohit_Utreja
Rohit_UtrejaAccepted solution
New Participant
March 14, 2021

Hi @thionor ,

 

ui.frontend has a "clientlib.config.js", which contains configuration to store generated Clientlib-site.JS in the ui.app repository.

You can modify this as per your project structure to store generated js file in your project.

 

If you want to use JavaScript controller in the HTL/sightly file, please refer to the below link for the same.

https://adobemarketingclub.com/2015/12/05/javascript-use-api-with-a-simple-component-in-sightly/

 

Vaibhavi_J
New Participant
March 14, 2021

Hi @thionor 

Question is not clear. Kindly elaborate. 

If you are looking at how to include js please check the below document

https://experienceleague.adobe.com/docs/experience-manager-64/developing/introduction/clientlibs.html?lang=en#how-client-side-libraries-work-in-aem