Third-party JavaScript libraries in Lightning Components

Salesforce Lightning Component framework provides the ltng:require tag, which allows you to add one or more JavaScript files referenced from Salesforce static resources to Lightning Components. When you use the ltng:require tag, the JavaScript loaded has the ability to manipulate the DOM within the component's boundaries.

In this section, we will take a third-party JavaScript library called flipclock.js to build a Lightning Component that displays a flipclock. Note that flipclock.js is completely compatible with locker and hence we do not need any modifications to the original library source code. Later, in the Creating a Locker Service-compliant JavaScript bundle using webpack section, ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.