Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

AEM - HTL JavaScript Use-API | AEM Community Discussion




AEM - HTL JavaScript Use-API by AdobeDocs


he HTML Template Langugae (HTL) JavaScript Use-API enables a HTL file to access helper code written in JavaScript. This allows all complex business logic to be encapsulated in the JavaScript code, while the HTL code deals only with direct markup production.
A Simple Example
We define a component, info , located at
It contains two files:
1. info.js : a JavaScript file that defines the use-class.
2. info.html : an HTL file that defines the component info . This code will use the functionality of info.js through the use-API.


"use strict";
use(function () {
var info = {};
info.title =["title"];
info.description =["description"];
return info;

Read Full Blog

AEM - HTL JavaScript Use-API


Please use this thread to ask the related questions.


Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply


Level 2

Like in the example, I have created a .js file that lives in the component folder. It works on my localhost:4502, but when I open the page at localhost:4503, nothing from the component shows up. 

Here are the component files:

/[my directory]/components/content/scheduler/scheduler.html

/[my directory]/components/content/scheduler/scheduler.js