refactor(ivy): update context discovery to prep for dir merge (#26262)

PR Close #26262
This commit is contained in:
Kara Erickson
2018-10-04 20:40:39 -07:00
committed by Jason Aden
parent 51dfdd5dd1
commit 8f25321787
6 changed files with 62 additions and 132 deletions

View File

@ -29,11 +29,11 @@ export function getOrCreatePlayerContext(target: {}, context?: LContext | null):
'Only elements that exist in an Angular application can be used for player access');
}
const {lViewData, lNodeIndex} = context;
const value = lViewData[lNodeIndex];
const {lViewData, nodeIndex} = context;
const value = lViewData[nodeIndex];
let stylingContext = value as StylingContext;
if (!Array.isArray(value)) {
stylingContext = lViewData[lNodeIndex] = createEmptyStylingContext(value as LElementNode);
stylingContext = lViewData[nodeIndex] = createEmptyStylingContext(value as LElementNode);
}
return stylingContext[StylingIndex.PlayerContext] || allocPlayerContext(stylingContext);
}