Skip to content

Instantly share code, notes, and snippets.

@Ibro
Created May 5, 2017 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ibro/96c96c3146fd18ad10e2f2971d0f145c to your computer and use it in GitHub Desktop.
Save Ibro/96c96c3146fd18ad10e2f2971d0f145c to your computer and use it in GitHub Desktop.
RxJS Socket.IO Angular Chat - Angular Component - Coding Blast - www.codingblast.com
import { Component } from '@angular/core';
import { ChatService } from '../chat.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
message: string;
constructor(private chatService: ChatService) {
}
sendMessage() {
this.chatService.sendMessage(this.message);
this.message = '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment