nartc / angular-three

🧊 THREE.js integration for Angular 🧊
https://angular-three.netlify.app/
MIT License
305 stars 23 forks source link

[V5 beta] No directive found with exportAs 'ngtPlaneGeometry'. #91

Closed IRobot1 closed 2 years ago

IRobot1 commented 2 years ago

Using V5 beta, error NG8003: No directive found with exportAs 'ngtPlaneGeometry'.

     <ngt-plane-geometry #plane="ngtPlaneGeometry"

There are may other examples where variable type like ngtPlaneGeometry is no longer available.

IRobot1 commented 2 years ago

Here's other examples,

<ngt-instanced-mesh #inst="ngtInstancedMesh" (ready)="ready(inst.mesh)"
<ngt-mesh #drag="ngtMesh" (ready)="cubeready(drag.mesh)"
nartc commented 2 years ago

All NGT classes are now Component rather than Directive, exportAs isn't needed anymore.

IRobot1 commented 2 years ago

Can you show how the above examples should now work? The following used to work, but I'm not sure how to make it work now.

    <ngt-plane-geometry #plane="ngtPlaneGeometry"></ngt-plane-geometry>
    <ngt-mesh-standard-material #standard="ngtMeshStandardMaterial"></ngt-mesh-standard-material>
    <ngt-mesh [geometry]="plane.geometry" [material]="standard.material"></ngt-mesh>

If I change to this, I get the following error Property 'geometry' does not exist on type 'NgtPlaneGeometry'.

    <ngt-plane-geometry #plane></ngt-plane-geometry>
    <ngt-mesh-standard-material #standard></ngt-mesh-standard-material>
    <ngt-mesh [geometry]="plane.geometry" [material]="standard.material"></ngt-mesh>
nartc commented 2 years ago
<ngt-plane-geometry #plane></ngt-plane-geometry>
<ngt-mesh-standard-material #standard></ngt-mesh-standard-material>

<ngt-mesh [geometry]="plane.instance" [material]="standard.instance"></ngt-mesh>
nartc commented 2 years ago
image

I was just working on that section of the migration guide so I use this example as well.