我得到這個表情圖案LIB:如何使用指令在angularjs中使用表情符號選擇器lib?
https://github.com/one-signal/emoji-picker
我想做出指示,這是使用表情符號選擇器功能:
$(function() {
// Initializes and creates emoji set from sprite sheet
window.emojiPicker = new EmojiPicker({
emojiable_selector: '[data-emojiable=true]',
assetsPath: 'lib/img/',
popupButtonClasses: 'fa fa-smile-o'
});
// Finds all elements with `emojiable_selector` and converts them to rich emoji input fields
// You may want to delay this step if you have dynamically created input fields that appear later in the loading process
// It can be called as many times as necessary; previously converted input fields will not be converted again
window.emojiPicker.discover();
});
,這是HTLM使用表情符號:
<p class="lead emoji-picker-container">
<textarea class="form-control textarea-control" rows="3" placeholder="Textarea with emoji Unicode input" data-emojiable="true" data-emoji-input="unicode"></textarea>
</p>
我怎麼能爲我的角度項目做到這一點?感謝幫助我!
你可能想看看以前的工作,並從那裏開始,這通常是更適合你遇到直接的技術問題或具體問題https://github.com/one-signal/emoji-picker這個表情符號選擇器不依賴jQuery編寫,所以你可以避免有額外的依賴。如果你堅持使用這個庫並將其封裝在一個指令中,你需要在angular之前加載jQuery,但是可能會發現其他角度表情符號庫對找到組織指令代碼的起點很有幫助。 – shaunhusain