Standalone Angular component for csvbox.io supporting Angular version 14 till 20
npm install @csvbox/angular2bash
npm install @csvbox/angular2
`
Import
Add CSVBoxButtonComponent to your module imports
`ts
import { CSVBoxButtonComponent } from "@csvbox/angular2";
@NgModule({
...
imports: [
...
CSVBoxButtonComponent
]
})
`
Usage
`html
Import
`
Example
`ts
@Component({
selector: 'app-root',
template:
})
export class AppComponent {
title = 'example';
licenseKey = 'YOUR_LICENSE_KEY_HERE';
user = { user_id: 'default123' };
isImported(result: boolean, data: any) {
if(result) {
console.log("Sheet uploaded successfully");
console.log(data.row_success + " rows uploaded");
}else{
console.log("There was some problem uploading the sheet");
}
}
}
`
Events
| Event | Description |
| :---------- | :-------------------------------------------------------------------------|
| isReady | Triggers when the importer is initialized and ready for use by the users. |
| isClosed | Triggers when the importer is closed. |
| isSubmitted | Triggers when the user hits the 'Submit' button to upload the validated file. data object is available in this event. It contains metadata related to the import.|
| isImported` | Triggers when the data is pushed to the destination.