initial commit
- contains basic chat via websocket - contains button to test websocket - contains button to test rest api
This commit is contained in:
23
src/app/chat/input/input.component.ts
Normal file
23
src/app/chat/input/input.component.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {SocketService} from '../../socket/socket.service';
|
||||
import {Message} from '../message';
|
||||
import {Events} from '../../socket/events-enum';
|
||||
|
||||
@Component({
|
||||
selector: 'app-input',
|
||||
templateUrl: './input.component.html',
|
||||
styleUrls: ['./input.component.css']
|
||||
})
|
||||
export class InputComponent implements OnInit {
|
||||
|
||||
onEnter(value: string): void {
|
||||
const message = new Message('Aangular Frontend', value);
|
||||
this.socketService.send(Events.publicMessage, message);
|
||||
}
|
||||
|
||||
constructor(private socketService: SocketService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user