1.0.13 • Published 3 years ago

ng-texteditor v1.0.13

Weekly downloads
31
License
-
Repository
github
Last release
3 years ago

Free Native Texteditor for Angular +6

simple native texteditor (WYSIWYG) for angular 6+ containing all components you need!

demo1

Support

If you like my work please comment and suggest please submit issues in order to fix any bugs and improvment of package

Examples

-- demo on stackblitz -- demo on guthub pages

Prerequisites

angular/core >= 6.0.0
angular/common >= 6.0.0
font-awesome >= 4.0.0

Installing

npm i ng-texteditor font-awesome

Usage

1-Import TexteditorModule to app.module.ts

import { TexteditorModule } from 'ng-texteditor'; // <-- add this line
@NgModule({
declarations: [
    ...
],
imports: [
    BrowserModule,
    TexteditorModule   // <-- and this line
],
providers: [...],
bootstrap: [AppComponent]
})

2-Code <ng-texteditor></ng-texteditor> anywhere you like

3-Insert Options

<ng-texteditor [id]="'id'" [placeholder]="'Place Holder'" tabIndex="TabIndexNumber | null"  [(ngModel)]="fruit" [config]="config"></ng-texteditor> 

Options

Inputs

  • editable <Boolean> : true
  • spellcheck <Boolean> : true
  • height <String>: 'auto'
  • minHeight <String>: '0'
  • maxHeight <String>: 'auto'
  • width <String> : 'auto'
  • minWidth <String> : '0'
  • translate <String> : 'yes'
  • enableToolbar <Boolean> : true
  • showToolbar <Boolean> : true
  • placeholder <String> : 'Enter text here...'
  • defaultParagraphSeparator <String> : ''
  • defaultFontName <String> : ''
  • defaultFontSize <String> : ''
  • fonts <Array> : [ {class: 'arial', name: 'Arial'}, {class: 'times-new-roman', name: 'Times New Roman'}, {class: 'calibri', name: 'Calibri'}, {class: 'comic-sans-ms', name: 'Comic Sans MS'} ]
  • uploadUrl <String> : 'v1/image'
  • sanitize <Boolean> : true
  • toolbarPosition <String> : 'top'
  • outline <Boolean> : true

Outputs

  • onChange() : (value: string) => void
  • onTouched() : () => void