Switch to uirouter.
This commit is contained in:
@ -35,12 +35,12 @@ module.exports = angular.module('balanceChartModule', [
|
||||
account: '<',
|
||||
onUpdate: '&'
|
||||
},
|
||||
controller: function($routeParams, Balances, $element) {
|
||||
controller: function($stateParams, Balances, $element) {
|
||||
var vm = this;
|
||||
|
||||
vm.loadData = function() {
|
||||
Balances.query({
|
||||
id: $routeParams.accountId
|
||||
id: $stateParams.accountId
|
||||
}, function(results) {
|
||||
var headers = [['date', 'balances', 'expenses', 'revenues']];
|
||||
|
||||
|
@ -35,12 +35,12 @@ module.exports = angular.module('categoryChartModule', [
|
||||
minDate: '<',
|
||||
maxDate: '<'
|
||||
},
|
||||
controller: function($routeParams, $element, Categories, Incomes) {
|
||||
controller: function($stateParams, $element, Categories, Incomes) {
|
||||
var vm = this;
|
||||
|
||||
vm.loadData = function() {
|
||||
Categories.query({
|
||||
id: $routeParams.accountId,
|
||||
id: $stateParams.accountId,
|
||||
begin: vm.minDate ? moment(vm.minDate).format('YYYY-MM-DD') : null,
|
||||
end: vm.maxDate ? moment(vm.maxDate).format('YYYY-MM-DD') : null
|
||||
}, function(results) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
var operationFormTmpl = require('./operation.form.tmpl.html'),
|
||||
operationDeleteTmpl = require('./operation.delete.tmpl.html');
|
||||
|
||||
module.exports = function($routeParams, $modal, Notification, Operation,
|
||||
module.exports = function($stateParams, $modal, Notification, Operation,
|
||||
AccountService) {
|
||||
|
||||
var vm = this;
|
||||
@ -12,7 +12,7 @@ module.exports = function($routeParams, $modal, Notification, Operation,
|
||||
vm.add = function() {
|
||||
var operation = new Operation({
|
||||
// eslint-disable-next-line camelcase
|
||||
account_id: $routeParams.accountId
|
||||
account_id: $stateParams.accountId
|
||||
});
|
||||
|
||||
return vm.modify(operation);
|
||||
@ -27,7 +27,7 @@ module.exports = function($routeParams, $modal, Notification, Operation,
|
||||
|
||||
return Operation.query({
|
||||
// eslint-disable-next-line camelcase
|
||||
account_id: $routeParams.accountId,
|
||||
account_id: $stateParams.accountId,
|
||||
begin: minDate ? moment(minDate).format('YYYY-MM-DD') : null,
|
||||
end: maxDate ? moment(maxDate).format('YYYY-MM-DD') : null
|
||||
});
|
||||
@ -145,7 +145,7 @@ module.exports = function($routeParams, $modal, Notification, Operation,
|
||||
vm.operations = vm.load(minDate, maxDate);
|
||||
};
|
||||
|
||||
AccountService.get($routeParams.accountId).subscribe(account => {
|
||||
AccountService.get($stateParams.accountId).subscribe(account => {
|
||||
vm.account = account
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user