(target: any, data: LView | LContext)
| 173 | * directive or DOM node instance) using monkey-patching. |
| 174 | */ |
| 175 | export 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 |
no test coverage detected