Distribution report
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
window.app.directive('distributionReportQuery', distributionReportQuery);
|
||||
function distributionReportQuery() {
|
||||
return {
|
||||
scope: true,
|
||||
templateUrl: '/report/template/distributionReportQuery.tmpl.cshtml',
|
||||
controller: controller,
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
|
||||
controller.$inject = ['$scope', 'reportSvc'];
|
||||
function controller($scope, reportSvc) {
|
||||
var vm = this;
|
||||
vm.query = {};
|
||||
vm.submitting = false;
|
||||
vm.errorMessages = [];
|
||||
vm.submit = submit;
|
||||
|
||||
function submit() {
|
||||
vm.submitting = true;
|
||||
reportSvc.loadDistributionReport(vm.query)
|
||||
.error(function (data) {
|
||||
vm.errorMessages = angular.copy(data.errorMessages, vm.errorMessages);
|
||||
})
|
||||
.finally(function () {
|
||||
vm.submitting = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user