wermerb / ngx-trumbowyg

Angular 6 component & directive for Trumbowyg WYSIWYG editor.
MIT License
5 stars 6 forks source link

emojify plugin not showing emoji images #3

Closed vincentmegia closed 5 years ago

vincentmegia commented 6 years ago

i followed the example from trumbowyg using emojify plugin but somehow i don't see the images at all. all i can see is the code.

declare var emojify:any;

    // Setup emojify.js
    emojify.setConfig({
        img_dir : '//cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/images/basic/'
    });
    emojify.run();

html <ngx-trumbowyg-editor id="editor" name="editor" [(ngModel)]="model" [options]="options">

image

wermerb commented 6 years ago

Yup as far as i can see there is a tricky part in the documentation:

$('.trumbowyg-editor').on('input propertychange', function() { emojify.run(); });

I did not expose the editor dom so you cannot listen on any event yet. For now i would suggest that the you wrap your run command in a setTimeout: setTimeout(()=>emojify.run(),100)

I will try to implement a reasonable way to handle these situations.

wermerb commented 6 years ago

Please checkout the new readme now you can register events for your purposes