Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
How can I append HTML format value to normal format in angular using CKEditor

I am using angular CKEditor for HTML textarea. So I just get the value from CKEditor and show it to some other div. I have integrated this function using ngModel but I can't show the HTML form value. It's show the raw HTML value. Please check the below code and output.

HTML

<div class="row">
        <div class="col-md-6 col-lg-6 col-sm-12 text-center">
            <div class="bg-gray p-5 m-3" *ngIf="!editorStatus">
                <p class="mb-0">{{ htmlEditorValue }}</p>
            </div>

            <div class="htmleditor" *ngIf="editorStatus">
                <ckeditor name="htmlEditor" [config]="config" [editor]="Editor" [(ngModel)]="htmlEditorValue" skin="moono-lisa" language="en">
                </ckeditor>
                <button class="btn trans-btn list-head-btn ng-star-inserted btn-gradient mt-3 w-25" (click)="getEditorValue()">Save</button>
            </div>
        </div>
    </div>

TS

editorStatus: boolean = false;
htmlEditorValue = 'Test';

    changeEditor() {
        this.editorStatus = true;
      }
      
      getEditorValue() {
        this.editorStatus = false;
        console.log("ashok"+this.htmlEditorValue);
      }

And my output is: enter image description here

I recive a Raw HTML but i want HTML format. Anyone help me to fix this issue

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try setting your htmlEditorValue in .html file like this:

<p class="mb-0" [innerHtml]="htmlEditorValue"></p>

Take a look here, if I understand your problem the right way, it should solve the problem: https://stackblitz.com/edit/angular-ivy-k7deuo?file=src%2Fapp%2Fapp.component.ts

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!