life-towers/src/app/components/modal/modal.component.ts
schmelczerandras 420cd788c4 Reformat code
2019-08-24 15:25:43 +02:00

20 lines
552 B
TypeScript

import { Component } from '@angular/core';
import { ModalService, ModalType } from '../../services/modal.service';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.scss']
})
export class ModalComponent {
// Needed for accessing the enum from html.
ModalType = ModalType;
constructor(public modalService: ModalService) {
window.addEventListener('keydown', (event: KeyboardEvent) => {
if (event.key === 'Escape') {
this.modalService.cancel();
}
});
}
}