Can't import A-frame into component - Angular2

这一生的挚爱 提交于 2019-11-29 15:38:09
Ben Richards

Here is what you have to get it properly working in Angular2:

  1. Edit your angular-cli.json and add the path to the scripts node:
"scripts": [
  "node_modules/aframe/dist/aframe-master.js"
],
  1. Download the typings from https://github.com/devpaul/aframe-typings/blob/master/src/AFRAME.d.ts.

  2. Reference the typings in your component with:

/// <reference path="../typings/AFRAME.d.ts" />

or install the typings globally in your tsconfig.json:

"files": [
    "typings/AFRAME.d.ts"
  ]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!