Inject $modal and accountIdService in Angular Component.
This commit is contained in:
parent
3c148e5297
commit
2166def0f1
@ -11,7 +11,6 @@ var scheduleFormTmpl = require('./schedule.form.tmpl.html'),
|
|||||||
scheduleDeleteTmpl = require('./schedule.delete.tmpl.html');
|
scheduleDeleteTmpl = require('./schedule.delete.tmpl.html');
|
||||||
|
|
||||||
export class ScheduleComponent {
|
export class ScheduleComponent {
|
||||||
$modal: any;
|
|
||||||
accountId: number;
|
accountId: number;
|
||||||
operations = [];
|
operations = [];
|
||||||
|
|
||||||
|
@ -14,6 +14,14 @@ import { ScheduleService } from './schedule.service';
|
|||||||
import { ScheduleDeleteModalComponent } from './scheduleDeleteModal.component';
|
import { ScheduleDeleteModalComponent } from './scheduleDeleteModal.component';
|
||||||
import { ScheduleRowComponent } from './scheduleRow.component';
|
import { ScheduleRowComponent } from './scheduleRow.component';
|
||||||
|
|
||||||
|
export function $modalServiceFactory(i: any) {
|
||||||
|
return i.get('$modal');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function accountIdServiceFactory(i: any) {
|
||||||
|
return i.get('accountIdService');
|
||||||
|
}
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
HttpModule,
|
HttpModule,
|
||||||
@ -25,7 +33,16 @@ import { ScheduleRowComponent } from './scheduleRow.component';
|
|||||||
NgbModule
|
NgbModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
ScheduleService
|
ScheduleService,
|
||||||
|
{
|
||||||
|
provide: '$modal',
|
||||||
|
deps: ['$injector'],
|
||||||
|
useFactory: $modalServiceFactory
|
||||||
|
}, {
|
||||||
|
provide: 'accountIdService',
|
||||||
|
deps: ['$injector'],
|
||||||
|
useFactory: accountIdServiceFactory
|
||||||
|
}
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ScheduleDeleteModalComponent,
|
ScheduleDeleteModalComponent,
|
||||||
|
Loading…
Reference in New Issue
Block a user