How to import PapaParse with Browserify to inject into a controller?
Asked Answered
A

2

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?

Aminopyrine answered 5/11, 2016 at 14:46 Comment(0)
T
16

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

import * as Papa from 'papaparse';

Thermoplastic answered 2/2, 2017 at 15:8 Comment(0)
A
1

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

Aminopyrine answered 5/11, 2016 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.