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

Function init

modules/benchmarks/src/change_detection/transplanted_views/init.ts:16–48  ·  view source on GitHub ↗
(moduleRef: NgModuleRef<TransplantedViewsModule>)

Source from the content-addressed store, hash-verified

14import {DeclarationComponent, TransplantedViewsModule} from './transplanted_views';
15
16export 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}

Callers

nothing calls this directly

Calls 3

bindActionFunction · 0.90
profileFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…