(moduleRef: NgModuleRef<AppModule>)
| 14 | import {AppModule, TreeComponent} from './tree'; |
| 15 | |
| 16 | export function init(moduleRef: NgModuleRef<AppModule>) { |
| 17 | let tree: TreeComponent; |
| 18 | let appRef: ApplicationRef; |
| 19 | |
| 20 | function destroyDom() { |
| 21 | tree.data = emptyTree; |
| 22 | appRef.tick(); |
| 23 | } |
| 24 | |
| 25 | function createDom() { |
| 26 | tree.data = buildTree(); |
| 27 | appRef.tick(); |
| 28 | } |
| 29 | |
| 30 | function noop() {} |
| 31 | |
| 32 | const injector = moduleRef.injector; |
| 33 | appRef = injector.get(ApplicationRef); |
| 34 | tree = appRef.components[0].instance; |
| 35 | |
| 36 | initTreeUtils(); |
| 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…