如何将任何元素的innerHtml以角度导出到Microsoft word?使用typescript



我有一个模式,它显示一个我想将该字母导出到Microsoft Word的字母。我创建了一个模态类,我在其中调用列表中的值,我希望用户提供一个选项,以便将模态中的所有内容导出到Microsft Word

请找到我的Modal

<ng-template #template> <div class="modal-header"> <h4 class="modal-title pull-left">Letter</h4> <button type="button" class="close pull-right" aria-label="Close" (click)="bsModalRef.hide()"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body" *ngFor="let item of items"> {{item}} </div> </ng-template

如果您不是在寻找一个简单的"HTML转储"到Word并控制数据,请查看docx;https://docx.js.org/#/

从他们的文档

以下是一个在Angular中工作的docx示例:https://stackblitz.com/edit/angular-afvxtz

您似乎想将Angular应用程序中的内容导出为MS Word文件

然后参考这个问题:使用Angular 2生成一个Docx文件,使用https://docx.js.org/#/

最新更新