You need to sign in to do that
Don't have an account?
Pradeep Bandarpalli
Issue with loading/using external javascript static resource in Lightning component when Locker service is Enabled
Hi,
My requirement is to zip the content in client side controller using javascript library JSZIP, i have included it as a static resource. Below is the code.
Component:
<aura:component >
<ltng:require scripts="/resource/jszip" />
<ui:button label="Press" press="{!c.onPress}" />
</aura:component>
Controller:
({
onPress : function(component) {
var packageXml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<Package xmlns="http://soap.sforce.com/2006/04/metadata">' +
'<version>35.0</version>' +
'</Package>' ;
zipFile = new JSZip();
zipFile.file('package.xml',packageXml,{base64: 'true'});
var data = zipFile.generate();
alert(data);
}
})
I click on Press button, while locker service is enabled I am facing issue and when Locker service disabled the alert is showed as expected (attached the outputs).
Locker service enabled:
Locker service disabled:
Thank you for help.
My requirement is to zip the content in client side controller using javascript library JSZIP, i have included it as a static resource. Below is the code.
Component:
<aura:component >
<ltng:require scripts="/resource/jszip" />
<ui:button label="Press" press="{!c.onPress}" />
</aura:component>
Controller:
({
onPress : function(component) {
var packageXml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<Package xmlns="http://soap.sforce.com/2006/04/metadata">' +
'<version>35.0</version>' +
'</Package>' ;
zipFile = new JSZip();
zipFile.file('package.xml',packageXml,{base64: 'true'});
var data = zipFile.generate();
alert(data);
}
})
I click on Press button, while locker service is enabled I am facing issue and when Locker service disabled the alert is showed as expected (attached the outputs).
Locker service enabled:
Locker service disabled:
Thank you for help.
Pradeep Bandarpalli
This issue is resolved, please look into the link: http://salesforce.stackexchange.com/questions/133841/issue-with-loading-using-external-javascript-static-resource-in-lightning-compon