(function() { 'use strict'; angular .module('harbor.repository') .directive('popupDetails', popupDetails); PopupDetailsController.$inject = ['ListManifestService', '$filter', 'dateLFilter']; function PopupDetailsController(ListManifestService, $filter, dateLFilter) { var vm = this; vm.retrieve = retrieve; function retrieve() { ListManifestService(vm.repoName, vm.tag) .success(getManifestSuccess) .error(getManifestFailed); } function getManifestSuccess(data, status) { console.log('Successful get manifest:' + data); vm.manifest = data; vm.manifest['Created'] = $filter('dateL')(vm.manifest['Created'], 'YYYY-MM-DD HH:mm:ss'); } function getManifestFailed(data, status) { console.log('Failed get manifest:' + data); } } function popupDetails() { var directive = { 'restrict': 'E', 'templateUrl': '/static/ng/resources/js/components/repository/popup-details.directive.html', 'scope': { 'repoName': '@', 'tag': '@' }, 'link': link, 'controller': PopupDetailsController, 'controllerAs': 'vm', 'bindToController': true }; return directive; function link(scope, element, attrs, ctrl) { ctrl.retrieve(); scope.$watch('vm.manifest', function(current, origin) { if(current) { element.find('span').popover({ 'content': generateContent, 'html': true }); } }); function generateContent() { var content = '
'; return content; } } } })();