We have two Orgs, DEV and SIT (SIT installed by managed package ), and both have namespaces.
In SIT the dynamic reference to the custom labels do not work, but in the Dev org they work.
Below is the code with the issue:
var labelReference = $A.getReference('$Label.c.' + RVT_MAX_NUMBER_DAYS_IN_PERIOD_LABEL);
component.set("v.tempLabelAttr", labelReference);
var dynamicLabel = component.get("v.tempLabelAttr");
In the DEV Org we get the custom label value but in SIT we get a empty string.
In the browser console in SIT i tried to access the custom label with the following code:
$A.get('$Label.NAME_SPACE.RVT_MAX_NUMBER_DAYS_IN_PERIOD_LABEL')
it works and I get the value that I expected from the initial code, but be same snip o code in the DEV org will return an empty string.
It seems that in one place I need the name space to access the custom label and in the other I don´t!
What am I missing here in this inconsistency and how to get around it?