Developers

Loader

Overview

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.

Usage

This is the code to create this component.

sdk.component('loader', target:String);

Target

This is the HTML component. For example, the "#inbenta-loader" target is:

<div id="inbenta-loader"></div>

Options

This component does not have optional parameters.

Methods

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

Subcomponents

This component does not have any subcomponent.

Events

This subcomponent does not have any events.

Tracking

This component does not track any data.

Labels

This component has no labels to configure.

Examples

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);