html - How can I paste Excel and MS Word table and edit it on website in Angular
问题描述
Here is what I am trying to achieve:
A user can copy table from Excel/MS-Word and then paste it to my angular website which he/she can then save it to server as well.
How Can I achieve this? Any suggestions will be appreciated.
解决方案
我正在使用ngx-editor因为它很容易实现并且它的 UI 更好
通过 npm 安装
npm install ngx-editor --save
导入ngx-editor
模块
import { NgxEditorModule } from 'ngx-editor';
@NgModule({
imports: [ NgxEditorModule ]
})
然后在html中
<app-ngx-editor [placeholder]="'Enter text here...'" [spellcheck]="true" [(ngModel)]="htmlContent"></app-ngx-editor>
默认情况下,它的高度未正确设置,但您可以像这样设置 min-heightminHeight="250px"
如果您遇到错误,请确保您已
FormsModule
作为模块导入确保
HttpClientModule
也安装并导入
推荐阅读
- python - ImportError:没有名为 sysconfig 的模块--无法使 pip 工作
- html - 如何使用 vue.draggable 拖动多行?
- ios - '不安全指针
' 不能转换为 'UnsafePointer<_>' - c++ - 如何知道 std::string 是否编码正确?
- android - if 和 return 语句
- javascript - 使用其他表单字段上传表单
- ruby-on-rails - 使用 Ruby 和 GraphQL 解决 NameError 问题:未初始化的常量 UserMutations?
- postgresql - 在 PL/pgSQL 函数内的动态命令中使用数组
- python - Keras LSTM:时间序列多步多特征预测 - 结果不佳
- angular - 如何防止从这个 angular6 rxjs 6 泄漏