首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular 2,textarea (附加文字的表情符号)

Angular 2,textarea (附加文字的表情符号)
EN

Stack Overflow用户
提问于 2018-01-16 15:08:16
回答 1查看 858关注 0票数 8

我想在短信中附加表情符号。

代码语言:javascript
复制
<textarea class="msgarea" * [(ngModel)]="msg" name="message-to-send" id="message-to-send"  placeholder="Type your message" rows="3">
</textarea>

使用表情符号显示消息

代码语言:javascript
复制
<div class="message-container" [innerHTML]="msg | emojis">
</div>

我想在文本区显示所有的表情符号。请看附件中的图片。

我正在使用表情符号的this参考。

EN

回答 1

Stack Overflow用户

发布于 2021-05-24 19:11:06

在html中添加一个按钮,当点击按钮时,表情符号弹出窗口就会出现。

在typescript文件中调用此函数

代码语言:javascript
复制
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链接。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48275715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档