From 4f4967a75148b7c1d61338aec89fb0bf5b8440cb Mon Sep 17 00:00:00 2001 From: Sibiraj Date: Mon, 5 Feb 2018 14:42:25 +0530 Subject: [PATCH] fix: ngModel data binding with editor`s textarea closes #45 --- src/app/ngx-editor/ngx-editor.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/ngx-editor/ngx-editor.component.ts b/src/app/ngx-editor/ngx-editor.component.ts index ffa61214..950ce8ff 100644 --- a/src/app/ngx-editor/ngx-editor.component.ts +++ b/src/app/ngx-editor/ngx-editor.component.ts @@ -211,13 +211,13 @@ export class NgxEditorComponent implements OnInit, ControlValueAccessor { * @param value value to be executed when there is a change in contenteditable */ writeValue(value: any): void { + this.monitorEditor(value); - if (!!value) { + if (value === null || value === undefined || value === '') { return; } this.refreshView(value); - this.monitorEditor(value); } /**