1
var label = $A.get("$Label.c.ListOfDocumentsToExclude").split(',')

I am using above piece of code in LWC js to get custom label values. But, getting, " Do not use $A in LWC code error" while compile. Has anyone faced this issue?

1 Answer 1

7

$A related to Aura Framework which is totally different from LWC.

For accessing labels in LWC you need to import it:

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/create_labels

import labelName from '@salesforce/label/labelReference';

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .