diff --git a/src/operations/operation.controller.ts b/src/operations/operation.controller.ts index 4b4bce1..818203c 100644 --- a/src/operations/operation.controller.ts +++ b/src/operations/operation.controller.ts @@ -9,7 +9,8 @@ import { Operation } from './operation'; import { OperationService } from './operation.service'; module.exports = function( - $stateParams, $modal, + $modal, + accountIdService, toastrService: ToastrService, operationService: OperationService, AccountService @@ -21,7 +22,7 @@ module.exports = function( */ vm.add = function() { var operation = new Operation(); - operation.account_id = $stateParams.accountId; + operation.account_id = accountIdService.get(); return vm.modify(operation); }; @@ -34,7 +35,7 @@ module.exports = function( vm.maxDate = maxDate; return operationService.query( - $stateParams.accountId, + accountIdService.get(), minDate, maxDate ).subscribe((operations: Operation[]) => { @@ -162,7 +163,7 @@ module.exports = function( vm.load(dateRange.minDate, dateRange.maxDate); }; - AccountService.get($stateParams.accountId).subscribe(account => { + AccountService.get(accountIdService.get()).subscribe(account => { vm.account = account }); };