Use categoryService instead of old Categories factory.
This commit is contained in:
parent
a6a7c1cd77
commit
efcf07565b
@ -36,12 +36,12 @@ module.exports = angular.module('categoryChartModule', [
|
||||
maxDate: '<',
|
||||
account: '<'
|
||||
},
|
||||
controller: function($element, Categories, Incomes) {
|
||||
controller: function($element, categoryService) {
|
||||
var vm = this;
|
||||
|
||||
vm.loadData = function(account: Account) {
|
||||
categoryService.query(
|
||||
accountIdService.get(),
|
||||
account.id,
|
||||
vm.minDate ? moment(vm.minDate).format('YYYY-MM-DD') : null,
|
||||
vm.maxDate ? moment(vm.maxDate).format('YYYY-MM-DD') : null
|
||||
).subscribe((results) => {
|
||||
@ -118,20 +118,4 @@ module.exports = angular.module('categoryChartModule', [
|
||||
}
|
||||
})
|
||||
|
||||
.factory('Categories', function($resource) {
|
||||
return $resource(
|
||||
'/api/account/:id/category', {
|
||||
id: '@id'
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
.factory('Incomes', function($resource) {
|
||||
return $resource(
|
||||
'/api/account/:id/income', {
|
||||
id: '@id'
|
||||
}
|
||||
);
|
||||
})
|
||||
|
||||
.name;
|
||||
|
Loading…
Reference in New Issue
Block a user