forked from seiyria/ng2-gameicons
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
54 lines (41 loc) · 2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GameIconsDirective = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _dec, _class;
var _core = require('@angular/core');
require('gameicons-font/dist/game-icons.css');
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var GameIconsDirective = exports.GameIconsDirective = (_dec = (0, _core.Directive)({
selector: '[gi]',
inputs: ['icon']
}), _dec(_class = function () {
_createClass(GameIconsDirective, null, [{
key: 'parameters',
get: function get() {
return [[_core.ElementRef]];
}
}]);
function GameIconsDirective(elementRef) {
_classCallCheck(this, GameIconsDirective);
this.el = elementRef.nativeElement;
}
_createClass(GameIconsDirective, [{
key: 'ngOnChanges',
value: function ngOnChanges() {
var _el$classList;
this.el.className = '';
(_el$classList = this.el.classList).add.apply(_el$classList, _toConsumableArray(this.iconClass()));
}
}, {
key: 'iconClass',
value: function iconClass() {
var classes = ['game-icon', 'game-icon-' + this.icon];
return classes;
}
}]);
return GameIconsDirective;
}()) || _class);