I use a

<aura:attribute name="colorPalette" type="List" default="['red', 'green', 'blue']" />

and default values are not assigned to the attribute. The value that the attribute has is always "". Anyone knows what i am doing wrong or if there is a known issue?

  • How are you trying to call that list? Nov 16 '19 at 19:32

I tried your exact code and it worked for me, both from markup and init handler in javascript

<aura:application >
<aura:attribute name="colorPalette" type="List" default="['red', 'green', 'blue']" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
<aura:iteration items="{!v.colorPalette}" var="item">

Controller code:

    doInit : function(component, event, helper) {

UI Screenshot:

enter image description here

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.