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");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<aura:label value="{0} Members">
18    {!v.numberOfMembers}
19</aura:label>

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

1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<aura:component>
18    <aura:label value="Your balance is {0} points.">
19        {!500}
20    </aura:label>
21</aura:component>
22