我安装了A-Frame https://github.com/aframevr/aframe by
npm install aframe --save.
当我使用时:
import 'aframe'; // or use: require 'aframe';
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: `
<a-scene></a-scene>
`
})
export class AppComponent {}
我收到错误:
zone.js:1046Uncaught TypeError: 无法分配给只读属性
对象“#”的“detachedCallback”
我检查了这个Angular_VR演示 https://github.com/brakmic/Angular_VRDemo,但自己还是没搞清楚。
我猜是因为aframe
库没有实现某些属性(例如detachedCallback
和其他)通过创建自定义元素。https://github.com/aframevr/aframe/blob/v0.3.1/src/core/a-assets.js#L13-L73 https://github.com/aframevr/aframe/blob/v0.3.1/src/core/a-assets.js#L13-L73
zone js 已覆盖版本document.registerElement
需要所有属性,因此它会破坏库加载(https://github.com/angular/zone.js/blob/v0.6.17/dist/zone.js#L1151-L1170 https://github.com/angular/zone.js/blob/v0.6.17/dist/zone.js#L1151-L1170).
作为解决方法,您可以在 zonejs 之前加载此库
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)