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