Newer Version Available

This content describes an older version of this product. View Latest

Dynamically Populating Label Parameters

The aura:label component accepts parameters, enabling you to dynamically populate placeholder values in labels.

The label component value attribute accepts one or more numbered parameters. This example substitutes the {0} parameter with an expression.

1swfobject.registerObject("clippy.codeblock-0", "9");<aura:label value="{0} Members">
2    {!v.numberOfMembers}
3</aura:label>

This example shows the output and source of a label with a hard-coded expression value.

1swfobject.registerObject("clippy.codeblock-1", "9");<aura:component>
2    <aura:label value="Your balance is {0} points.">
3        {!500}
4    </aura:label>
5</aura:component>
6