MCPcopy Index your code
hub / github.com/angular/angular / attachPatchData

Function attachPatchData

packages/core/src/render3/context_discovery.ts:191–202  ·  view source on GitHub ↗
(target: any, data: LView | LContext)

Source from the content-addressed store, hash-verified

189 * directive or DOM node instance) using monkey-patching.
190 */
191export function attachPatchData(target: any, data: LView | LContext) {
192 ngDevMode && assertDefined(target, 'Target expected');
193 // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this
194 // for `LView`, because we have control over when an `LView` is created and destroyed, whereas
195 // we can't know when to remove an `LContext`.
196 if (isLView(data)) {
197 target[MONKEY_PATCH_KEY_NAME] = data[ID];
198 registerLView(data);
199 } else {
200 target[MONKEY_PATCH_KEY_NAME] = data;
201 }
202}
203
204/**
205 * Returns the monkey-patch value data present on the target (which could be

Callers 8

applyNodesFunction · 0.90
createComponentRefMethod · 0.90
applyMutableOpCodesFunction · 0.90
instantiateAllDirectivesFunction · 0.90
elementLikeStartSharedFunction · 0.90
templateCreateFunction · 0.90
getLContextFunction · 0.85

Calls 3

assertDefinedFunction · 0.90
isLViewFunction · 0.90
registerLViewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…