angular.module("machinery-show", ["ngSanitize"]); angular.module("machinery-show") .config(function($locationProvider) { $locationProvider.html5Mode({enabled: true, requireBase: false}); }) .controller("showController", function($scope) { $scope.description = getDescription(); $scope.description.meta_info = {}; angular.forEach($scope.description, function(index, scope) { if($scope.description.meta[scope]) { $scope.description.meta_info[scope] = " (" + "inspected host: '" + $scope.description.meta[scope].hostname + "', " + "at: " + new Date($scope.description.meta[scope].modified).toLocaleString() + ")"; } }); }) .directive("scopeHeader", function(){ return { restrict: "E", scope: { summary: "=summary", logo: "=logo", singular: "=singular", plural: "=plural", title: "=title", meta: "=meta", count: "=count", additionalSummary: "=additionalSummary" }, template: "
" + "
" + "" + "" + "
" + "
" + "

" + "{{title}}" + " 
" + "{{additionalSummary}}" + "" + " (" + "inspected host: '{{meta.hostname}}', " + "at: {{meta.modified | date:'medium'}}" + ")" + "
" + "

" + "
" + "
" } }) .directive("metaInfo", function(){ return { restrict: "E", scope: { meta: "=data"}, template: " (" + "inspected host: '{{meta.hostname}}', " + "at: {{meta.modified | date:'medium'}}" + ")" } });