Activity Forums Salesforce® Discussions Can we include external Library into Salesforce Lightning Component?

  • Anjali

    Member
    August 20, 2018 at 5:27 am

    Hi Prachi,

    Yes ,we can use multiple libraries in our lightning component like JQuery, Bootstrap, custom CSS and custom Javascript libraries from a local resource (static resource).

  • Parul

    Member
    September 28, 2018 at 5:45 pm

    To reference a JavaScript library that you’ve uploaded as a static resource, use a <ltng:require> tag in your .cmp or .app markup.
    The framework’s content security policy mandates that external JavaScript libraries must be uploaded to Salesforce static resources. For more information on static resources, see “Static Resources” in the Salesforce online help.

  • Parul

    Member
    September 28, 2018 at 5:46 pm

    Adding more points:

    Here’s an example of using <ltng:require>.
    <ltng:require scripts="{!$Resource.resourceName}"
    afterScriptsLoaded="{!c.afterScriptsLoaded}" />

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos