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

Function mutateData

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

Source from the content-addressed store, hash-verified

1758
1759 // Swap first two elements, remove the third, add new data
1760 function mutateData() {
1761 // Swap first and second data in data array
1762 const copiedData = component.dataSource.data.slice();
1763 const temp = copiedData[0];
1764 copiedData[0] = copiedData[1];
1765 copiedData[1] = temp;
1766
1767 // Remove the third element
1768 copiedData.splice(2, 1);
1769
1770 // Add new data
1771 component.dataSource.data = copiedData;
1772 component.dataSource.addData();
1773 }
1774
1775 it('should add/remove/move rows with reference-based trackBy', () => {
1776 createTestComponentWithTrackyByTable('reference');

Callers 1

table.spec.tsFile · 0.70

Calls 1

addDataMethod · 0.45

Tested by

no test coverage detected