(moduleRef: NgModuleRef<AppModule>)
| 14 | import {AppModule, TableComponent} from './table'; |
| 15 | |
| 16 | export function init(moduleRef: NgModuleRef<AppModule>) { |
| 17 | let table: TableComponent; |
| 18 | let appRef: ApplicationRef; |
| 19 | |
| 20 | function destroyDom() { |
| 21 | table.data = emptyTable; |
| 22 | appRef.tick(); |
| 23 | } |
| 24 | |
| 25 | function createDom() { |
| 26 | table.data = buildTable(); |
| 27 | appRef.tick(); |
| 28 | } |
| 29 | |
| 30 | function noop() {} |
| 31 | |
| 32 | const injector = moduleRef.injector; |
| 33 | appRef = injector.get(ApplicationRef); |
| 34 | table = appRef.components[0].instance; |
| 35 | |
| 36 | initTableUtils(); |
| 37 | |
| 38 | bindAction('#destroyDom', destroyDom); |
| 39 | bindAction('#createDom', createDom); |
| 40 | bindAction('#updateDomProfile', profile(createDom, noop, 'update')); |
| 41 | bindAction('#createDomProfile', profile(createDom, destroyDom, 'create')); |
| 42 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…