Reputation: 788
I'm trying to setup up a simple Plnkr project with Angular and ThreeJS. I've got this so far - https://next.plnkr.co/edit/Jm4D2zgLtiKBGghC?preview
But as soon as I uncomment //var scene = new THREE.Scene();
on app.ts There is an error in the console. It's quite hard to understand the error, but I'm presuming it's simply I haven't imported the ThreeJS library correctly.
I've added in <script src=" https://unpkg.com/[email protected]/build/three.js"></script>
to the index.html, I'm not sure what else to do.
On my local environment all I had to do was to use npm three install
then I was able to import the lib correctly import * as THREE from 'three';
Upvotes: 0
Views: 45
Reputation: 214315
You should tell systemjs where to find three
package:
config.js
map: {
...
'three': 'npm:three'
},
Upvotes: 1