0

Please help me on how to get the content of the froala editor. Just to display it on the console would be enough. Here is my code:

Template.myTemplate.events({
        'click': function (event) {

            var self = this;

            return function (e, editor) {
            var newHTML = editor.html.get();
            console.log(newHTML);
            }
        }
    });

I can not seem to display the content of the editor even in the console when I click the button. Thank you.

1 Answers1

0

If you're not using the older version here is a working code:

Template.myTemplate.events({
  'click': function (e) {
     var html = $('.selector').editable('getHTML', true, true);
   });
});

based on https://www.froala.com/wysiwyg-editor/docs/methods#getHTML

If you're using the v2.0 $('.selector').froalaEditor('html.get', true); the .selector is where you initialize your froala editor, If you can show how you do that I can adjust it to it.

  • It shows a bunch of like these "[ ]" when I click the button. . I tried using `$('.selector').editable('getText');` `$('.selector').editable('getHTML', true, true);` – Jagmok Dugmok Oct 26 '15 at 14:45
  • @JagmokDugmok replace `.selector` with your selector show me how you initialize froala? –  Oct 26 '15 at 15:58
  • I see I got it :) I also used text area and render it with froala interface to make things much easier :) – Jagmok Dugmok Oct 26 '15 at 18:32