MCPcopy Create free account
hub / github.com/angular/components / mutateData

Function mutateData

src/cdk/table/table.spec.ts:1801–1814  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1799
1800 // Swap first two elements, remove the third, add new data
1801 function mutateData() {
1802 // Swap first and second data in data array
1803 const copiedData = component.dataSource.data.slice();
1804 const temp = copiedData[0];
1805 copiedData[0] = copiedData[1];
1806 copiedData[1] = temp;
1807
1808 // Remove the third element
1809 copiedData.splice(2, 1);
1810
1811 // Add new data
1812 component.dataSource.data = copiedData;
1813 component.dataSource.addData();
1814 }
1815
1816 it('should add/remove/move rows with reference-based trackBy', () => {
1817 createTestComponentWithTrackyByTable('reference');

Callers 1

table.spec.tsFile · 0.70

Calls 1

addDataMethod · 0.45

Tested by

no test coverage detected