Scribe.js/static/js/directives/log.js
2014-11-11 21:20:33 +01:00

39 lines
917 B
JavaScript

(function () {
'use strict';
window.app.directive('log', [function () {
return {
scope : {
log : "=",
showFile : "=",
showTime : "=",
showDate : "=",
showTags : "="
},
restrict : 'E',
templateUrl : 'partials/elements/log.html',
replace : true,
controller : ['$scope', function ($scope) {
$scope.handleTags = function (tag) {
if (typeof tag === 'string') {
return tag;
} else if (typeof tag === 'object') {
return tag.msg || '';
} else {
return tag; //it will be convert to String by angular
}
};
}]
};
}]);
}());