how can I get a list of object from my sling model to js or html ?
I have a list of object of type say <ABC>
which I am accessing in my HTML file as :
I have a list of object of type say <ABC>
which I am accessing in my HTML file as :
You can send Json Array( as a String) of Breadcrumb List from the Sling Models to data-myList attribute in HTML.
You can use GSON for POJO to JSON conversion or you can write logic to create JsonArray containing data of breadcrumb as a JsonObject. Then in your getter method, you can send the jsonArray.toString() so that return type is String and understood by JS.
https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/google/gson/JsonObject.html
http://www.javased.com/?api=com.google.gson.JsonObject
You can refer data-cmp-data-layer attribute of Core components which is created for similar purpose.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.