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

Function mutateChildren

src/cdk/tree/tree.spec.ts:1117–1131  ·  view source on GitHub ↗
(parent: TestData)

Source from the content-addressed store, hash-verified

1115 }
1116
1117 function mutateChildren(parent: TestData) {
1118 // Swap first and second data in data array
1119 const copiedData = parent.children.slice();
1120 const temp = copiedData[0];
1121 copiedData[0] = copiedData[1];
1122 copiedData[1] = temp;
1123
1124 // Remove the third element
1125 copiedData.splice(2, 1);
1126
1127 // Add new data
1128 parent.children = copiedData;
1129 parent.observableChildren.next(copiedData);
1130 component.dataSource.addChild(parent, false);
1131 }
1132
1133 it('should add/remove/move children nodes with reference-based trackBy', () => {
1134 createTrackByTestComponent('reference');

Callers 1

tree.spec.tsFile · 0.70

Calls 2

nextMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…