Ngx Simple Text editor or ST editor is a simple native text editor component for Angular 9+.
npm install ngx-simple-text-editor

!npm bundle size
!NPM







!demo
npm install ngx-simple-text-editor --save
then add NgxSimpleTextEditorModule into module imports
``typescript
import {NgxSimpleTextEditorModule} from 'ngx-simple-text-editor';
@NgModule({
// ...
imports: [
// ...
NgxSimpleTextEditorModule,
// ...
],
// ...
})
`npm install @fortawesome/fontawesome-free
If you want to use default button icons, you must install Font awesome. and declare in styles in angular.json`json`
...
"styles": [
"src/styles.scss",
"node_modules/@fortawesome/fontawesome-free/css/all.css"
]
...
angular2html
`
The editor has got only one @Input with config object, which is optional.
The config object is defined by placeholder and buttons, both are optional and can be omitted.
`typescript
import { Component } from '@angular/core';
import {EditorConfig, ST_BUTTONS} from 'ngx-simple-text-editor';@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
content = '';
config: EditorConfig = {
placeholder: 'Type something...',
buttons: ST_BUTTONS,
};
}
``