Prepare needed injection to upgrade Operation Component to Angular2.

This commit is contained in:
Alexis Lahouze 2017-07-29 23:06:10 +02:00
parent 45af7791ff
commit f7ea8a4621
1 changed files with 17 additions and 0 deletions

View File

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