The first step in creating the messaging service is to define a data model. We create a message model with properties; the message model consists of the following four properties:
- Message: This contains the message in a string type.
- Sender UID: The sender UID is used to know the identity of the sender of the particular message and write logic to display the text message on the left panel of the chat window.
- Receiver UID: The receiver UID is used to know the identity of the receiver of the particular message and write logic to display the text message on the right panel of the chat window.
- Timestamp: This property is used to display the date and time of the message sent.
Here's the message.ts
as of now:
export class Message { message: string; senderUid: string; receiverUid: string; timestamp: number; constructor(message: string, senderUid: string, receiverUid: string, timestamp: number) { this.message =...