0
我想創建一個角度爲2的聊天應用程序,我需要在輸入字段中顯示Emojis,但html不支持輸入字段中的圖像。
也是我試過這種方法,但沒有奏效:角度2輸入與圖像支持
<div contenteditable="true"
[innerHtml]="msgText"
class="form-control"
(keyup)="enable_disable_sendBtn()"
(keypress)="handle_enter_key($event)"
#messageBox
(input)="msgText = $event.target.innerText">
</div>
我已經試過this但不是我從tslint
了錯誤,並說:use @HostListener Or @HostBinding instead of host
。
任何人都可以幫助我在文本輸入中顯示emjis嗎?
「但沒有工作」是不夠的信息。預期的行爲是什麼?什麼是實際行爲?任何錯誤消息? –
也許你想使用https://www.emojione.com/或類似的 –
@GünterZöchbauer我期望顯示圖像,它顯示,但問題是當我試圖寫'amir'它寫'rima'所以問題是無論何時按下某個鍵(或者鍵入或按鍵,我都不知道問題是什麼)時,插入符號會轉到第一個輸入 – amirsa00