MonthlyInventory report
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
window.app.directive('monthQuery', monthQuery);
|
||||
function monthQuery() {
|
||||
return {
|
||||
scope: {
|
||||
queryFn: '='
|
||||
},
|
||||
templateUrl: '/utility/template/monthQuery.tmpl.cshtml',
|
||||
controller: controller,
|
||||
controllerAs: 'vm'
|
||||
}
|
||||
}
|
||||
|
||||
controller.$inject = ['$scope'];
|
||||
function controller($scope) {
|
||||
var vm = this;
|
||||
vm.query = {};
|
||||
vm.submitting = false;
|
||||
vm.errorMessages = [];
|
||||
vm.submit = submit;
|
||||
|
||||
function submit() {
|
||||
vm.submitting = true;
|
||||
$scope.queryFn({ month: 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