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

View File

@ -36,12 +36,12 @@ module.exports = angular.module('categoryChartModule', [
maxDate: '<', maxDate: '<',
account: '<' account: '<'
}, },
controller: function($element, Categories, Incomes) { controller: function($element, categoryService) {
var vm = this; var vm = this;
vm.loadData = function(account: Account) { vm.loadData = function(account: Account) {
categoryService.query( categoryService.query(
accountIdService.get(), account.id,
vm.minDate ? moment(vm.minDate).format('YYYY-MM-DD') : null, vm.minDate ? moment(vm.minDate).format('YYYY-MM-DD') : null,
vm.maxDate ? moment(vm.maxDate).format('YYYY-MM-DD') : null vm.maxDate ? moment(vm.maxDate).format('YYYY-MM-DD') : null
).subscribe((results) => { ).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; .name;