function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChargeBeeChargeBee 

How to use labels in lighting component javascript with 'Dynamically Populating Label Parameters'?

How can we use custom labels in lighting component's javascript controller with 'Dynamically Populating Label Parameters'. We have referred to this document https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/labels_parameters.htm. But it talks about label parameters for the component markup only.

Is there any way to do the same from the javascript controller?
Ravi Dutt SharmaRavi Dutt Sharma
Hi,

You can import the labels in your JavaScript class file using below:
import labelName from '@salesforce/label/labelReference';

You can refer the following link for an example: https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.create_labels
ChargeBeeChargeBee
Hello there! Thank you for contacting Chargebee Solutions Team. We’ve received your request and we’ll get back to you.  In the meantime, you can check our Knowledge Base & Community Discussions for some quick answers to our frequently asked questions. If you’d like to add more information to your ticket or track its status at any time, click here. Regards Chargebee Solutions Team