7

I'm trying to import PapaParse and use it inside a controller. This is what i tried so far:

import Papa from 'papaparse';
//import 'papaparse'; (tried it like this also)

angular.module('app').constant('Papa', window.Papa);

I think this is the right way to do it, but window.Papa is already undefined. What am i doing wrong?

passatgt
  • 4,234
  • 4
  • 40
  • 54

2 Answers2

16

For me it works to import it this way in an Angular2 Component

import * as Papa from 'papaparse';

c_froehlich
  • 1,305
  • 11
  • 13
1

I just had to import papaparse before angular, now its working fine!

passatgt
  • 4,234
  • 4
  • 40
  • 54