(lView: LView, tNode: TNode, attrName: string, value: any)
| 325 | } |
| 326 | |
| 327 | function setNgReflectProperty(lView: LView, tNode: TNode, attrName: string, value: any) { |
| 328 | const environment = lView[ENVIRONMENT]; |
| 329 | if (!environment.ngReflect) { |
| 330 | return; |
| 331 | } |
| 332 | const element = getNativeByTNode(tNode, lView) as RElement | RComment; |
| 333 | const renderer = lView[RENDERER]; |
| 334 | attrName = normalizeDebugBindingName(attrName); |
| 335 | const debugValue = normalizeDebugBindingValue(value); |
| 336 | if (tNode.type & TNodeType.AnyRNode) { |
| 337 | if (value == null) { |
| 338 | renderer.removeAttribute(element as RElement, attrName); |
| 339 | } else { |
| 340 | renderer.setAttribute(element as RElement, attrName, debugValue); |
| 341 | } |
| 342 | } else { |
| 343 | const textContent = escapeCommentText( |
| 344 | `bindings=${JSON.stringify({[attrName]: debugValue}, null, 2)}`, |
| 345 | ); |
| 346 | renderer.setValue(element as RComment, textContent); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | export function setNgReflectProperties( |
| 351 | lView: LView, |
no test coverage detected
searching dependent graphs…