From f7ea8a46218fa2f95f367229755aa95226af9e98 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 29 Jul 2017 23:06:10 +0200 Subject: [PATCH] Prepare needed injection to upgrade Operation Component to Angular2. --- src/operations/operation.module.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/operations/operation.module.ts b/src/operations/operation.module.ts index 3ed1d67..b229b3b 100644 --- a/src/operations/operation.module.ts +++ b/src/operations/operation.module.ts @@ -13,6 +13,14 @@ import { CategoryChartComponent } from './categoryChart.component'; import { CategoryService } from './category.service'; import { OperationService } from './operation.service'; +export function $modalServiceFactory(i: any) { + return i.get('$modal'); +} + +export function accountIdServiceFactory(i: any) { + return i.get('accountIdService'); +} + @NgModule({ imports: [ HttpModule, @@ -24,6 +32,15 @@ import { OperationService } from './operation.service'; providers: [ CategoryService, OperationService, + { + provide: '$modal', + deps: ['$injector'], + useFactory: $modalServiceFactory + }, { + provide: 'accountIdService', + deps: ['$injector'], + useFactory: accountIdServiceFactory + } ], declarations: [ BalanceChartComponent,