This component shows the loading state of a component. You can use it as a standalone loader or link it to a SDK component. The component uses the 'loadingData' and 'dataLoaded' events emitted by components to show or hide the loading animation.
This is the code to create this component.
sdk.component('loader', target:String);
This is the HTML component. For example, the "#inbenta-loader" target is:
<div id="inbenta-loader"></div>
This component does not have optional parameters.
You can use the following methods in this component.
Name | Description |
---|---|
linkTo(component:Component) |
Links the visibility of the loader to an existing SDK component. |
startLoading |
Shows loading animation |
stopLoading |
Hides loading animation |
This component does not have any subcomponent.
This subcomponent does not have any events.
This component does not track any data.
This component has no labels to configure.
This is how you create a results
component with a linked loader
:
var results = sdk.component('results', '#results');
var loader = sdk.component('loader', '#inbenta-loader');
loader.linkTo(results);