funky-framadate-front/src/app/pages/answers/answers.component.ts

27 lines
707 B
TypeScript

import {Component, OnInit} from '@angular/core';
import {BaseComponent} from '../base-page/base.component';
import {ConfigService} from '../../config.service';
@Component({
selector: 'framadate-answers',
templateUrl: './answers.component.html',
styleUrls: ['./answers.component.scss']
})
export class AnswersComponent extends BaseComponent implements OnInit {
constructor(config: ConfigService) {
super(config);
}
// todo, manage validation of each page in a common way
ngOnInit() {
}
// add a new answer on the press of ENTER in an input
addWhenEnterKey(event) {
if (event.keyCode === 13) {
this.config.addAnswer();
}
}
}