// vim: set tw=80 ts=2 sw=2 sts=2:
import { Component, Input } from '@angular/core';
import { NgForm } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Schedule } from './schedule';
@Component({
selector: 'schedule-edit-modal',
template: `
`
})
export class ScheduleEditModalComponent {
@Input() schedule: Schedule;
valid: boolean = false;
constructor(private activeModal: NgbActiveModal) {}
title(): string {
if(this.schedule.id) {
return "Schedule #" + this.schedule.id;
} else {
return "New schedule";
}
}
submit(): void {
this.activeModal.close(this.schedule);
}
cancel(): void {
this.activeModal.dismiss("closed");
}
}