Use accountIdService to retrieve current Account Id.
This commit is contained in:
parent
2d50ad8a0b
commit
c0b236ff6c
@ -54,7 +54,7 @@ export default angular.module('accountant.accounts', [
|
||||
}))
|
||||
|
||||
.run(function($transitions, accountIdService) {
|
||||
$transitions.onSuccess({}, (transition) => {
|
||||
$transitions.onEnter({}, (transition) => {
|
||||
accountIdService.set(transition.params().accountId);
|
||||
});
|
||||
})
|
||||
|
@ -25,8 +25,11 @@ var angular = require('angular');
|
||||
|
||||
var ngResource = require('angular-resource');
|
||||
|
||||
import accountModule from '@accountant/accounts';
|
||||
|
||||
module.exports = angular.module('balanceChartModule', [
|
||||
ngResource
|
||||
ngResource,
|
||||
accountModule
|
||||
])
|
||||
|
||||
.component('balanceChart', {
|
||||
@ -35,12 +38,12 @@ module.exports = angular.module('balanceChartModule', [
|
||||
account: '<',
|
||||
onUpdate: '&'
|
||||
},
|
||||
controller: function($stateParams, Balances, $element) {
|
||||
controller: function(accountIdService, Balances, $element) {
|
||||
var vm = this;
|
||||
|
||||
vm.loadData = function() {
|
||||
Balances.query({
|
||||
id: $stateParams.accountId
|
||||
id: accountIdService.get()
|
||||
}, function(results) {
|
||||
var headers = [['date', 'balances', 'expenses', 'revenues']];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user