( index: number, tView: TView, type: TNodeType.Element | TNodeType.ElementContainer, name: string, attrsIndex?: number | null, localRefsIndex?: number, )
| 78 | } |
| 79 | |
| 80 | export function domOnlyFirstCreatePass( |
| 81 | index: number, |
| 82 | tView: TView, |
| 83 | type: TNodeType.Element | TNodeType.ElementContainer, |
| 84 | name: string, |
| 85 | attrsIndex?: number | null, |
| 86 | localRefsIndex?: number, |
| 87 | ): TElementNode | TElementContainerNode { |
| 88 | ngDevMode && assertFirstCreatePass(tView); |
| 89 | const tViewConsts = tView.consts; |
| 90 | const attrs = getConstant<TAttributes>(tViewConsts, attrsIndex); |
| 91 | const tNode = getOrCreateTNode(tView, index, type, name, attrs) as |
| 92 | | TElementNode |
| 93 | | TElementContainerNode; |
| 94 | |
| 95 | // Merge the template attrs last so that they have the highest priority. |
| 96 | tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs); |
| 97 | |
| 98 | if (localRefsIndex != null) { |
| 99 | const refs = getConstant<string[]>(tViewConsts, localRefsIndex)!; |
| 100 | tNode.localNames = []; |
| 101 | |
| 102 | for (let i = 0; i < refs.length; i += 2) { |
| 103 | // Always -1 since DOM-only instructions can only refer to the native node. |
| 104 | tNode.localNames.push(refs[i], -1); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | if (tNode.attrs !== null) { |
| 109 | computeStaticStyling(tNode, tNode.attrs, false); |
| 110 | } |
| 111 | |
| 112 | if (tNode.mergedAttrs !== null) { |
| 113 | computeStaticStyling(tNode, tNode.mergedAttrs, true); |
| 114 | } |
| 115 | |
| 116 | if (tView.queries !== null) { |
| 117 | tView.queries.elementStart(tView, tNode); |
| 118 | } |
| 119 | |
| 120 | return tNode; |
| 121 | } |
no test coverage detected
searching dependent graphs…