Reputation: 10571
I have this such a list:
//properties.datas
data-hello="sup"
data-world="w00rld"
Can I generate a tag and loop all the data attributes into there? I only understand how to generate multiple HTML tags.
Result:
<div data-hello="sup" data-world="w00rld">
Upvotes: 1
Views: 98
Reputation: 10780
You can pass a map to data-sly-attribute
and it will render all corresponding pairs as attributes: key="value"
. See https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#223-attribute
<div data-sly-attribute="${model.datas}">...</div>
Upvotes: 1