CKeditor获取文本区域内容而不是带角度5的html

时间:2018-04-12 13:22:51

标签: angular ckeditor

在我的应用程序中,我使用ckeditor作为描述部分。

<ck-editor [(ngModel)]='ticket.description' [ngModelOptions]="{standalone: true}" skin="moono-lisa" language="en" [fullPage]="true"></ck-editor>

This should save as html content to data base while save so it can be display in table with htlm tag. But i need only content what i gave in text area.

Image
    我已经突出显示了我需要显示的内容。

2 个答案:

答案 0 :(得分:1)

我不是CKEditor的专家,但[fullPage]="true"<html><body></body></html>插入ticket.description

尝试[fullPage]="false"

More about CKEditor config

More about CKEditor full page

答案 1 :(得分:0)

我们需要在表

中显示时使用innerHTML

例如:   我使用像席子表

<ng-container matColumnDef="description">
        <mat-header-cell *matHeaderCellDef mat-sort-header> Description </mat-header-cell>
        <mat-cell *matCellDef="let row" [style.color]="green" [innerHTML]="row.description">  </mat-cell>
      </ng-container>