Skip to content

Instantly share code, notes, and snippets.

@LokeshSagi
Last active July 6, 2020 11:38
Show Gist options
  • Save LokeshSagi/ee796aa20bb1f1acf7e7d6c8cb425d5d to your computer and use it in GitHub Desktop.
Save LokeshSagi/ee796aa20bb1f1acf7e7d6c8cb425d5d to your computer and use it in GitHub Desktop.
Create the Custom label like below:
Custom Label name: CS_ContactIntake_Introduction_English_Info_Text_4
value: Hello. My name is <b class="ny_capitalization">{0}</b> and I am calling from the Colorado Department of Public Health and Environment.
<lightning-formatted-rich-text
value={CS_ContactIntake_Introduction_English_Info_Text_4}>
</lightning-formatted-rich-text>
import CS_ContactIntake_Introduction_English_Info_Text_4 from '@salesforce/label/c.CS_ContactIntake_Introduction_English_Info_Text_4';
export default class FormatLabel extends LightningElement {
CS_ContactIntake_Introduction_English_Info_Text_4 = CS_ContactIntake_Introduction_English_Info_Text_4;
}
connectedCallback() {
......
......
// apex calls if required
this.formatLabels();
}
formatLabels() {
this.CS_ContactIntake_Introduction_English_Info_Text_4 = this.CS_ContactIntake_Introduction_English_Info_Text_4.replace("{0}", ....);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment