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

Function init

modules/benchmarks/src/tree/ng2_switch/init.ts:16–42  ·  view source on GitHub ↗
(moduleRef: NgModuleRef<AppModule>)

Source from the content-addressed store, hash-verified

14import {AppModule, TreeComponent} from './tree';
15
16export 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}

Callers

nothing calls this directly

Calls 4

initTreeUtilsFunction · 0.90
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…