Skip to content

Commit b2fc55b

Browse files
committed
fix(core): use resolveRef in NgtParent
1 parent c71533e commit b2fc55b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

libs/core/src/lib/directives/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ export abstract class NgtCommonDirective<TValue> {
3131

3232
constructor() {
3333
effect(() => {
34-
const value = this.linkedValue();
3534
if (this.shouldSkipRender()) return;
3635

36+
const value = this.linkedValue();
37+
3738
if (is.equ(value, this.injectedValue)) {
3839
// we have the same value as before, no need to update
3940
return;

libs/core/src/lib/directives/parent.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from '../renderer/constants';
88
import { injectStore } from '../store';
99
import { NgtNullish } from '../types';
10+
import { resolveRef } from '../utils/resolve-ref';
1011
import { NgtCommonDirective } from './common';
1112

1213
@Directive({ selector: 'ng-template[parent]' })
@@ -30,11 +31,7 @@ export class NgtParent extends NgtCommonDirective<THREE.Object3D | null | undefi
3031
return scene.getObjectByName(rawParent);
3132
}
3233

33-
if ('nativeElement' in rawParent) {
34-
return rawParent.nativeElement;
35-
}
36-
37-
return rawParent;
34+
return resolveRef(rawParent);
3835
});
3936

4037
protected linkedValue = linkedSignal(this._parent);

0 commit comments

Comments
 (0)