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

Method addData

src/cdk/tree/tree.spec.ts:1598–1613  ·  view source on GitHub ↗
(level: number = 1)

Source from the content-addressed store, hash-verified

1596 }
1597
1598 addData(level: number = 1): TestData {
1599 const nextIndex = ++this.dataIndex;
1600
1601 let copiedData = this.data.slice();
1602 const newData = new TestData(
1603 `topping_${nextIndex}`,
1604 `cheese_${nextIndex}`,
1605 `base_${nextIndex}`,
1606 level,
1607 );
1608 copiedData.push(newData);
1609
1610 this.data = copiedData;
1611
1612 return newData;
1613 }
1614
1615 getRecursiveData(nodes: TestData[] = this._dataChange.getValue()): TestData[] {
1616 return [

Callers 3

constructorMethod · 0.95
tree.spec.tsFile · 0.45
mutateDataFunction · 0.45

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected