Skip to content

Commit

Permalink
fix: set default spellcheck value
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s committed Sep 27, 2017
1 parent fdd1354 commit ba28d92
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ A Simple WYSIWYG Editor for Angular Applications.
Install via Package managers such as [npm][npm] or [yarn][yarn]

```bash
npm install [email protected] --save
npm install [email protected].1 --save
# or
yarn add [email protected]
yarn add [email protected].1
```

### Usage
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-editor",
"version": "1.0.0-alpha",
"version": "1.0.0-alpha.1",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down
2 changes: 1 addition & 1 deletion src/app/ngx-editor/ngx-editor.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="ngx-editor" id="ngxEditor" [ngClass]="{'fullscreen': fullScreen}" [attr.spellcheck]="spellCheck || config['spellCheck']">
<div class="ngx-editor" id="ngxEditor" [ngClass]="{'fullscreen': fullScreen}" [attr.spellcheck]="config['spellCheck']">
<div class="toolbar responsive">
<div class="set">
<button (click)="executeCommand('bold')" title="Bold"><i class="fa fa-bold" aria-hidden="true"></i></button>
Expand Down
10 changes: 7 additions & 3 deletions src/app/ngx-editor/ngx-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class NgxEditorComponent implements OnInit {
/*
* default configurations
*/
_config: JSON;
_config: any;

@Input() set config(value: JSON) {

Expand All @@ -28,13 +28,12 @@ export class NgxEditorComponent implements OnInit {
}

get config(): JSON {
return this._config;
return this._config || ngxEditorConfig;
}

@Input() spellCheck;
@Input() placeholder;


fullScreen = false;

constructor() { }
Expand Down Expand Up @@ -74,5 +73,10 @@ export class NgxEditorComponent implements OnInit {
}

ngOnInit() {
if (this.spellCheck === false) {
this.config['spellCheck'] = this.spellCheck;
}

console.log(this.config)
}
}

0 comments on commit ba28d92

Please sign in to comment.