Migrating ng-csv / export helpers to modern Angular
ng-csv added a directive that turned an array into a downloadable CSV file from a button. It is tied to AngularJS.
What replaces it
| Option | When to choose it |
|---|---|
| A small export function with Blob | CSV needs no library: build the text, create a Blob and trigger a download. |
| PapaParse | When you also parse CSV, or want quoting and escaping handled by a tested library. |
| SheetJS or server-side export | For real .xlsx files; install SheetJS as its documentation says, because the copy on the npm registry is old, or generate large files on the server. |
How to migrate it
- List every export: columns, headers, separator, date and number formats, and file name.
- Write one ExportService with a typed column definition and reuse it from every table.
- Compare the new files with the old ones in the spreadsheet program your users actually use.
Watch out. Add a UTF-8 byte order mark so Excel shows accented characters correctly, and escape cells that start with =, +, - or @ to avoid formula injection.
Other libraries
- angular-socket-io / WebSocket services
- angular-permission
- angular-xeditable
- angular-bootstrap-datetimepicker / ui-date
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn