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

Function directiveHostFirstCreatePass

packages/core/src/render3/view/elements.ts:26–70  ·  view source on GitHub ↗
(
  index: number,
  lView: LView,
  type: TNodeType.Element | TNodeType.ElementContainer,
  name: string,
  directiveMatcher: DirectiveMatcherStrategy,
  bindingsEnabled: boolean,
  attrsIndex?: number | null,
  localRefsIndex?: number,
)

Source from the content-addressed store, hash-verified

24import {resolveDirectives, type DirectiveMatcherStrategy} from './directives';
25
26export function directiveHostFirstCreatePass(
27 index: number,
28 lView: LView,
29 type: TNodeType.Element | TNodeType.ElementContainer,
30 name: string,
31 directiveMatcher: DirectiveMatcherStrategy,
32 bindingsEnabled: boolean,
33 attrsIndex?: number | null,
34 localRefsIndex?: number,
35): TElementNode | TElementContainerNode {
36 const tView = lView[TVIEW];
37 ngDevMode && assertFirstCreatePass(tView);
38 const tViewConsts = tView.consts;
39 const attrs = getConstant<TAttributes>(tViewConsts, attrsIndex);
40 const tNode = getOrCreateTNode(tView, index, type, name, attrs) as
41 | TElementNode
42 | TElementContainerNode;
43
44 if (bindingsEnabled) {
45 resolveDirectives(
46 tView,
47 lView,
48 tNode,
49 getConstant<string[]>(tViewConsts, localRefsIndex),
50 directiveMatcher,
51 );
52 }
53
54 // Merge the template attrs last so that they have the highest priority.
55 tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);
56
57 if (tNode.attrs !== null) {
58 computeStaticStyling(tNode, tNode.attrs, false);
59 }
60
61 if (tNode.mergedAttrs !== null) {
62 computeStaticStyling(tNode, tNode.mergedAttrs, true);
63 }
64
65 if (tView.queries !== null) {
66 tView.queries.elementStart(tView, tNode);
67 }
68
69 return tNode;
70}
71
72export function directiveHostEndFirstCreatePass(tView: TView, tNode: TNode) {
73 ngDevMode && assertFirstCreatePass(tView);

Callers 3

createComponentRefMethod · 0.90
ɵɵelementStartFunction · 0.90

Calls 7

assertFirstCreatePassFunction · 0.90
getConstantFunction · 0.90
getOrCreateTNodeFunction · 0.90
resolveDirectivesFunction · 0.90
mergeHostAttrsFunction · 0.90
computeStaticStylingFunction · 0.90
elementStartMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…