How to install?

Two steps installation:

  1. The first step is buying and downloading the spreadsheet-validator-lib.zip
  2. Move this file inside your angular project, and then execute `npm install dist/xlsx-lib`. This will install the Spreadsheet Validator library into your own project.

Otherwise, you can install with NPM INSTALL it using privjs

If you are not sure how to use the component, try download this demo project as if it was your own project https://github.com/robherman/spreadsheet-validator-demo and install it using step 2)

This is a public proyect that validates any spreadsheet using the component. You may also try it this demo project online in https://demo.import-javascript-angular-xlsx-csv-validator.com/

How to use the library?

  1. Simply add the XlsxLibModule to your main app module as follows:

Example:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { XlsxLibModule } from 'xlsx-lib';

@NgModule({
  declarations: [
    AppComponent
    
  ],
  imports: [
    BrowserModule,
    XlsxLibModule,
    CommonModule,
    FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
  1. Add the library’s Validator service to the constructor of the class you want to use the library in:
constructor(public xlsxLibService: XlsxLibService) {

}
  1. Execute the loadAndValidate function to validate an input file according to the provided settings:
this.xlsxLibService.loadAndValidate(this.file, xlsxSettings).subscribe(result => {
      console.log(result);
});