1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

I am using angular kolkov editor using formcontrol, have to bind html in my editor

Discussão em 'Angular' iniciado por Joshna J.U, Outubro 11, 2024.

  1. Joshna J.U

    Joshna J.U Guest

    html code:


    <angular-editor [placeholder]="'Enter task...'" formControlName="task_note" [config]="editorConfig">
    </angular-editor>

    <div class="icon" style="cursor: pointer" (click)="editTaskbtn(task)" (click)="openTask(cont)">
    <img src="assets/Deals Icons/Edit icon.svg" style="height: 24px" alt="" srcset="" />
    </div>

    .ts file:

    editorConfig: AngularEditorConfig = { editable: true, spellcheck: true, height: 'auto', minHeight: '0', maxHeight: 'auto', width: 'auto', minWidth: '0', translate: 'yes', enableToolbar: true, showToolbar: true, defaultParagraphSeparator: '', defaultFontName: '', defaultFontSize: '', fonts: [ { class: 'arial', name: 'Arial' }, { class: 'times-new-roman', name: 'Times New Roman' }, { class: 'calibri', name: 'Calibri' }, { class: 'comic-sans-ms', name: 'Comic Sans MS' }, ], customClasses: [ { name: 'quote', class: 'quote', }, { name: 'redText', class: 'redText', }, { name: 'titleText', class: 'titleText', tag: 'h1', }, ], uploadUrl: 'v1/image', uploadWithCredentials: false, sanitize: false, toolbarPosition: 'top', toolbarHiddenButtons: [ [ 'undo', 'redo', 'strikeThrough', 'subscript', 'superscript', 'indent', 'outdent', 'heading', ], [ 'textColor', 'backgroundColor', 'customClasses', 'link', 'unlink', 'insertImage', 'insertVideo', 'insertHorizontalRule', 'removeFormat', 'toggleEditorMode', ], ], };

    when submitting the data using the editor data is saved as HTML, but after that when I open the editor to view the data to get edit, in angular kolkov editor data is displayed as
    <ul><li>ccccc</li><li>aaaa</li><li>bbbb</li></ul>

    Continue reading...

Compartilhe esta Página