MCPcopy Create free account
hub / github.com/angular/angular / attachPatchData

Function attachPatchData

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

Source from the content-addressed store, hash-verified

173 * directive or DOM node instance) using monkey-patching.
174 */
175export function attachPatchData(target: any, data: LView | LContext) {
176 ngDevMode && assertDefined(target, 'Target expected');
177 // Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this
178 // for `LView`, because we have control over when an `LView` is created and destroyed, whereas
179 // we can't know when to remove an `LContext`.
180 if (isLView(data)) {
181 target[MONKEY_PATCH_KEY_NAME] = data[ID];
182 registerLView(data);
183 } else {
184 target[MONKEY_PATCH_KEY_NAME] = data;
185 }
186}
187
188/**
189 * Returns the monkey-patch value data present on the target (which could be

Callers 9

applyNodesFunction · 0.90
createComponentRefMethod · 0.90
applyMutableOpCodesFunction · 0.90
instantiateAllDirectivesFunction · 0.90
elementLikeStartSharedFunction · 0.90
ɵɵforeignComponentFunction · 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