(hostTNode: TNode, hostLView: LView)
| 128 | * @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type |
| 129 | */ |
| 130 | export function createTemplateRef<T>(hostTNode: TNode, hostLView: LView): TemplateRef<T> | null { |
| 131 | if (hostTNode.type & TNodeType.Container) { |
| 132 | ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated'); |
| 133 | return new TemplateRef( |
| 134 | hostLView, |
| 135 | hostTNode as TContainerNode, |
| 136 | createElementRef(hostTNode, hostLView), |
| 137 | ); |
| 138 | } |
| 139 | return null; |
| 140 | } |
no test coverage detected
searching dependent graphs…