I'm trying to set Attribute Default Value from a Custom Label.
- I tried setting Custom Label in Attribute default Value in a Custom Component. e.g.
<aura:attribute name="attributeFromLabel" type="String" access="GLOBAL" default="{!$Label.c.Label1}"/>
This compiles without any errors. But when I add it from App Builder to a record page,etc. this appears as below.
Tried,
- {!$Label.c.Label1}
- "{!$Label.c.Label1}"
When you use exclamation in the builder it throws below permission error.
The reason for being able to use Labels here is to use SF native Label translation effectively. It looks like we need to programatically extract Labels, and pass it across controller to markup to achieve this?
Can we use Custom labels within App Builder/Community Builder? What is the best practice to achieve this? preferably with least code changes/dependencies.
Thanks!