froala / angular-froala

Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
306 stars 123 forks source link

Unable to fire and respond to editor events #210

Open AlmogCohen opened 5 years ago

AlmogCohen commented 5 years ago

Hi, I've seen a few of these issues already open before but couldn't quite figure out where the issue is or how to solve this. Your help would be much appreciated!

When I set the editor settings in the scope, they all work fine and look as expected (see for example the inlineStyles, buttons and inline toolbar which all work), but no matter what I do I couldn't make the events work... The editor looks fine as you can see here but the events never fire. Do you have any recommendation? Is there anything I'm doing wrong?

No alerts are popping, no console errors... I'm using version 2.6.6 both for angular-froala and froala-wysiwyg-editor.

$ctrl.froalaOptions = {
      toolbarInline: true,
      placeholderText: 'Write your text here...',
      direction: 'auto',
      toolbarButtons: ['inlineStyle'],
      inlineStyles: {
        'Big Red': 'font-size: 20px; color: red;',
        'Small Blue': 'font-size: 14px; color: blue;'
      },
      events: {
        'froalaEditor.initialized': function () {
          alert('on initialized event!')
        },
        'froalaEditor.focus': function (e, editor) {
          alert('on focus event!')
        },
        'froalaEditor.keypress': function (e, editor, keypressEvent) {
          alert('on keypress event!')
        }
      }
    };
AlmogCohen commented 5 years ago

Anyone monitoring this repo?

stefanneculai commented 5 years ago

@AlmogCohen do you think you could make a plunker for it? Thanks in advance.

navneetnagpal commented 5 years ago

@AlmogCohen remove the prefix "froalaEditor.". Let me know if this works.