diff --git a/src/app/ngx-editor/ngx-editor.component.html b/src/app/ngx-editor/ngx-editor.component.html index 6438dcf8..cc8159ab 100644 --- a/src/app/ngx-editor/ngx-editor.component.html +++ b/src/app/ngx-editor/ngx-editor.component.html @@ -33,7 +33,7 @@ -
+ [attr.spellcheck]="getBooleanProperty('spellcheck')"> \ No newline at end of file diff --git a/src/app/ngx-editor/ngx-editor.component.ts b/src/app/ngx-editor/ngx-editor.component.ts index 9dd52d0c..99fe6f27 100644 --- a/src/app/ngx-editor/ngx-editor.component.ts +++ b/src/app/ngx-editor/ngx-editor.component.ts @@ -79,17 +79,22 @@ export class NgxEditorComponent implements OnInit { } /* - * ngOnInit + * return values for attributes that accepts boolean */ - ngOnInit() { - if (this.spellcheck === false) { - this.config['spellcheck'] = false; + getBooleanProperty(value) { + if (this[value] === false) { + return false; } - - if (this.editable === false) { - this.config['editable'] = false; + if (this[value] === undefined) { + return this.config[value]; } + return true; + } + /* + * ngOnInit + */ + ngOnInit() { this.element.nativeElement.getElementsByClassName('textarea')[0].innerHTML = this.html || ''; }