Skip to content

Commit b1d1006

Browse files
committed
fix(core): handle NgtAttachFunction for ngt-value as well
1 parent ca711d7 commit b1d1006

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

libs/core/src/lib/renderer/utils.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@ export function attachThreeChild(parent: NgtInstanceNode, child: NgtInstanceNode
6868
const attachProp = cLS.attach;
6969

7070
if (typeof attachProp === 'function') {
71-
const attachCleanUp = attachProp(parent, child, cLS.store);
71+
let attachCleanUp: ReturnType<typeof attachProp> | undefined = undefined;
72+
73+
if (cLS.isRaw) {
74+
if (cLS.instanceStore.get('parent') !== parent) {
75+
cLS.setParent(parent);
76+
}
77+
// at this point we don't have rawValue yet, so we bail and wait until the Renderer recalls attach
78+
if (child.__ngt_renderer__[NgtRendererClassId.rawValue] === undefined) return;
79+
attachCleanUp = attachProp(parent, child.__ngt_renderer__[NgtRendererClassId.rawValue], cLS.store);
80+
} else {
81+
attachCleanUp = attachProp(parent, child, cLS.store);
82+
}
83+
7284
if (attachCleanUp) cLS.previousAttach = attachCleanUp;
7385
} else {
7486
// we skip attach none if set explicitly

0 commit comments

Comments
 (0)