Search code examples
htmlexcelangulartabular

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.


Solution

  • I am using ngx-editor because its very easy to implement and its UI is better

    install via npm

    npm install ngx-editor --save
    

    Import ngx-editor module

    import { NgxEditorModule } from 'ngx-editor';
     
    @NgModule({
      imports: [ NgxEditorModule ]
    })
    

    Then in html

    <app-ngx-editor [placeholder]="'Enter text here...'" [spellcheck]="true" [(ngModel)]="htmlContent"></app-ngx-editor>
    

    by default its height is not set correctly but you can set min-height like this minHeight="250px"

    If you are getting error make sure you have imported FormsModule as module

    Make sure HttpClientModule is also installed and imported