I am trying to use angular2-tinymce library in my project. I have successfully integrated tinymce in my module. But i could not trigger any callback for change event when any changes happened in the tinymce editor.
// in add-progress-note.module.ts file
@NgModule({
declarations: [
AddProgressNotePage,
],
imports: [
IonicPageModule.forChild(AddProgressNotePage),
TinymceModule.withConfig({
menubar: false,
plugins: ['textcolor'],
toolbar: 'forecolor',
resize: false,
statusbar: false
})
]
})
// in add-progress-note.html file
<ion-row class="note-editor" id="noteArea">
<app-tinymce class="note-input-textarea" [(ngModel)]='noteText' (change)="onChangeNote()"></app-tinymce>
</ion-row>
// in add-progress-note.ts file
onChangeNote(): void {
console.log(this.noteText);
}
My onChangeNote did not fire.
How to trigger a callback event for any change event in tinymce editor?
If you are using ngModel
, you can easily use ngModelChange
instead of change
.
<app-tinymce class="note-input-textarea" [(ngModel)]='noteText' (ngModelChange)="onChangeNote()"></app-tinymce>