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
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM - HTL JavaScript Use-API | AEM Community Discussion

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,129 likes

Total Posts

6,140 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,129 likes

Total Posts

6,140 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

08-06-2020

BlogImage.jpg

AEM - HTL JavaScript Use-API by AdobeDocs

Abstract

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
/apps/my-example/components/info
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.

/apps/my-example/component/info/info.js

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

Read Full Blog

AEM - HTL JavaScript Use-API

Q&A

Please use this thread to ask the related questions.

AEM AEMIBlogSeeding Experience Manager