jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

im trying to use the plugin on my angular2 project, after following the installation procedures it didint display the emoji button, but i receive this error in my console #72

Open ax3cubed opened 7 years ago

ax3cubed commented 7 years ago

jQuery.Deferred exception: Cannot set property 'iconSize' of undefined TypeError: Cannot set property 'iconSize' of undefined at new EmojiPicker (http://localhost:3000/assets/lib/js/emoji-picker.js:8:28)

aman-raikwar commented 7 years ago

I got the same time of issue when implementing in project screenshot from 2017-06-27 16-54-25

Please help as soon as possible

ax3cubed commented 7 years ago

wow, i just figured out how to fix this. first of all i removed all the emoji javascript files and made sure i have just a single jquery script(having more could cause an error) which i placed in my index.html , then i placed them all accordinly in my component like so..\ importing onInit and declare var $:any

then initialise the onInit ` ngOnInit() {

    $.getScript('../../../assets/lib/js/config.js');
    $.getScript('../../../assets/lib/js/util.js');
    $.getScript('../../../assets/lib/js/jquery.emojiarea.js');
    $.getScript('../../../assets/lib/js/emoji-picker.js');
    $.getScript('../../../assets/lib/js/activate.js');
}`

and it worked perfectly... hope this helps

EFvS commented 6 years ago

If you use "var $j = jQuery.noConflict();", you have to change $. and $( with $j. and $j(

zamananjum0 commented 6 years ago

Simply you can just add in 'angular-cli' "assets/lib/js/emoji-picker.js", "assets/lib/js/config.js", "assets/lib/js/util.js", "assets/lib/js/jquery.emojiarea.js" then restart the server.