How to integrate aframe to my project ANGULAR-CLI?

2019-05-13 21:23发布

问题:

Hello try integrating aframe in the following way:

  1. npm install aframe --save

  2. setup the angular-cli.json

    "scripts": ["../node_modules/aframe/dist/aframe-master.js"]
    
  3. Download the typings from https://github.com/devpaul/aframe-typings/blob/master/src/AFRAME.d.ts

  4. setup the tsconfig.json

    "files":["typings/AFRAME.d.ts"]
    

And I get the following error: Cannot find namespace 'THREE'

回答1:

In src/polyfills.ts you can import 'aframe'; before you import 'zone.js/dist/zone'