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

Function registerPreOrderHooks

packages/core/src/render3/hooks.ts:53–77  ·  view source on GitHub ↗
(
  directiveIndex: number,
  directiveDef: DirectiveDef<any>,
  tView: TView,
)

Source from the content-addressed store, hash-verified

51 * @param tView The current TView
52 */
53export function registerPreOrderHooks(
54 directiveIndex: number,
55 directiveDef: DirectiveDef<any>,
56 tView: TView,
57): void {
58 ngDevMode && assertFirstCreatePass(tView);
59 const {ngOnChanges, ngOnInit, ngDoCheck} = directiveDef.type.prototype as OnChanges &
60 OnInit &
61 DoCheck;
62
63 if (ngOnChanges as Function | undefined) {
64 const wrappedOnChanges = getNgOnChangesFeatureImpl()(directiveDef);
65 (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);
66 (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);
67 }
68
69 if (ngOnInit) {
70 (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);
71 }
72
73 if (ngDoCheck) {
74 (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);
75 (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);
76 }
77}
78
79/**
80 *

Callers 1

getNodeInjectableFunction · 0.90

Calls 3

assertFirstCreatePassFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…