fixup! refactor(ivy): simplify context discover based on feedback (#28101)
PR Close #28101
This commit is contained in:
parent
b6510a320b
commit
60fecc1284
|
@ -300,14 +300,9 @@ export function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: strin
|
||||||
if (tNode && tNode.localNames) {
|
if (tNode && tNode.localNames) {
|
||||||
const result: {[key: string]: any} = {};
|
const result: {[key: string]: any} = {};
|
||||||
let localIndex = tNode.index + 1;
|
let localIndex = tNode.index + 1;
|
||||||
for (let i = 0; i < tNode.localNames.length; i += 2, localIndex++) {
|
for (let i = 0; i < tNode.localNames.length; i += 2) {
|
||||||
const localRefName = tNode.localNames[i];
|
result[tNode.localNames[i]] = lView[localIndex];
|
||||||
const directiveIndex = tNode.localNames[i + 1] as number;
|
localIndex++;
|
||||||
if (directiveIndex === -1) {
|
|
||||||
result[localRefName] = lView[localIndex] || getNativeByTNode(tNode, lView);
|
|
||||||
} else {
|
|
||||||
result[localRefName] = lView[directiveIndex];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue