I am trying to use three examples in my angular (cli) 2 application.
So, I installed threejs:
npm install three
then typings are added:
npm install @types/three --save-dev
Finally, my component looks like this:
import { Component, OnInit } from '@angular/core'; import * as THREE from 'three'; @Component({ selector: 'app-testthreejs', templateUrl: './testthreejs.component.html', styleUrls: ['./testthreejs.component.css'] }) export class TestthreejsComponent implements OnInit { // }
With this, I can easily use some functions from THREE.
I would like to use the part of the example available in node_modules / three / examples / js /, more specifically OrbitControl. Typics give me autocomplete in visual studio code: 
But as soon as I tried to use it, I have the following error:
TypeError: WEBPACK_IMPORTED_MODULE_1_three .OrbitControls is not a constructor
Is there a way to make OrbitControls (and other examples) available through some import? Should I just include control.js in my html?
What is the best way to handle this?
grunk source share