1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { assertFirstCreatePass } from '../assert';
|
---|
9 | import { attachPatchData } from '../context_discovery';
|
---|
10 | import { registerPostOrderHooks } from '../hooks';
|
---|
11 | import { isDirectiveHost } from '../interfaces/type_checks';
|
---|
12 | import { HEADER_OFFSET, RENDERER } from '../interfaces/view';
|
---|
13 | import { appendChild } from '../node_manipulation';
|
---|
14 | import { getLView, getTView, setCurrentTNode } from '../state';
|
---|
15 | import { getConstant } from '../util/view_utils';
|
---|
16 | import { addToViewTree, createDirectivesInstances, createLContainer, createTView, getOrCreateTNode, resolveDirectives, saveResolvedLocalsInData } from './shared';
|
---|
17 | function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) {
|
---|
18 | ngDevMode && assertFirstCreatePass(tView);
|
---|
19 | ngDevMode && ngDevMode.firstCreatePass++;
|
---|
20 | const tViewConsts = tView.consts;
|
---|
21 | // TODO(pk): refactor getOrCreateTNode to have the "create" only version
|
---|
22 | const tNode = getOrCreateTNode(tView, index, 4 /* Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
|
---|
23 | resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
|
---|
24 | registerPostOrderHooks(tView, tNode);
|
---|
25 | const embeddedTView = tNode.tViews = createTView(2 /* Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
|
---|
26 | if (tView.queries !== null) {
|
---|
27 | tView.queries.template(tView, tNode);
|
---|
28 | embeddedTView.queries = tView.queries.embeddedTView(tNode);
|
---|
29 | }
|
---|
30 | return tNode;
|
---|
31 | }
|
---|
32 | /**
|
---|
33 | * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
|
---|
34 | *
|
---|
35 | * <ng-template #foo>
|
---|
36 | * <div></div>
|
---|
37 | * </ng-template>
|
---|
38 | *
|
---|
39 | * @param index The index of the container in the data array
|
---|
40 | * @param templateFn Inline template
|
---|
41 | * @param decls The number of nodes, local refs, and pipes for this template
|
---|
42 | * @param vars The number of bindings for this template
|
---|
43 | * @param tagName The name of the container element, if applicable
|
---|
44 | * @param attrsIndex Index of template attributes in the `consts` array.
|
---|
45 | * @param localRefs Index of the local references in the `consts` array.
|
---|
46 | * @param localRefExtractor A function which extracts local-refs values from the template.
|
---|
47 | * Defaults to the current element associated with the local-ref.
|
---|
48 | *
|
---|
49 | * @codeGenApi
|
---|
50 | */
|
---|
51 | export function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) {
|
---|
52 | const lView = getLView();
|
---|
53 | const tView = getTView();
|
---|
54 | const adjustedIndex = index + HEADER_OFFSET;
|
---|
55 | const tNode = tView.firstCreatePass ? templateFirstCreatePass(adjustedIndex, tView, lView, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex) :
|
---|
56 | tView.data[adjustedIndex];
|
---|
57 | setCurrentTNode(tNode, false);
|
---|
58 | const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');
|
---|
59 | appendChild(tView, lView, comment, tNode);
|
---|
60 | attachPatchData(comment, lView);
|
---|
61 | addToViewTree(lView, lView[adjustedIndex] = createLContainer(comment, lView, comment, tNode));
|
---|
62 | if (isDirectiveHost(tNode)) {
|
---|
63 | createDirectivesInstances(tView, lView, tNode);
|
---|
64 | }
|
---|
65 | if (localRefsIndex != null) {
|
---|
66 | saveResolvedLocalsInData(lView, tNode, localRefExtractor);
|
---|
67 | }
|
---|
68 | }
|
---|
69 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWN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