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?
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?
Share Improve this question asked Nov 5, 2016 at 14:46 passatgtpassatgt 4,4325 gold badges43 silver badges56 bronze badges2 Answers
Reset to default 16For me it works to import it this way in an Angular2 Component
import * as Papa from 'papaparse';
I just had to import papaparse before angular, now its working fine!