From efcf07565bbd38f6b1ed31d3073c315c97de5959 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 29 Jul 2017 16:34:24 +0200 Subject: [PATCH] Use categoryService instead of old Categories factory. --- src/operations/category-chart.component.ts | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/operations/category-chart.component.ts b/src/operations/category-chart.component.ts index a90c637..2a76403 100644 --- a/src/operations/category-chart.component.ts +++ b/src/operations/category-chart.component.ts @@ -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;