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

Method addData

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

Source from the content-addressed store, hash-verified

1607 }
1608
1609 addData(level: number = 1): TestData {
1610 const nextIndex = ++this.dataIndex;
1611
1612 let copiedData = this.data.slice();
1613 const newData = new TestData(
1614 `topping_${nextIndex}`,
1615 `cheese_${nextIndex}`,
1616 `base_${nextIndex}`,
1617 level,
1618 );
1619 copiedData.push(newData);
1620
1621 this.data = copiedData;
1622
1623 return newData;
1624 }
1625
1626 getRecursiveData(nodes: TestData[] = this._dataChange.getValue()): TestData[] {
1627 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