Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
ngx-simple-text-editor
Advanced tools
Changelog
6 November 2022
#15
b6bfa80
f757fa0
90031a7
d237462
900ee2e
5744ea5
Readme
Ngx Simple Text editor or ST editor is a simple native text editor component for Angular 9+.
Angular version | Ngx simple text editor version |
---|---|
9 - 13 | 0.0.0 - 1.x.x |
14 | 2.x.x |
npm install ngx-simple-text-editor --save
then add NgxSimpleTextEditorModule
into module imports
import {NgxSimpleTextEditorModule} from 'ngx-simple-text-editor';
@NgModule({
// ...
imports: [
// ...
NgxSimpleTextEditorModule,
// ...
],
// ...
})
If you want to use default button icons, you must install Font awesome v5.
npm install @fortawesome/fontawesome-free@5
and declare in styles in angular.json
...
"styles": [
"src/styles.scss",
"node_modules/@fortawesome/fontawesome-free/css/all.css"
]
...
You can use Ngx simple text editor as classic template-driven form input or as reactive form input.
<st-editor [(ngModel)]="content" [config]="config"></st-editor>
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.
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,
};
}
You can pass all predefined buttons with predefined order, or you can use only buttons you want with order as you want.
import {EditorConfig, UNDO_BUTTON, SEPARATOR, BOLD_BUTTON, ITALIC_BUTTON} from 'ngx-simple-text-editor';
...
config: EditorConfig = {
buttons: [UNDO_BUTTON, SEPARATOR, BOLD_BUTTON, ITALIC_BUTTON],
};
...
Online demo or Stackblitz coming soon.
MIT
FAQs
Ngx Simple Text editor or ST editor is a simple native text editor component for Angular 9+.
The npm package ngx-simple-text-editor receives a total of 522 weekly downloads. As such, ngx-simple-text-editor popularity was classified as not popular.
We found that ngx-simple-text-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.