import {Component} from '@angular/core';
import {PeerService} from '../peer.service';

@Component({
  selector: 'app-chat',
  templateUrl: './chat.component.html',
  styleUrls: ['./chat.component.scss']
})
export class ChatComponent {

  message: string;

  constructor(private peerService: PeerService) {
  }

  get users() {
    return this.peerService.users;
  }

  get messages() {
    return this.peerService.messages;
  }

  sendMsg() {
    this.peerService.sendMessage(this.message);
    this.message = '';
  }

}
