Issues migrating from @angular-three to angular-three
IRobot1 opened this issue · 3 comments
IRobot1 commented
Missing with no obvious replacement
NgtTriple -
position = [0, 0, 0] as NgtTriple`
Radian Pipe -
item.rotation | radian
Ready Event -
(ready)="meshready($event)"
Value of local variable -instance is no
<ngt-mesh #inst (click)="click(inst.instance.value)" >
No documentation for
NgtLoader
constructor(private loader: NgtLoader) { }
const s = this.loader.use(TextureLoader, newvalue).subscribe(next => {
this.texture = next;
},
() => { },
() => { s.unsubscribe(); }
);
IRobot1 commented
<ngt-color attach="background" color="gray"></ngt-color>
migrates to
<ngt-color attach="background" *args="['gray']"></ngt-color>
IRobot1 commented
I used to be able to do this
<ngt-mesh #inst (click)="this.panelSelected.next(inst.instance.value)">
Looks like inst variable is now an NgtMesh which is extends Mesh. I can't do this, because I get a compile error
TS2345: Argument of type 'NgtMesh' is not assignable to parameter of type 'Object3D'.
<ngt-mesh #inst (click)="this.panelSelected.next(inst)">
Also, I can't do this either, due to a different compile error
<ngt-mesh #inst (click)="this.panelSelected.next(<Object3D><unknown>inst)">
I'm forced to create a function just to handle the type conversion
<ngt-mesh #inst (click)="doclick(inst)">
@Output() panelSelected = new EventEmitter<Object3D>();
doclick(mesh: NgtMesh) {
this.panelSelected.emit(<Object3D><unknown>mesh)
}
Is there a better way to handle this?