2016-06-02 09:44:53 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.summary')
|
|
|
|
.directive('projectSummary', projectSummary);
|
|
|
|
|
2016-06-07 05:56:10 +02:00
|
|
|
ProjectSummaryController.$inject = ['StatProjectService'];
|
2016-06-02 09:44:53 +02:00
|
|
|
|
2016-06-07 05:56:10 +02:00
|
|
|
function ProjectSummaryController(StatProjectService) {
|
2016-06-02 09:44:53 +02:00
|
|
|
var vm = this;
|
|
|
|
|
|
|
|
StatProjectService()
|
|
|
|
.success(statProjectSuccess)
|
|
|
|
.error(statProjectFailed);
|
|
|
|
|
2016-06-14 07:56:25 +02:00
|
|
|
function statProjectSuccess(data) {
|
2016-06-02 09:44:53 +02:00
|
|
|
vm.statProjects = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
function statProjectFailed(status) {
|
|
|
|
console.log('Failed stat project:' + status);
|
2016-06-06 09:39:17 +02:00
|
|
|
}
|
2016-06-02 09:44:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function projectSummary() {
|
|
|
|
var directive = {
|
|
|
|
'restrict': 'E',
|
2016-06-16 08:10:35 +02:00
|
|
|
'templateUrl': '/static/resources/js/components/summary/summary.directive.html',
|
2016-06-02 09:44:53 +02:00
|
|
|
'controller': ProjectSummaryController,
|
|
|
|
'scope' : true,
|
|
|
|
'controllerAs': 'vm',
|
|
|
|
'bindToController': true
|
|
|
|
};
|
|
|
|
|
|
|
|
return directive;
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|