UNPKG

741 BJavaScriptView Raw
1import angular from 'angular';
2
3import styles from '../loader-inline/loader-inline.css';
4import injectStyles from '../loader-inline/inject-styles';
5import Theme from '../global/theme';
6
7/**
8 * @name Loader Inline Ng
9 */
10
11
12const angularModule = angular.module('Ring.loader-inline', []);
13
14class LoaderController {
15 $onInit() {
16 injectStyles();
17
18 this.theme = this.theme || Theme.LIGHT;
19 }
20
21 getThemeClass = () => `${styles.loader}_${this.theme}`;
22}
23
24angularModule.
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
33export default angularModule.name;