-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'getOrCreateGeometry' of undefined #1965
Comments
@ngokevin can u copy your explaination from Stack Overflow to here. Here I can @ someone who may offer help. |
|
I had the same problem (but I'm using Meteor + React + aframe 0.3.1). I solved it by waiting scene to load before adding content into scene. This is how I check if scene is loaded:
Try to make setInterval or something. |
@perak thanks, After changing to the codes below, it won't give error for me. I will ask around see if a there is a clean solution. http://plnkr.co/edit/69TJZhkZUsG6aiNObsed?p=preview <a-scene>
<a-curvedimage
*ngIf="show"
src="https://upload.wikimedia.org/wikipedia/commons/b/be/Random_pyramids.jpg"
position="0 2 -20"
theta-length="72"
height="2.6">
</a-curvedimage>
</a-scene> show = false;
ngOnInit() {
// not loaded
setTimeout(() => {
// loaded
this.show = true;
});
} |
There's an event. Or attach your Angular init code in an A-Frame component |
@ngokevin thanks for reminding the <a-scene (loaded)="onLoaded()">
<a-curvedimage
*ngIf="show"
src="https://upload.wikimedia.org/wikipedia/commons/b/be/Random_pyramids.jpg"
position="0 2 -20"
theta-length="72"
height="2.6">
</a-curvedimage>
</a-scene> show = false;
onLoaded() {
this.show = true;
} I guess this will be the final way. http://plnkr.co/edit/MkQkrneTXYcZ1w6YFoLm?p=preview |
alternatively: AFRAME.registerComponent('angular-init', {
init: onLoaded
}); <a-scene angular-init>
...
</a-scene> |
Description:
Orginally asked on Stack Overflow
I am using A-Frame with Angular 2.
The code is simple, showing a curved image:
Without Angular 2 router, it works well: working plunker
After adding Angular 2 router, I got the error below. issue plunker
And I found if I remove these two
theta-length="72" height="2.6"
in the issue plunker, it won't through the error.I want to use
theta-length="72" height="2.6"
and the router together. What may cause this? ThanksThe text was updated successfully, but these errors were encountered: