Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML Editor for Angular7

I'm looking for an HTML-editor to embed in an Angular7 project. The user of the editor will be creating very simple web pages or making small edits to more complex pages. I originally thought a WYSISYG editor might do the trick but I'm finding out they aren't great for making edits to the source HTML. Does anyone have recommendations?

Here's a list of what I've considered so far:

  1. CKEditor5 - Really a rich text editor. Doesn't offer the ability to view/edit source HTML.
  2. CKEditor4 - Does offer the ability to edit the source HTML but doesn't seem good for editing web pages.
  3. Froala - Looks really good, but isn't open source.
  4. Summernote (and a typescript port) - This one looks like it would be perfect. Haven't been able to find documentation for setting this up in Angular though and the typescript library doesn't have any documentation. If anyone has experience setting this up, an explanation would be great!
  5. AngularEditor - I currently have this one setup and working inside my project. It seems alright for editing web pages. My biggest issue with it is that some HTML I've inserted into the editor doesn't stay within the editor when rendering. Styles leave the editor window and other elements on the main page get altered.

Any suggestions that I may have overlooked?

like image 597
Tw1sm Avatar asked Apr 18 '19 15:04

Tw1sm


People also ask

What is NGX editor?

Rich Text Editor for angular using ProseMirror.

What you see is what you get acronym?

WYSIWYG (pronounced wiz-ee-wig) is a type of editing software that allows users to see and edit content in a form that appears as it would when displayed on an interface, webpage, slide presentation or printed document. WYSIWYG is an acronym for "what you see is what you get."


2 Answers

Look no further -- I can really recommend CodeMirror :)

It's a very powerful but lightweight JS text editor which can be embedded in your html page and has a bunch of features such as..

  • support for over 100 languages
  • syntax/markup highlighting
  • keyboard bindings (vim, emacs, sublime)
  • search/replace interface
  • tag matching
  • ..

..and it also supports HTML markup

my favorite feature is the autocompletion support -- like in your IDE you can use ctrl-space to autocomplete. You can try this feature here with the HTML example

disclaimer: I'm not a contributor to the project, but I have used it in some projects myself and would consider myself a fanboy.

like image 161
lolcatzftw Avatar answered Oct 06 '22 04:10

lolcatzftw


this is the best way to implement text editor with angular easy simple and perfect work it,s work for me if any one need follow these lines of code

 npm install @syncfusion/ej2-angular-richtexteditor --save

second step include the above library in app.module.ts like this

 import { RichTextEditorAllModule } from '@syncfusion/ej2-angular-richtexteditor';

  @NgModule({
  declarations: [
  AppComponent
 ],
 imports: [
 RichTextEditorAllModule
 ],
 bootstrap: [AppComponent]
 })
 export class AppModule { }

and then in component view page use this line

<ejs-richtexteditor></ejs-richtexteditor>

this is result of the above text editor library enter image description here

like image 28
abubakkar tahir Avatar answered Oct 06 '22 03:10

abubakkar tahir