我在我的 Angular 应用程序中使用了最新版本的“ngx-editor”,但是当我在内容中使用内联样式div
时,它没有正确显示。我的意思是,ngx-editor在所见即所得编辑器中删除了该样式。
我一直在尝试下面的这个例子。
app.component.ts
// my typescript
const content = `
<div style="background: orange; display: flex; width: 100%; height: 64px">
Example text with example custom container with inline style
</div>
<div style="background: #000000; width: 100%; height: 30px; text-align: center">
Example footer
</div>
`
this.formGroup = this.formBuilder.group({
content: [toDoc(content)],
});
app.component.html
<div class="row">
<div class="col-12">
<form [formGroup]="formGroup">
<ngx-editor formControlName="content"></ngx-editor>
<button class="btn btn-primary btn-sm" (click)="doSubmit()">Submit</button>
</form>
</div>
</div>
但是当我单击提交按钮并控制该结果时,我没有得到那种内联样式。
也许,现在有人如何在 ngx-editor 的内容上使用内联样式。谢谢你的帮助。