(appRef: ApplicationRef)
| 89 | ]; |
| 90 | |
| 91 | export 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…