Top

Editors


you have to install Ngx-editor


 npm i ngx-editor

<div class="container-fluid">
   <div class="row">
       <div class="col-sm-12">
          <div class="card">
              <div class="card-header">
                  <h5>Ngx Editor</h5>
              </div>
              <div class="card-body">
                  <div class="NgxEditor__Wrapper">
                      <ngx-editor-menu [editor]="editor"> </ngx-editor-menu>
                      <ngx-editor [editor]="editor" [ngModel]="html" [disabled]="false"
                          [placeholder]="'Type here...'"></ngx-editor>
                  </div>
              </div>
          </div>
      </div>
  </div>
</div>
you have to add the following type script files

  import { CommonModule } from '@angular/common';
  import { Component } from '@angular/core';
  import { FormsModule } from '@angular/forms';
  import { Editor, NgxEditorModule } from 'ngx-editor';
  
  @Component({
    selector: 'app-ngx-editor',
    imports: [CommonModule,FormsModule,NgxEditorModule],
    templateUrl: './ngx-editor.html',
    styleUrl: './ngx-editor.scss'
  })
  export class NgxEditor {
  
    editor: Editor;
    html = '';
  
    ngOnInit(): void {
      this.editor = new Editor();
    }
  
    // make sure to destory the editor
    
    ngOnDestroy(): void {
      this.editor.destroy();
    }
  
  }                          

you have to install Mde-editor


 npm i @kolkov/angular-editor
<div class="col-sm-12">
 <div class="card">
     <div class="card-header pb-0">
     <h5>KolKov Editor</h5>
  </div>
     <div class="card-body">
         <angular-editor [placeholder]="'Enter text here...'"
          [(ngModel)]="htmlContent"></angular-editor>
   </div>
  </div>
</div>
To use type script files

import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AngularEditorModule } from '@kolkov/angular-editor';

@Component({
  selector: 'app-mde-editor',
  imports: [CommonModule,AngularEditorModule, FormsModule],
  templateUrl: './mde-editor.html',
  styleUrls: ['./mde-editor.scss']
}) 

export class MdeEditor {

  public htmlContent = '';

}