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');
|
||||
|
||||
export class ScheduleComponent {
|
||||
$modal: any;
|
||||
accountId: number;
|
||||
operations = [];
|
||||
|
||||
|
@ -14,6 +14,14 @@ import { ScheduleService } from './schedule.service';
|
||||
import { ScheduleDeleteModalComponent } from './scheduleDeleteModal.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({
|
||||
imports: [
|
||||
HttpModule,
|
||||
@ -25,7 +33,16 @@ import { ScheduleRowComponent } from './scheduleRow.component';
|
||||
NgbModule
|
||||
],
|
||||
providers: [
|
||||
ScheduleService
|
||||
ScheduleService,
|
||||
{
|
||||
provide: '$modal',
|
||||
deps: ['$injector'],
|
||||
useFactory: $modalServiceFactory
|
||||
}, {
|
||||
provide: 'accountIdService',
|
||||
deps: ['$injector'],
|
||||
useFactory: accountIdServiceFactory
|
||||
}
|
||||
],
|
||||
declarations: [
|
||||
ScheduleDeleteModalComponent,
|
||||
|
Loading…
Reference in New Issue
Block a user