Hi guys, I am creating a component with variables and an array, but the array creation is not working,
generates in the database but does not generate in the template, does not generate in json.
I have 2 projects, I tested it on the other one and it worked, but not on this project, I got
I got the complete component and it still hasn't generated the information in json.
I'm using Angular to do mapTo and that's it.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @ElvisRo From what I understand, you have a component CardDustReviews that has a list of CardDust objects, and you're using Angular to map the data. However, the array of CardDust objects is not being generated in the JSON output.
Here are a few potential issues to consider:
To help you further, could you please provide more information about the following:
Let me know if you have any questions or if there's anything else I can help you with!
The @ChildResource annotation derives the name of the child resource it needs to inject from the name of the variable (or the value of the "name" parameter).
That also means, that it cannot inject more than 1 child resource, because the underlying repository does not allow sibling nodes with the same name.
hello,,
It worked in a dev environment, but it doesn't work locally, could it be some configuration in the dispatcher?
Views
Replies
Total Likes
heu @Jörg_Hoh ,
It worked in a dev environment, but it doesn't work locally, could it be some configuration in the dispatcher?
Views
Replies
Total Likes
Hi @ElvisRo
I think from what I have understood your use case is this:
1. You are using sling model delegation pattern and then you are exporting the delegated component sling model via exporter.
2. Now when you use your sling model in component directly , it works fine. All the getter methods return correct values in sightly.
3. But when you are exporting the same sling model it does not return desired json.
Please confirm if above is your issue.
For this what you need to do is specify your our json exporter in the sling model as the exporter for json that the ootb component sling model is using might not expose all methods.
Also what you can do is create and assign your own custom object again, that you want to export, in your sling model and then expose it via getter method.
Same issue I faced in delegation pattern and I used above work around for the same.
hello,
It worked in a dev environment, but it doesn't work locally, could it be some configuration in the dispatcher?d
Views
Replies
Total Likes
Hi @ElvisRo From what I understand, you have a component CardDustReviews that has a list of CardDust objects, and you're using Angular to map the data. However, the array of CardDust objects is not being generated in the JSON output.
Here are a few potential issues to consider:
To help you further, could you please provide more information about the following:
Let me know if you have any questions or if there's anything else I can help you with!
hello,
It worked in a dev environment, but it doesn't work locally, could it be some configuration in the dispatcher?
Views
Replies
Total Likes