I am using the @foreach
Orb notation in MVEL to iterate over a string array.
someArrayPartOfAJSONObject = ["Item 1", "Item 2"]
<ul>
@foreach{item: someArrayPartOfAJSONObject}
<li>@{item}</li>
</ul>
But what I'm seeing in the renders HTML is:
When I would be expecting those to render without the quotations. The data that's passed in is part of a JSON object from a backend call, so there's not much else to that object. Am I missing some important fundamental of MVEL?
I was able to figure this out. By using the replace
method I was able to remove the quotations from the strings.
<ul>
@foreach{item: someArrayPartOfAJSONObject}
<li>${replace(item,"\"","")}</li>
</ul>