forked from mirrors/Scribe.js
39 lines
917 B
JavaScript
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
|
|
}
|
|
|
|
};
|
|
|
|
}]
|
|
};
|
|
|
|
}]);
|
|
|
|
|
|
}());
|