2019-10-08 05:34:37 +00:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
Output,
|
|
|
|
EventEmitter,
|
|
|
|
ViewChild
|
|
|
|
} from '@angular/core';
|
|
|
|
import { NgForm } from '@angular/forms';
|
2019-09-23 05:23:24 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'ucap-chat-form',
|
|
|
|
templateUrl: './form.component.html',
|
|
|
|
styleUrls: ['./form.component.scss']
|
|
|
|
})
|
|
|
|
export class FormComponent implements OnInit {
|
2019-10-08 05:34:37 +00:00
|
|
|
@Output()
|
|
|
|
send = new EventEmitter<string>();
|
|
|
|
|
|
|
|
@ViewChild('replyForm', { static: false })
|
|
|
|
replyForm: NgForm;
|
|
|
|
|
2019-09-23 05:23:24 +00:00
|
|
|
constructor() {}
|
|
|
|
|
|
|
|
ngOnInit() {}
|
|
|
|
|
2019-10-08 05:34:37 +00:00
|
|
|
onSend(event: Event) {
|
|
|
|
event.preventDefault();
|
|
|
|
|
|
|
|
this.send.emit(this.replyForm.form.value.message);
|
|
|
|
this.replyForm.reset();
|
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
}
|