MCPcopy
hub / github.com/angular/angular / collectPropertyBindings

Function collectPropertyBindings

packages/core/src/debug/debug_node.ts:689–714  ·  view source on GitHub ↗

* Iterates through the property bindings for a given node and generates * a map of property names to values. This map only contains property bindings * defined in templates, not in host bindings.

(
  properties: {[key: string]: string},
  tNode: TNode,
  lView: LView,
  tData: TData,
)

Source from the content-addressed store, hash-verified

687 * defined in templates, not in host bindings.
688 */
689function collectPropertyBindings(
690 properties: {[key: string]: string},
691 tNode: TNode,
692 lView: LView,
693 tData: TData,
694): void {
695 let bindingIndexes = tNode.propertyBindings;
696
697 if (bindingIndexes !== null) {
698 for (let i = 0; i < bindingIndexes.length; i++) {
699 const bindingIndex = bindingIndexes[i];
700 const propMetadata = tData[bindingIndex] as string;
701 const metadataParts = propMetadata.split(INTERPOLATION_DELIMITER);
702 const propertyName = metadataParts[0];
703 if (metadataParts.length > 1) {
704 let value = metadataParts[1];
705 for (let j = 1; j < metadataParts.length - 1; j++) {
706 value += renderStringify(lView[bindingIndex + j - 1]) + metadataParts[j + 1];
707 }
708 properties[propertyName] = value;
709 } else {
710 properties[propertyName] = lView[bindingIndex];
711 }
712 }
713 }
714}
715
716// Need to keep the nodes in a global Map so that multiple angular apps are supported.
717const _nativeNodeToDebugNode = new Map<any, DebugNode>();

Callers 1

propertiesMethod · 0.85

Calls 1

renderStringifyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…