I am working on moving the angular 1.x site to the new angular 2.0 site that I created on the site using angular-cli 1.0.0-beta.15.
I have a button for exporting some data to a CSV file. When the first page loads, I get the error message "Unable to find the module's file-keeper", but when I click the button, everything works fine.
I have the FileSaver.js component installed:
package.json
... "dependencies": { ... "@types/filesaver": "0.0.30", "file-saver": "^1.3.2" ... } ...
in my export.service.ts:
import { saveAs } from 'file-saver'; ... let file = new Blob(['hello world'], { type: 'text/csv;charset=utf-8' }); saveAs(file, 'helloworld.csv'); ...
Does anyone know how to solve this error?
angular typescript
gamelover42
source share