A simple native wysiwyg editor for Angular 6+
npm install htmleditor-libbash
npm install htmleditor-lib
`
$3
Import HTMLEditorLibModule
`typescript
import { HttpClientModule} from '@angular/common/http';
import { HTMLEditorLibModule } from 'htmleditor-lib';
@NgModule({
imports: [ HttpClientModule, HTMLEditorLibModule ]
})
`
Then in HTML
`html
`
or for usage with reactive forms
`html
`
if you using more than one editor on same page set id property
`html
`
where
`typescript
import { AngularEditorConfig } from 'htmleditor-lib';
...
editorConfig: AngularEditorConfig = {
editable: true,
spellcheck: true,
height: '25rem',
minHeight: '5rem',
placeholder: 'Enter text here...',
translate: 'no',
uploadUrl: 'v1/images', // if needed
customClasses: [ // optional
{
name: "quote",
class: "quote",
},
{
name: 'redText',
class: 'redText'
},
{
name: "titleText",
class: "titleText",
tag: "h1",
},
]
};
``