1

I'm using Quill editor with the ngx-quill NPM package. Everything is working great except that I just can't get the (change) event to fire. Here's the HTML:

<quill-editor (change)="validateChange(field)" [formControlName]="field.id" [id]="field.id"></quill-editor>

The (change)="validateChange(field)" is having no effect.

Thanks for any ideas!!

Matt
  • 3,206
  • 4
  • 24
  • 26

2 Answers2

3

In model driven form you could use valueChanges Observable on your form.

this.formName.valueChanges.subscribe(data => {
   console.log('Changed Values', data)
})
Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299
  • Works perfectly for listening to changes Pankaj, thank you! How to I detect the blur event -- so it's firing now every time I change anything in the editor, but how about if I need to see when the user finishes updating and leaves the editor? Thanks again for your help!! – Matt Nov 14 '17 at 21:05
  • @Matt Can you please check [How to use onBlur event on Angular2?](https://stackoverflow.com/a/34918214/2435473) – Pankaj Parkar Nov 15 '17 at 06:05
-1

If the developer doesn't want to use reactiveForms the output event can be captured with:

<quill-editor (**onContentChanged**)="somefunction($event)" ></quill-editor>
Ruli
  • 2,592
  • 12
  • 30
  • 40
Emanuel Silva
  • 53
  • 1
  • 6