mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-26 17:19:19 +01:00
feat(users): add scoreLevel directive to show user score level
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('core')
|
||||
.directive('scoreLevel', scoreLevel);
|
||||
|
||||
function scoreLevel() {
|
||||
var directive = {
|
||||
restrict: 'A',
|
||||
link: link
|
||||
};
|
||||
|
||||
return directive;
|
||||
|
||||
function link(scope, element, attrs) {
|
||||
scope.$watch(attrs.scoreLevel, function (level) {
|
||||
var l = 'L' + attrs.scoreLevel;
|
||||
l = '<kbd>' + l + '</kbd>';
|
||||
|
||||
element.addClass('score-level');
|
||||
element.html(l);
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
Reference in New Issue
Block a user