diff --git a/src/scheduler/scheduleRow.component.ts b/src/scheduler/scheduleRow.component.ts index 9440577..020ade3 100644 --- a/src/scheduler/scheduleRow.component.ts +++ b/src/scheduler/scheduleRow.component.ts @@ -11,8 +11,6 @@ import { ScheduleEditModalComponent } from './scheduleEditModal.component'; import { ScheduleService } from './schedule.service'; import { Schedule } from './schedule'; -var scheduleFormTmpl = require('./schedule.form.tmpl.html'); - @Component({ selector: 'tr[schedule-row]', host: { @@ -61,7 +59,6 @@ export class ScheduleRowComponent { private scheduleService: ScheduleService, private logger: Logger, private toastrService: ToastrService, - @Inject('$modal') private $modal, private ngbModal: NgbModal ) {} @@ -108,26 +105,15 @@ export class ScheduleRowComponent { } modify() { - // FIXME Alexis Lahouze 2017-06-15 i18n - var title = "Modify schedule #" + this.schedule.id; + const modal = this.ngbModal.open(ScheduleEditModalComponent, { + windowClass: 'in' + }); - this.$modal({ - templateUrl: scheduleFormTmpl, - controller: function($scope, title, schedule, $save) { - $scope.title = title; - $scope.operation = schedule; - $scope.$save = () => { - $scope.$hide(); - $save($scope.operation); - }; - }, - locals: { - title: title, - schedule: this.schedule, - $save: (operation) => { - this.save(operation); - } - } + modal.componentInstance.schedule = this.schedule; + + modal.result.then((schedule: Schedule) => { + this.save(schedule); + }, (reason) => function(reason) { }); } }