Top

Editors


you have to install ngx-editor

npm i ngx-editor
<!-- Html code -->
 <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>
-- ts files --

import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Editor, NgxEditorModule } from 'ngx-editor';
import { PageWrapperComponent } from "../../../shared/components/page-wrapper/page-wrapper.component";
import { CardComponent } from "../../../shared/components/card/card.component";

@Component({
    selector: 'app-ngx-editors',
    templateUrl: './ngx-editors.component.html',
    styleUrl: './ngx-editors.component.scss',
    imports: [NgxEditorModule, FormsModule, PageWrapperComponent, CardComponent]
})

export class NgxEditorsComponent {

  public editor: Editor;
  public html = '';

  ngOnInit(): void {
    this.editor = new Editor();
  }

  ngOnDestroy(): void {
    this.editor.destroy();
  }

}


<!-- Html code -->
 <angular-editor body [placeholder]="'Enter text here...'" [(ngModel)]="htmlContent"></angular-editor>
<!-- ts files-->
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AngularEditorModule } from '@kolkov/angular-editor';
import { PageWrapperComponent } from '../../../shared/components/page-wrapper/page-wrapper.component';
import { CardComponent } from "../../../shared/components/card/card.component";

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

export class MdeEditorsComponent {

  public htmlContent = '';

}