【发布时间】:2017-07-07 13:04:48
【问题描述】:
对于我的 Ionic 2 应用,我使用了 three.js 和 three.js 的 PLYLoader 扩展(可在此处找到:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PLYLoader.js)
我可以很好地导入三个.js,只要把它放在我的index.html:
<script src="three.js"> </script>
然后在相关的 TypeScript 文件中:
import * as THREE from '../../three.js';
所以我正在尝试用 PLYLoader 做同样的事情:
<script src="PLYLoader.js"> </script>
和
import * as PLYLoader from '../../PLYLoader.js';
但是每当我加载页面时,我都会收到以下错误:
ionViewDidLoad error: __WEBPACK_IMPORTED_MODULE_2__three_js__.PLYLoader is not a constructor
Ionic/Angular 显然能够找到该文件,但由于某种原因,TypeScript 没有正确解释 JavaScript 类。有没有合理的解决办法?
【问题讨论】:
-
嗨,迈克,我遇到了同样的问题。你的问题解决了吗?
标签: javascript angular typescript ionic2