Theme Spinner `BaThemeSpinner` is a small service helper allowing you to show a preloader spinner while
executing some long-running tasks.
This is the same spinner you can see after reloading a page - it is shown while the application is initializing Angular 2 and loading charts and images.
You also can register a loader on any page you want.
Say you have a long-running task on the Charts page (you need to receive some data from a web service) and you want the spinner to be shown while the data is loading.
First thing you need to do is to import BaThemePreloader service:
```javascript
import {BaThemePreloader} from '../../../../theme/services';
```
Then, say you have a method loading some data called `_loadData`, in our case we just mocked this method with `setTimeout` to emulate the loading process:
```javascript
private _loadData():Promise<any> {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, 4000);
});
}
```
Last thing you need to do is to register your loader: