I'm an angular 5 (and turfjs) noob trying to use the turfjs along().
I've got a pretty simple working angular 5 project (built with angular-cli).
To add turf I ran:
npm install @turf/along --save
and I see @turf/along in my node modules directory. I tried just adding to my js file:
declare var along: any;
but that didn't work. I also tried adding
"../node_modules/@turf/along/index.js"
to my angular-cli.json file, but no luck.
What is the correct way to import this method so I can use it?
Ok, (eventually) I discovered that I can just use
import along from '@turf/along';
No declarations or need to mess with other files (e.g. angular-cli.json) and I use it just as if it was defined locally.
If there is a more "TypeScript" way to do this, please drop a comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With