1 | import angular from 'angular';
|
2 |
|
3 | import styles from '../loader-inline/loader-inline.css';
|
4 | import injectStyles from '../loader-inline/inject-styles';
|
5 | import Theme from '../global/theme';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | const angularModule = angular.module('Ring.loader-inline', []);
|
13 |
|
14 | class LoaderController {
|
15 | $onInit() {
|
16 | injectStyles();
|
17 |
|
18 | this.theme = this.theme || Theme.LIGHT;
|
19 | }
|
20 |
|
21 | getThemeClass = () => `${styles.loader}_${this.theme}`;
|
22 | }
|
23 |
|
24 | angularModule.
|
25 | component('rgLoaderInline', {
|
26 | bindings: {
|
27 | theme: '@?'
|
28 | },
|
29 | template: `<div data-test="ring-loader-inline-ng" class="${styles.loader}" ng-class="$ctrl.getThemeClass()"></div>`,
|
30 | controller: LoaderController
|
31 | });
|
32 |
|
33 | export default angularModule.name;
|