-2

see the next code example:

    <lightning:card iconName="custom:custom33" title="{!notequals(v.aType, 'typeA')? 'This is type B' : 'This is type A'}">
      ...
      ...
    </lightning:card>

Now I want to use Custom Labels for the string literals 'This is type A' and 'This is the A' but when I want to place them in this expression I got an error:

Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}

How do you do this with custom labels?

0
<lightning:card iconName="custom:custom33" 
title="{!notequals(v.aType, 'typeA')? $Label.c.LabelNameB : $Label.c.LabelNameA}">
 ... ... 
</lightning:card>

Change the markup to this

| improve this answer | |

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