Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
4.8 KB
|
Line | |
---|
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 { getParentRenderElement, visitProjectedRenderNodes } from './util';
|
---|
9 | export function ngContentDef(ngContentIndex, index) {
|
---|
10 | return {
|
---|
11 | // will bet set by the view definition
|
---|
12 | nodeIndex: -1,
|
---|
13 | parent: null,
|
---|
14 | renderParent: null,
|
---|
15 | bindingIndex: -1,
|
---|
16 | outputIndex: -1,
|
---|
17 | // regular values
|
---|
18 | checkIndex: -1,
|
---|
19 | flags: 8 /* TypeNgContent */,
|
---|
20 | childFlags: 0,
|
---|
21 | directChildFlags: 0,
|
---|
22 | childMatchedQueries: 0,
|
---|
23 | matchedQueries: {},
|
---|
24 | matchedQueryIds: 0,
|
---|
25 | references: {},
|
---|
26 | ngContentIndex,
|
---|
27 | childCount: 0,
|
---|
28 | bindings: [],
|
---|
29 | bindingFlags: 0,
|
---|
30 | outputs: [],
|
---|
31 | element: null,
|
---|
32 | provider: null,
|
---|
33 | text: null,
|
---|
34 | query: null,
|
---|
35 | ngContent: { index }
|
---|
36 | };
|
---|
37 | }
|
---|
38 | export function appendNgContent(view, renderHost, def) {
|
---|
39 | const parentEl = getParentRenderElement(view, renderHost, def);
|
---|
40 | if (!parentEl) {
|
---|
41 | // Nothing to do if there is no parent element.
|
---|
42 | return;
|
---|
43 | }
|
---|
44 | const ngContentIndex = def.ngContent.index;
|
---|
45 | visitProjectedRenderNodes(view, ngContentIndex, 1 /* AppendChild */, parentEl, null, undefined);
|
---|
46 | }
|
---|
47 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdfY29udGVudC5qcyI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ZGV4ID0gZGVmLm5nQ29udGVudCEuaW5kZXg7XG4gIHZpc2l0UHJvamVjdGVkUmVuZGVyTm9kZXMoXG4gICAgICB2aWV3LCBuZ0NvbnRlbnRJbmRleCwgUmVuZGVyTm9kZUFjdGlvbi5BcHBlbmRDaGlsZCwgcGFyZW50RWwsIG51bGwsIHVuZGVmaW5lZCk7XG59XG4iXX0= |
---|
Note:
See
TracBrowser
for help on using the repository browser.