I'm not able to pass a dynamic string array into a component without using java script.
Example: values="{!v.foo + ',bar'}". In this example, the (expected) array seems to be passed as a String. I would prefer to pass the values like {![v.foo, 'bar']} but it won't let me save.
unexpected token: a left square bracket at column 1
So is there a way to generate this array without using a controller? it would make my component much more readable.
my.app
<aura:application >
<aura:attribute name="foo" type="String" default="foo" />
<c:fooBar values="{!v.foo + ',bar'}" />
</aura:application>
fooBar.cmp
<aura:component >
<aura:attribute name="values" type="String[]" />
<aura:handler name="init" value="{!this}" action="{!c.init}" />
</aura:component>
Log typeof values
({
init: function(cmp, event, helper) {
console.log(typeof cmp.get("v.values"));
// output: string
}
})