harbor/static/resources/js/components/summary/summary.directive.js

40 lines
1.0 KiB
JavaScript
Raw Normal View History

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