Inventory details
This commit is contained in:
@@ -14,13 +14,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
controller.$inject = ['$scope', 'inventorySvc'];
|
||||
function controller($scope, inventorySvc) {
|
||||
controller.$inject = ['$scope', 'inventorySvc', 'transactionSvc'];
|
||||
function controller($scope, inventorySvc, transactionSvc) {
|
||||
var vm = this;
|
||||
vm.save = save;
|
||||
|
||||
vm.saving = false;
|
||||
vm.inventory = angular.copy($scope.inventory);
|
||||
vm.transactions = [];
|
||||
|
||||
function loadTransactions() {
|
||||
transactionSvc
|
||||
.filterByInventoryId(vm.inventory.id)
|
||||
.success(function(data) {
|
||||
angular.merge(vm.transactions, data.transactions);
|
||||
});
|
||||
}
|
||||
|
||||
loadTransactions();
|
||||
|
||||
vm.save = save;
|
||||
vm.saving = false;
|
||||
vm.errorMessage = null;
|
||||
|
||||
function save() {
|
||||
|
||||
Reference in New Issue
Block a user