CSVJetty

Docs

Home
Dashboard

Get started

Angular

Receive data

Get started

Angular CSV importer

Add CSV imports to Angular with a standalone component, validation, inline corrections and callback delivery.

View as Markdown

On this page

InstallReceive imported recordsConfiguration and lifecycle

Add the hosted CSVJetty importer to Angular 20–22 with a standalone component. The Angular package uses the JavaScript SDK and has no React dependency.

Install

BASH

npm install @csvjetty/angular

Receive imported records

Create an importer in the dashboard and use its public importer key. This example displays records in memory. Replace the callback with your authenticated API call to save records.

TYPESCRIPT

import { Component, signal } from '@angular/core';import { CSVJettyComponent, DataHandler } from '@csvjetty/angular';
@Component({  selector: 'app-contact-import', standalone: true,  imports: [CSVJettyComponent],  template: `    <csvjetty-importer importerKey="YOUR_PUBLIC_IMPORTER_KEY"      [onData]="receiveData">Import contacts</csvjetty-importer>    <pre>{{ records() }}</pre>  `,})export class ContactImportComponent {  readonly records = signal('[]');  readonly receiveData: DataHandler = ({ rows }) => {    this.records.set(JSON.stringify(rows, null, 2));  };}

Bind onData as a function input. It may return a promise. Return nothing for success, return row errors for individual failures, or throw to report a failed save. Use an arrow function to preserve your component context.

Callback payload and row errors

Configuration and lifecycle

Inputs include importerKey, demo, columns, onData, autoOpen, disabled, accentColor, baseUrl and previewToken. Set demo to true instead of importerKey for the built-in contacts demo. Outputs are complete, closed and openError. Webhook delivery is configured in the dashboard.

A template ref exposes open(), close(), isOpen() and error(). Close respects busy state and asks before discarding unsaved changes. Destroying the component removes the importer without cancelling a save already running in your app. Server initialization does not open the importer.