How to call API in LightningJS?

How to call API and render data in LightningJS?

You can take a look at our opensource VOD example app: GitHub - mlapps/com.metrological.app.vod-example

It hosts logic for doing api calls and populating data in Lighting Views:
Api call on route visit:

** data population (entry) **

Or take a look at our opensource router example: GitHub - mlapps/router-example-app it hosts some dummy examples on how to add and API to your codebase and perform certain api calls when accessing a route:

You can address the Router documentation to learn more about the Router plugin:

1 Like

To make API calls you can use either fetch or axios or any other library (xhr directly even) that works on Javascript.

1 Like