(moduleRef: NgModuleRef<TransplantedViewsModule>)
| 14 | import {DeclarationComponent, TransplantedViewsModule} from './transplanted_views'; |
| 15 | |
| 16 | export function init(moduleRef: NgModuleRef<TransplantedViewsModule>) { |
| 17 | const appRef: ApplicationRef = moduleRef.injector.get(ApplicationRef); |
| 18 | const declaration: DeclarationComponent = appRef.components[0].instance; |
| 19 | |
| 20 | bindAction('#destroyDom', destroyDom); |
| 21 | bindAction('#createDom', createDom); |
| 22 | bindAction('#markInsertionComponentForCheck', markInsertionComponentForCheck); |
| 23 | bindAction('#detectChanges', detectChanges); |
| 24 | bindAction('#detectChangesProfile', profile(detectChanges, noop, 'detectChanges')); |
| 25 | |
| 26 | // helpers |
| 27 | function destroyDom() { |
| 28 | declaration.viewCount = 0; |
| 29 | appRef.tick(); |
| 30 | declaration.templateRefreshCount = 0; |
| 31 | appRef.tick(); |
| 32 | } |
| 33 | |
| 34 | function createDom() { |
| 35 | declaration.viewCount = numViews; |
| 36 | appRef.tick(); |
| 37 | } |
| 38 | |
| 39 | function markInsertionComponentForCheck() { |
| 40 | declaration.insertionComponent.changeDetector.markForCheck(); |
| 41 | } |
| 42 | |
| 43 | function detectChanges() { |
| 44 | appRef.tick(); |
| 45 | } |
| 46 | |
| 47 | function noop() {} |
| 48 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…