November 2019
Beginner
436 pages
8h 52m
English
Now, let's implement some support so that we can send messages to particular groups:
import { FormsModule } from '@angular/forms';
You are going to need it later to establish two-way binding to the message's text.
<div class="message-editor"> <mat-form-field class="message-editor-field"> <input [(ngModel)]="newMessage" matInput placeholder="Message the group" autocomplete="off" (keyup.enter)="send()" /> </mat-form-field> </div>
Here, we are binding the input element to the newMessage property in a two-way fashion, and we're also handling the keyup.enter event ...
Read now
Unlock full access