MCPcopy Index your code
hub / github.com/angular/angular / init

Function init

modules/benchmarks/src/js-web-frameworks/ng2/init.ts:91–133  ·  view source on GitHub ↗
(appRef: ApplicationRef)

Source from the content-addressed store, hash-verified

89];
90
91export function init(appRef: ApplicationRef) {
92 let component: JsWebFrameworksComponent;
93
94 function create1K() {
95 component.data = buildData(1 * 1000);
96 appRef.tick();
97 }
98
99 function create10K() {
100 component.data = buildData(10 * 1000);
101 appRef.tick();
102 }
103
104 function deleteAll() {
105 component.data = [];
106 appRef.tick();
107 }
108
109 function update() {
110 for (let i = 0; i < component.data.length; i += 10) {
111 component.data[i].label += ' !!!';
112 }
113 appRef.tick();
114 }
115
116 function swapRows() {
117 const data = component.data;
118 if (data.length > 998) {
119 const a = data[1];
120 data[1] = data[998];
121 data[998] = a;
122 }
123 appRef.tick();
124 }
125
126 component = appRef.components[0].instance;
127
128 bindAction('#create1KRows', create1K);
129 bindAction('#create10KRows', create10K);
130 bindAction('#deleteAll', deleteAll);
131 bindAction('#update', update);
132 bindAction('#swap', swapRows);
133}

Callers

nothing calls this directly

Calls 1

bindActionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…