4

iam trying to implement a download button in my Angular 2 application. I have used these tutorials: http://alferov.github.io/angular-file-saver/ https://coryrylan.com/blog/angular-2-cli-adding-third-party-libraries

So i installed file-saver by: npm install angular-file-saver

But import FileSaver from 'file-saver'; or import FileSaver from 'angular-file-saver'; doesnt work.

Error: Cannot find module 'file-saver'.

How do i get this working?

Thank you

Simon
  • 925
  • 3
  • 13
  • 30

1 Answers1

14

http://alferov.github.io/angular-file-saver/ is a AngularJS service so it won't work for Angular2.

Refer to the one of the many SO questions already answered

Community
  • 1
  • 1
Julien Jacobs
  • 2,561
  • 1
  • 24
  • 34