我想在短信中附加表情符号。
<textarea class="msgarea" * [(ngModel)]="msg" name="message-to-send" id="message-to-send" placeholder="Type your message" rows="3">
</textarea>使用表情符号显示消息
<div class="message-container" [innerHTML]="msg | emojis">
</div>我想在文本区显示所有的表情符号。请看附件中的图片。

我正在使用表情符号的this参考。
发布于 2021-05-24 19:11:06
在html中添加一个按钮,当点击按钮时,表情符号弹出窗口就会出现。
在typescript文件中调用此函数
toggleEmojiPicker() {
console.log(this.showEmojiPicker);
this.showEmojiPicker = !this.showEmojiPicker;
}
addEmoji(event) {
console.log(this.message)
const { message } = this;
console.log(message);
console.log(`${event.emoji.native}`)
const text = `${message}${event.emoji.native}`;
this.message = text;
// this.showEmojiPicker = false;
}click for stackbliz example这是stackbliz链接。
https://stackoverflow.com/questions/48275715
复制相似问题