Use categoryService instead of old Categories factory.

This commit is contained in:
Alexis Lahouze 2017-07-29 16:34:24 +02:00
parent a6a7c1cd77
commit efcf07565b
1 changed files with 2 additions and 18 deletions

View File

@ -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;