MCPcopy Index your code
hub / github.com/angular/components / transferData

Function transferData

src/cdk/drag-drop/dom/clone-node.ts:34–49  ·  view source on GitHub ↗

Matches elements between an element and its clone and allows for their data to be cloned.

(
  selector: string,
  node: HTMLElement,
  clone: HTMLElement,
  callback: (source: T, clone: T) => void,
)

Source from the content-addressed store, hash-verified

32
33/** Matches elements between an element and its clone and allows for their data to be cloned. */
34function transferData<T extends Element>(
35 selector: string,
36 node: HTMLElement,
37 clone: HTMLElement,
38 callback: (source: T, clone: T) => void,
39) {
40 const descendantElements = node.querySelectorAll<T>(selector);
41
42 if (descendantElements.length) {
43 const cloneElements = clone.querySelectorAll<T>(selector);
44
45 for (let i = 0; i < descendantElements.length; i++) {
46 callback(descendantElements[i], cloneElements[i]);
47 }
48 }
49}
50
51// Counter for unique cloned radio button names.
52let cloneUniqueId = 0;

Callers 1

deepCloneNodeFunction · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…