1

I am trying to create a very basic static list to iterate through. One of the values has a space in it. I can't figure out how to add the item to the list with a space. In the example below, I can't add trash truck in this manner. I think there must be a special symbol I need to include.

<aura:iteration items="boat, car, trash truck" var="Field3">
                        <option value="{!Field3}">{!Field3}</option>
                    </aura:iteration>
3

Store them in their own list of strings and then iterate over the list and you should achieve the result you're looking for

<aura:attribute name="vehicles" type="String[]" default="['boat','car','trash truck']"/>
<aura:iteration items="{!v.vehicles}" var="Field3">
    <option value="{!Field3}">{!Field3}</option>
</aura:iteration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.