@angular/core 14.0.4 → 14.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/application_ref.mjs +1 -1
- package/esm2020/src/core.mjs +1 -1
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +2 -3
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/render/api.mjs +2 -11
- package/esm2020/src/render3/component.mjs +3 -58
- package/esm2020/src/render3/component_ref.mjs +9 -3
- package/esm2020/src/render3/index.mjs +3 -3
- package/esm2020/src/render3/instructions/listener.mjs +34 -44
- package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
- package/esm2020/src/render3/instructions/shared.mjs +19 -57
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -26
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/node_manipulation.mjs +24 -87
- package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
- package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
- package/esm2020/src/render3/util/view_utils.mjs +3 -6
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +1751 -1946
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1625 -1912
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1751 -1946
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +1625 -1912
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +55 -128
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.5
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1586,96 +1586,6 @@ function getNamespaceUri(namespace) {
|
|
|
1586
1586
|
(name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
1589
|
-
/**
|
|
1590
|
-
* @license
|
|
1591
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1592
|
-
*
|
|
1593
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1594
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1595
|
-
*/
|
|
1596
|
-
/**
|
|
1597
|
-
* Most of the use of `document` in Angular is from within the DI system so it is possible to simply
|
|
1598
|
-
* inject the `DOCUMENT` token and are done.
|
|
1599
|
-
*
|
|
1600
|
-
* Ivy is special because it does not rely upon the DI and must get hold of the document some other
|
|
1601
|
-
* way.
|
|
1602
|
-
*
|
|
1603
|
-
* The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
|
|
1604
|
-
* Wherever ivy needs the global document, it calls `getDocument()` instead.
|
|
1605
|
-
*
|
|
1606
|
-
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
1607
|
-
* tell ivy what the global `document` is.
|
|
1608
|
-
*
|
|
1609
|
-
* Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
|
|
1610
|
-
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
1611
|
-
*/
|
|
1612
|
-
let DOCUMENT = undefined;
|
|
1613
|
-
/**
|
|
1614
|
-
* Tell ivy what the `document` is for this platform.
|
|
1615
|
-
*
|
|
1616
|
-
* It is only necessary to call this if the current platform is not a browser.
|
|
1617
|
-
*
|
|
1618
|
-
* @param document The object representing the global `document` in this environment.
|
|
1619
|
-
*/
|
|
1620
|
-
function setDocument(document) {
|
|
1621
|
-
DOCUMENT = document;
|
|
1622
|
-
}
|
|
1623
|
-
/**
|
|
1624
|
-
* Access the object that represents the `document` for this platform.
|
|
1625
|
-
*
|
|
1626
|
-
* Ivy calls this whenever it needs to access the `document` object.
|
|
1627
|
-
* For example to create the renderer or to do sanitization.
|
|
1628
|
-
*/
|
|
1629
|
-
function getDocument() {
|
|
1630
|
-
if (DOCUMENT !== undefined) {
|
|
1631
|
-
return DOCUMENT;
|
|
1632
|
-
}
|
|
1633
|
-
else if (typeof document !== 'undefined') {
|
|
1634
|
-
return document;
|
|
1635
|
-
}
|
|
1636
|
-
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
1637
|
-
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
1638
|
-
// this should not happen in Angular apps.
|
|
1639
|
-
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
1640
|
-
// public API. Meanwhile we just return `undefined` and let the application fail.
|
|
1641
|
-
return undefined;
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
/**
|
|
1645
|
-
* @license
|
|
1646
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1647
|
-
*
|
|
1648
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1649
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1650
|
-
*/
|
|
1651
|
-
// TODO: cleanup once the code is merged in angular/angular
|
|
1652
|
-
var RendererStyleFlags3;
|
|
1653
|
-
(function (RendererStyleFlags3) {
|
|
1654
|
-
RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
|
|
1655
|
-
RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
|
|
1656
|
-
})(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
|
|
1657
|
-
/** Returns whether the `renderer` is a `ProceduralRenderer3` */
|
|
1658
|
-
function isProceduralRenderer(renderer) {
|
|
1659
|
-
return !!(renderer.listen);
|
|
1660
|
-
}
|
|
1661
|
-
let renderer3Enabled = false;
|
|
1662
|
-
function enableRenderer3() {
|
|
1663
|
-
renderer3Enabled = true;
|
|
1664
|
-
}
|
|
1665
|
-
const domRendererFactory3 = {
|
|
1666
|
-
createRenderer: (hostElement, rendererType) => {
|
|
1667
|
-
if (!renderer3Enabled) {
|
|
1668
|
-
throw new Error(ngDevMode ?
|
|
1669
|
-
`Renderer3 is not supported. This problem is likely caused by some component in the hierarchy was constructed without a correct parent injector.` :
|
|
1670
|
-
'Renderer3 disabled');
|
|
1671
|
-
}
|
|
1672
|
-
return getDocument();
|
|
1673
|
-
}
|
|
1674
|
-
};
|
|
1675
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
1676
|
-
// failure based on types.
|
|
1677
|
-
const unusedValueExportToPlacateAjd$6 = 1;
|
|
1678
|
-
|
|
1679
1589
|
/**
|
|
1680
1590
|
* @license
|
|
1681
1591
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1758,7 +1668,6 @@ function getNativeByTNode(tNode, lView) {
|
|
|
1758
1668
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1759
1669
|
ngDevMode && assertIndexInRange(lView, tNode.index);
|
|
1760
1670
|
const node = unwrapRNode(lView[tNode.index]);
|
|
1761
|
-
ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1762
1671
|
return node;
|
|
1763
1672
|
}
|
|
1764
1673
|
/**
|
|
@@ -1774,7 +1683,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
|
|
|
1774
1683
|
if (index !== -1) {
|
|
1775
1684
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1776
1685
|
const node = unwrapRNode(lView[index]);
|
|
1777
|
-
ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1778
1686
|
return node;
|
|
1779
1687
|
}
|
|
1780
1688
|
return null;
|
|
@@ -2723,7 +2631,7 @@ function isFactory(obj) {
|
|
|
2723
2631
|
}
|
|
2724
2632
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2725
2633
|
// failure based on types.
|
|
2726
|
-
const unusedValueExportToPlacateAjd$
|
|
2634
|
+
const unusedValueExportToPlacateAjd$6 = 1;
|
|
2727
2635
|
|
|
2728
2636
|
/**
|
|
2729
2637
|
* Converts `TNodeType` into human readable text.
|
|
@@ -2742,7 +2650,7 @@ function toTNodeTypeAsString(tNodeType) {
|
|
|
2742
2650
|
}
|
|
2743
2651
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2744
2652
|
// failure based on types.
|
|
2745
|
-
const unusedValueExportToPlacateAjd$
|
|
2653
|
+
const unusedValueExportToPlacateAjd$5 = 1;
|
|
2746
2654
|
/**
|
|
2747
2655
|
* Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
|
|
2748
2656
|
*
|
|
@@ -2846,7 +2754,6 @@ function assertPureTNodeType(type) {
|
|
|
2846
2754
|
* @returns the index value that was last accessed in the attributes array
|
|
2847
2755
|
*/
|
|
2848
2756
|
function setUpAttributes(renderer, native, attrs) {
|
|
2849
|
-
const isProc = isProceduralRenderer(renderer);
|
|
2850
2757
|
let i = 0;
|
|
2851
2758
|
while (i < attrs.length) {
|
|
2852
2759
|
const value = attrs[i];
|
|
@@ -2863,9 +2770,7 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2863
2770
|
const attrName = attrs[i++];
|
|
2864
2771
|
const attrVal = attrs[i++];
|
|
2865
2772
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2866
|
-
|
|
2867
|
-
renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
|
|
2868
|
-
native.setAttributeNS(namespaceURI, attrName, attrVal);
|
|
2773
|
+
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
|
|
2869
2774
|
}
|
|
2870
2775
|
else {
|
|
2871
2776
|
// attrName is string;
|
|
@@ -2874,14 +2779,10 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2874
2779
|
// Standard attributes
|
|
2875
2780
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2876
2781
|
if (isAnimationProp(attrName)) {
|
|
2877
|
-
|
|
2878
|
-
renderer.setProperty(native, attrName, attrVal);
|
|
2879
|
-
}
|
|
2782
|
+
renderer.setProperty(native, attrName, attrVal);
|
|
2880
2783
|
}
|
|
2881
2784
|
else {
|
|
2882
|
-
|
|
2883
|
-
renderer.setAttribute(native, attrName, attrVal) :
|
|
2884
|
-
native.setAttribute(attrName, attrVal);
|
|
2785
|
+
renderer.setAttribute(native, attrName, attrVal);
|
|
2885
2786
|
}
|
|
2886
2787
|
i++;
|
|
2887
2788
|
}
|
|
@@ -5323,6 +5224,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5323
5224
|
checkForDuplicateNgModules = !allowDuplicates;
|
|
5324
5225
|
}
|
|
5325
5226
|
|
|
5227
|
+
/**
|
|
5228
|
+
* @license
|
|
5229
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5230
|
+
*
|
|
5231
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5232
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5233
|
+
*/
|
|
5234
|
+
/**
|
|
5235
|
+
* Most of the use of `document` in Angular is from within the DI system so it is possible to simply
|
|
5236
|
+
* inject the `DOCUMENT` token and are done.
|
|
5237
|
+
*
|
|
5238
|
+
* Ivy is special because it does not rely upon the DI and must get hold of the document some other
|
|
5239
|
+
* way.
|
|
5240
|
+
*
|
|
5241
|
+
* The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
|
|
5242
|
+
* Wherever ivy needs the global document, it calls `getDocument()` instead.
|
|
5243
|
+
*
|
|
5244
|
+
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
5245
|
+
* tell ivy what the global `document` is.
|
|
5246
|
+
*
|
|
5247
|
+
* Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
|
|
5248
|
+
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
5249
|
+
*/
|
|
5250
|
+
let DOCUMENT = undefined;
|
|
5251
|
+
/**
|
|
5252
|
+
* Tell ivy what the `document` is for this platform.
|
|
5253
|
+
*
|
|
5254
|
+
* It is only necessary to call this if the current platform is not a browser.
|
|
5255
|
+
*
|
|
5256
|
+
* @param document The object representing the global `document` in this environment.
|
|
5257
|
+
*/
|
|
5258
|
+
function setDocument(document) {
|
|
5259
|
+
DOCUMENT = document;
|
|
5260
|
+
}
|
|
5261
|
+
/**
|
|
5262
|
+
* Access the object that represents the `document` for this platform.
|
|
5263
|
+
*
|
|
5264
|
+
* Ivy calls this whenever it needs to access the `document` object.
|
|
5265
|
+
* For example to create the renderer or to do sanitization.
|
|
5266
|
+
*/
|
|
5267
|
+
function getDocument() {
|
|
5268
|
+
if (DOCUMENT !== undefined) {
|
|
5269
|
+
return DOCUMENT;
|
|
5270
|
+
}
|
|
5271
|
+
else if (typeof document !== 'undefined') {
|
|
5272
|
+
return document;
|
|
5273
|
+
}
|
|
5274
|
+
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
5275
|
+
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
5276
|
+
// this should not happen in Angular apps.
|
|
5277
|
+
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
5278
|
+
// public API. Meanwhile we just return `undefined` and let the application fail.
|
|
5279
|
+
return undefined;
|
|
5280
|
+
}
|
|
5281
|
+
|
|
5326
5282
|
/**
|
|
5327
5283
|
* @license
|
|
5328
5284
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7058,6 +7014,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
7058
7014
|
}
|
|
7059
7015
|
}
|
|
7060
7016
|
|
|
7017
|
+
/**
|
|
7018
|
+
* @license
|
|
7019
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7020
|
+
*
|
|
7021
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7022
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7023
|
+
*/
|
|
7024
|
+
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
7025
|
+
// failure based on types.
|
|
7026
|
+
const unusedValueExportToPlacateAjd$4 = 1;
|
|
7027
|
+
|
|
7061
7028
|
/**
|
|
7062
7029
|
* @license
|
|
7063
7030
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7140,7 +7107,7 @@ function getNearestLContainer(viewOrContainer) {
|
|
|
7140
7107
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7141
7108
|
* found in the LICENSE file at https://angular.io/license
|
|
7142
7109
|
*/
|
|
7143
|
-
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$
|
|
7110
|
+
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
|
|
7144
7111
|
/**
|
|
7145
7112
|
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
7146
7113
|
* being passed as an argument.
|
|
@@ -7165,7 +7132,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7165
7132
|
lNodeToHandle = lNodeToHandle[HOST];
|
|
7166
7133
|
}
|
|
7167
7134
|
const rNode = unwrapRNode(lNodeToHandle);
|
|
7168
|
-
ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
|
|
7169
7135
|
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7170
7136
|
if (beforeNode == null) {
|
|
7171
7137
|
nativeAppendChild(renderer, parent, rNode);
|
|
@@ -7192,17 +7158,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7192
7158
|
function createTextNode(renderer, value) {
|
|
7193
7159
|
ngDevMode && ngDevMode.rendererCreateTextNode++;
|
|
7194
7160
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7195
|
-
return
|
|
7196
|
-
renderer.createTextNode(value);
|
|
7161
|
+
return renderer.createText(value);
|
|
7197
7162
|
}
|
|
7198
7163
|
function updateTextNode(renderer, rNode, value) {
|
|
7199
7164
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7200
|
-
|
|
7165
|
+
renderer.setValue(rNode, value);
|
|
7201
7166
|
}
|
|
7202
7167
|
function createCommentNode(renderer, value) {
|
|
7203
7168
|
ngDevMode && ngDevMode.rendererCreateComment++;
|
|
7204
|
-
// isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
|
|
7205
|
-
// method name.
|
|
7206
7169
|
return renderer.createComment(escapeCommentText(value));
|
|
7207
7170
|
}
|
|
7208
7171
|
/**
|
|
@@ -7214,14 +7177,7 @@ function createCommentNode(renderer, value) {
|
|
|
7214
7177
|
*/
|
|
7215
7178
|
function createElementNode(renderer, name, namespace) {
|
|
7216
7179
|
ngDevMode && ngDevMode.rendererCreateElement++;
|
|
7217
|
-
|
|
7218
|
-
return renderer.createElement(name, namespace);
|
|
7219
|
-
}
|
|
7220
|
-
else {
|
|
7221
|
-
const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
|
|
7222
|
-
return namespaceUri === null ? renderer.createElement(name) :
|
|
7223
|
-
renderer.createElementNS(namespaceUri, name);
|
|
7224
|
-
}
|
|
7180
|
+
return renderer.createElement(name, namespace);
|
|
7225
7181
|
}
|
|
7226
7182
|
/**
|
|
7227
7183
|
* Removes all DOM elements associated with a view.
|
|
@@ -7453,7 +7409,7 @@ function detachView(lContainer, removeIndex) {
|
|
|
7453
7409
|
function destroyLView(tView, lView) {
|
|
7454
7410
|
if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
|
|
7455
7411
|
const renderer = lView[RENDERER];
|
|
7456
|
-
if (
|
|
7412
|
+
if (renderer.destroyNode) {
|
|
7457
7413
|
applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
|
|
7458
7414
|
}
|
|
7459
7415
|
destroyViewTree(lView);
|
|
@@ -7481,7 +7437,7 @@ function cleanUpView(tView, lView) {
|
|
|
7481
7437
|
executeOnDestroys(tView, lView);
|
|
7482
7438
|
processCleanups(tView, lView);
|
|
7483
7439
|
// For component views only, the local renderer is destroyed at clean up time.
|
|
7484
|
-
if (lView[TVIEW].type === 1 /* TViewType.Component */
|
|
7440
|
+
if (lView[TVIEW].type === 1 /* TViewType.Component */) {
|
|
7485
7441
|
ngDevMode && ngDevMode.rendererDestroy++;
|
|
7486
7442
|
lView[RENDERER].destroy();
|
|
7487
7443
|
}
|
|
@@ -7657,30 +7613,17 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7657
7613
|
}
|
|
7658
7614
|
}
|
|
7659
7615
|
/**
|
|
7660
|
-
* Inserts a native node before another native node for a given parent
|
|
7661
|
-
* This is a utility function that can be used when native nodes were determined
|
|
7662
|
-
* actual renderer being used.
|
|
7616
|
+
* Inserts a native node before another native node for a given parent.
|
|
7617
|
+
* This is a utility function that can be used when native nodes were determined.
|
|
7663
7618
|
*/
|
|
7664
7619
|
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7665
7620
|
ngDevMode && ngDevMode.rendererInsertBefore++;
|
|
7666
|
-
|
|
7667
|
-
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7668
|
-
}
|
|
7669
|
-
else {
|
|
7670
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7671
|
-
targetParent.insertBefore(child, beforeNode, isMove);
|
|
7672
|
-
}
|
|
7621
|
+
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7673
7622
|
}
|
|
7674
7623
|
function nativeAppendChild(renderer, parent, child) {
|
|
7675
7624
|
ngDevMode && ngDevMode.rendererAppendChild++;
|
|
7676
7625
|
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
7677
|
-
|
|
7678
|
-
renderer.appendChild(parent, child);
|
|
7679
|
-
}
|
|
7680
|
-
else {
|
|
7681
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7682
|
-
targetParent.appendChild(child);
|
|
7683
|
-
}
|
|
7626
|
+
renderer.appendChild(parent, child);
|
|
7684
7627
|
}
|
|
7685
7628
|
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7686
7629
|
if (beforeNode !== null) {
|
|
@@ -7692,12 +7635,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
|
|
|
7692
7635
|
}
|
|
7693
7636
|
/** Removes a node from the DOM given its native parent. */
|
|
7694
7637
|
function nativeRemoveChild(renderer, parent, child, isHostElement) {
|
|
7695
|
-
|
|
7696
|
-
renderer.removeChild(parent, child, isHostElement);
|
|
7697
|
-
}
|
|
7698
|
-
else {
|
|
7699
|
-
parent.removeChild(child);
|
|
7700
|
-
}
|
|
7638
|
+
renderer.removeChild(parent, child, isHostElement);
|
|
7701
7639
|
}
|
|
7702
7640
|
/** Checks if an element is a `<template>` node. */
|
|
7703
7641
|
function isTemplateNode(node) {
|
|
@@ -7707,13 +7645,13 @@ function isTemplateNode(node) {
|
|
|
7707
7645
|
* Returns a native parent of a given native node.
|
|
7708
7646
|
*/
|
|
7709
7647
|
function nativeParentNode(renderer, node) {
|
|
7710
|
-
return
|
|
7648
|
+
return renderer.parentNode(node);
|
|
7711
7649
|
}
|
|
7712
7650
|
/**
|
|
7713
7651
|
* Returns a native sibling of a given native node.
|
|
7714
7652
|
*/
|
|
7715
7653
|
function nativeNextSibling(renderer, node) {
|
|
7716
|
-
return
|
|
7654
|
+
return renderer.nextSibling(node);
|
|
7717
7655
|
}
|
|
7718
7656
|
/**
|
|
7719
7657
|
* Find a node in front of which `currentTNode` should be inserted.
|
|
@@ -8022,39 +7960,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
|
|
|
8022
7960
|
* otherwise).
|
|
8023
7961
|
*/
|
|
8024
7962
|
function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
8025
|
-
const isProcedural = isProceduralRenderer(renderer);
|
|
8026
7963
|
if (isClassBased) {
|
|
8027
7964
|
// We actually want JS true/false here because any truthy value should add the class
|
|
8028
7965
|
if (!value) {
|
|
8029
7966
|
ngDevMode && ngDevMode.rendererRemoveClass++;
|
|
8030
|
-
|
|
8031
|
-
renderer.removeClass(rNode, prop);
|
|
8032
|
-
}
|
|
8033
|
-
else {
|
|
8034
|
-
rNode.classList.remove(prop);
|
|
8035
|
-
}
|
|
7967
|
+
renderer.removeClass(rNode, prop);
|
|
8036
7968
|
}
|
|
8037
7969
|
else {
|
|
8038
7970
|
ngDevMode && ngDevMode.rendererAddClass++;
|
|
8039
|
-
|
|
8040
|
-
renderer.addClass(rNode, prop);
|
|
8041
|
-
}
|
|
8042
|
-
else {
|
|
8043
|
-
ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
|
|
8044
|
-
rNode.classList.add(prop);
|
|
8045
|
-
}
|
|
7971
|
+
renderer.addClass(rNode, prop);
|
|
8046
7972
|
}
|
|
8047
7973
|
}
|
|
8048
7974
|
else {
|
|
8049
7975
|
let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
|
|
8050
7976
|
if (value == null /** || value === undefined */) {
|
|
8051
7977
|
ngDevMode && ngDevMode.rendererRemoveStyle++;
|
|
8052
|
-
|
|
8053
|
-
renderer.removeStyle(rNode, prop, flags);
|
|
8054
|
-
}
|
|
8055
|
-
else {
|
|
8056
|
-
rNode.style.removeProperty(prop);
|
|
8057
|
-
}
|
|
7978
|
+
renderer.removeStyle(rNode, prop, flags);
|
|
8058
7979
|
}
|
|
8059
7980
|
else {
|
|
8060
7981
|
// A value is important if it ends with `!important`. The style
|
|
@@ -8066,13 +7987,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8066
7987
|
flags |= RendererStyleFlags2.Important;
|
|
8067
7988
|
}
|
|
8068
7989
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8069
|
-
|
|
8070
|
-
renderer.setStyle(rNode, prop, value, flags);
|
|
8071
|
-
}
|
|
8072
|
-
else {
|
|
8073
|
-
ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
|
|
8074
|
-
rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
|
|
8075
|
-
}
|
|
7990
|
+
renderer.setStyle(rNode, prop, value, flags);
|
|
8076
7991
|
}
|
|
8077
7992
|
}
|
|
8078
7993
|
}
|
|
@@ -8088,12 +8003,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8088
8003
|
*/
|
|
8089
8004
|
function writeDirectStyle(renderer, element, newValue) {
|
|
8090
8005
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8091
|
-
|
|
8092
|
-
renderer.setAttribute(element, 'style', newValue);
|
|
8093
|
-
}
|
|
8094
|
-
else {
|
|
8095
|
-
element.style.cssText = newValue;
|
|
8096
|
-
}
|
|
8006
|
+
renderer.setAttribute(element, 'style', newValue);
|
|
8097
8007
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8098
8008
|
}
|
|
8099
8009
|
/**
|
|
@@ -8108,17 +8018,12 @@ function writeDirectStyle(renderer, element, newValue) {
|
|
|
8108
8018
|
*/
|
|
8109
8019
|
function writeDirectClass(renderer, element, newValue) {
|
|
8110
8020
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8111
|
-
if (
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
renderer.removeAttribute(element, 'class');
|
|
8115
|
-
}
|
|
8116
|
-
else {
|
|
8117
|
-
renderer.setAttribute(element, 'class', newValue);
|
|
8118
|
-
}
|
|
8021
|
+
if (newValue === '') {
|
|
8022
|
+
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
8023
|
+
renderer.removeAttribute(element, 'class');
|
|
8119
8024
|
}
|
|
8120
8025
|
else {
|
|
8121
|
-
element
|
|
8026
|
+
renderer.setAttribute(element, 'class', newValue);
|
|
8122
8027
|
}
|
|
8123
8028
|
ngDevMode && ngDevMode.rendererSetClassName++;
|
|
8124
8029
|
}
|
|
@@ -8168,7 +8073,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
8168
8073
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8169
8074
|
* found in the LICENSE file at https://angular.io/license
|
|
8170
8075
|
*/
|
|
8171
|
-
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$
|
|
8076
|
+
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
|
|
8172
8077
|
const NG_TEMPLATE_SELECTOR = 'ng-template';
|
|
8173
8078
|
/**
|
|
8174
8079
|
* Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
|
|
@@ -11499,6 +11404,13 @@ class LContainerDebug {
|
|
|
11499
11404
|
}
|
|
11500
11405
|
}
|
|
11501
11406
|
|
|
11407
|
+
/**
|
|
11408
|
+
* @license
|
|
11409
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11410
|
+
*
|
|
11411
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11412
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11413
|
+
*/
|
|
11502
11414
|
/**
|
|
11503
11415
|
* A permanent marker promise which signifies that the current CD tree is
|
|
11504
11416
|
* clean.
|
|
@@ -11566,7 +11478,7 @@ function refreshChildComponents(hostLView, components) {
|
|
|
11566
11478
|
/** Renders child components in the current view (creation mode). */
|
|
11567
11479
|
function renderChildComponents(hostLView, components) {
|
|
11568
11480
|
for (let i = 0; i < components.length; i++) {
|
|
11569
|
-
renderComponent
|
|
11481
|
+
renderComponent(hostLView, components[i]);
|
|
11570
11482
|
}
|
|
11571
11483
|
}
|
|
11572
11484
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
@@ -12084,16 +11996,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
|
12084
11996
|
function createError(text, token) {
|
|
12085
11997
|
return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
|
|
12086
11998
|
}
|
|
12087
|
-
function assertHostNodeExists(rElement, elementOrSelector) {
|
|
12088
|
-
if (!rElement) {
|
|
12089
|
-
if (typeof elementOrSelector === 'string') {
|
|
12090
|
-
throw createError('Host node with selector not found:', elementOrSelector);
|
|
12091
|
-
}
|
|
12092
|
-
else {
|
|
12093
|
-
throw createError('Host node is required:', elementOrSelector);
|
|
12094
|
-
}
|
|
12095
|
-
}
|
|
12096
|
-
}
|
|
12097
11999
|
/**
|
|
12098
12000
|
* Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
|
|
12099
12001
|
*
|
|
@@ -12102,21 +12004,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
|
|
|
12102
12004
|
* @param encapsulation View Encapsulation defined for component that requests host element.
|
|
12103
12005
|
*/
|
|
12104
12006
|
function locateHostElement(renderer, elementOrSelector, encapsulation) {
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12109
|
-
}
|
|
12110
|
-
let rElement = typeof elementOrSelector === 'string' ?
|
|
12111
|
-
renderer.querySelector(elementOrSelector) :
|
|
12112
|
-
elementOrSelector;
|
|
12113
|
-
ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
|
|
12114
|
-
// Always clear host element's content when Renderer3 is in use. For procedural renderer case we
|
|
12115
|
-
// make it depend on whether ShadowDom encapsulation is used (in which case the content should be
|
|
12116
|
-
// preserved to allow native slot projection). ShadowDom encapsulation requires procedural
|
|
12117
|
-
// renderer, and procedural renderer case is handled above.
|
|
12118
|
-
rElement.textContent = '';
|
|
12119
|
-
return rElement;
|
|
12007
|
+
// When using native Shadow DOM, do not clear host element to allow native slot projection
|
|
12008
|
+
const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
|
|
12009
|
+
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12120
12010
|
}
|
|
12121
12011
|
/**
|
|
12122
12012
|
* Saves context for this cleanup function in LView.cleanupInstances.
|
|
@@ -12331,13 +12221,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12331
12221
|
// It is assumed that the sanitizer is only added when the compiler determines that the
|
|
12332
12222
|
// property is risky, so sanitization can be done without further checks.
|
|
12333
12223
|
value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
|
|
12334
|
-
|
|
12335
|
-
renderer.setProperty(element, propName, value);
|
|
12336
|
-
}
|
|
12337
|
-
else if (!isAnimationProp(propName)) {
|
|
12338
|
-
element.setProperty ? element.setProperty(propName, value) :
|
|
12339
|
-
element[propName] = value;
|
|
12340
|
-
}
|
|
12224
|
+
renderer.setProperty(element, propName, value);
|
|
12341
12225
|
}
|
|
12342
12226
|
else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
|
|
12343
12227
|
// If the node is a container and the property didn't
|
|
@@ -12361,23 +12245,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
|
12361
12245
|
const debugValue = normalizeDebugBindingValue(value);
|
|
12362
12246
|
if (type & 3 /* TNodeType.AnyRNode */) {
|
|
12363
12247
|
if (value == null) {
|
|
12364
|
-
|
|
12365
|
-
element.removeAttribute(attrName);
|
|
12248
|
+
renderer.removeAttribute(element, attrName);
|
|
12366
12249
|
}
|
|
12367
12250
|
else {
|
|
12368
|
-
|
|
12369
|
-
renderer.setAttribute(element, attrName, debugValue) :
|
|
12370
|
-
element.setAttribute(attrName, debugValue);
|
|
12251
|
+
renderer.setAttribute(element, attrName, debugValue);
|
|
12371
12252
|
}
|
|
12372
12253
|
}
|
|
12373
12254
|
else {
|
|
12374
12255
|
const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
|
|
12375
|
-
|
|
12376
|
-
renderer.setValue(element, textContent);
|
|
12377
|
-
}
|
|
12378
|
-
else {
|
|
12379
|
-
element.textContent = textContent;
|
|
12380
|
-
}
|
|
12256
|
+
renderer.setValue(element, textContent);
|
|
12381
12257
|
}
|
|
12382
12258
|
}
|
|
12383
12259
|
function setNgReflectProperties(lView, element, type, dataValue, value) {
|
|
@@ -12731,19 +12607,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
|
|
|
12731
12607
|
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
|
|
12732
12608
|
if (value == null) {
|
|
12733
12609
|
ngDevMode && ngDevMode.rendererRemoveAttribute++;
|
|
12734
|
-
|
|
12735
|
-
element.removeAttribute(name);
|
|
12610
|
+
renderer.removeAttribute(element, name, namespace);
|
|
12736
12611
|
}
|
|
12737
12612
|
else {
|
|
12738
12613
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
12739
12614
|
const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
|
|
12740
|
-
|
|
12741
|
-
renderer.setAttribute(element, name, strValue, namespace);
|
|
12742
|
-
}
|
|
12743
|
-
else {
|
|
12744
|
-
namespace ? element.setAttributeNS(namespace, name, strValue) :
|
|
12745
|
-
element.setAttribute(name, strValue);
|
|
12746
|
-
}
|
|
12615
|
+
renderer.setAttribute(element, name, strValue, namespace);
|
|
12747
12616
|
}
|
|
12748
12617
|
}
|
|
12749
12618
|
/**
|
|
@@ -12835,7 +12704,6 @@ const LContainerArray = class LContainer extends Array {
|
|
|
12835
12704
|
*/
|
|
12836
12705
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
12837
12706
|
ngDevMode && assertLView(currentView);
|
|
12838
|
-
ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
|
|
12839
12707
|
// https://jsperf.com/array-literal-vs-new-array-really
|
|
12840
12708
|
const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
|
|
12841
12709
|
true, // Boolean `true` in this position signifies that this is an `LContainer`
|
|
@@ -12951,7 +12819,7 @@ function refreshContainsDirtyView(lView) {
|
|
|
12951
12819
|
}
|
|
12952
12820
|
}
|
|
12953
12821
|
}
|
|
12954
|
-
function renderComponent
|
|
12822
|
+
function renderComponent(hostLView, componentHostIdx) {
|
|
12955
12823
|
ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
|
|
12956
12824
|
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
|
|
12957
12825
|
const componentTView = componentView[TVIEW];
|
|
@@ -13303,48 +13171,135 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
|
|
|
13303
13171
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13304
13172
|
* found in the LICENSE file at https://angular.io/license
|
|
13305
13173
|
*/
|
|
13174
|
+
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13175
|
+
const NULL_INJECTOR = {
|
|
13176
|
+
get: (token, notFoundValue) => {
|
|
13177
|
+
throwProviderNotFoundError(token, 'NullInjector');
|
|
13178
|
+
}
|
|
13179
|
+
};
|
|
13306
13180
|
/**
|
|
13307
|
-
*
|
|
13181
|
+
* Creates the root component view and the root component node.
|
|
13308
13182
|
*
|
|
13309
|
-
*
|
|
13183
|
+
* @param rNode Render host element.
|
|
13184
|
+
* @param def ComponentDef
|
|
13185
|
+
* @param rootView The parent view where the host node is stored
|
|
13186
|
+
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13187
|
+
* @param hostRenderer The current renderer
|
|
13188
|
+
* @param sanitizer The sanitizer, if provided
|
|
13310
13189
|
*
|
|
13311
|
-
* @
|
|
13190
|
+
* @returns Component view created
|
|
13312
13191
|
*/
|
|
13313
|
-
function
|
|
13314
|
-
const
|
|
13315
|
-
|
|
13192
|
+
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13193
|
+
const tView = rootView[TVIEW];
|
|
13194
|
+
const index = HEADER_OFFSET;
|
|
13195
|
+
ngDevMode && assertIndexInRange(rootView, index);
|
|
13196
|
+
rootView[index] = rNode;
|
|
13197
|
+
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13198
|
+
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13199
|
+
// representing a host element.
|
|
13200
|
+
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13201
|
+
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13202
|
+
if (mergedAttrs !== null) {
|
|
13203
|
+
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13204
|
+
if (rNode !== null) {
|
|
13205
|
+
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13206
|
+
if (tNode.classes !== null) {
|
|
13207
|
+
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13208
|
+
}
|
|
13209
|
+
if (tNode.styles !== null) {
|
|
13210
|
+
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13211
|
+
}
|
|
13212
|
+
}
|
|
13213
|
+
}
|
|
13214
|
+
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13215
|
+
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13216
|
+
if (tView.firstCreatePass) {
|
|
13217
|
+
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13218
|
+
markAsComponentHost(tView, tNode);
|
|
13219
|
+
initTNodeFlags(tNode, rootView.length, 1);
|
|
13220
|
+
}
|
|
13221
|
+
addToViewTree(rootView, componentView);
|
|
13222
|
+
// Store component view at node index, with node as the HOST
|
|
13223
|
+
return rootView[index] = componentView;
|
|
13316
13224
|
}
|
|
13317
13225
|
/**
|
|
13318
|
-
*
|
|
13319
|
-
*
|
|
13320
|
-
*
|
|
13321
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
13322
|
-
* detection can be scheduled per component tree.
|
|
13323
|
-
*
|
|
13324
|
-
* @param component Component to mark as dirty.
|
|
13226
|
+
* Creates a root component and sets it up with features and host bindings. Shared by
|
|
13227
|
+
* renderComponent() and ViewContainerRef.createComponent().
|
|
13325
13228
|
*/
|
|
13326
|
-
function
|
|
13327
|
-
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13229
|
+
function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
|
|
13230
|
+
const tView = rootLView[TVIEW];
|
|
13231
|
+
// Create directive instance with factory() and store at next index in viewData
|
|
13232
|
+
const component = instantiateRootComponent(tView, rootLView, componentDef);
|
|
13233
|
+
rootContext.components.push(component);
|
|
13234
|
+
componentView[CONTEXT] = component;
|
|
13235
|
+
if (hostFeatures !== null) {
|
|
13236
|
+
for (const feature of hostFeatures) {
|
|
13237
|
+
feature(component, componentDef);
|
|
13238
|
+
}
|
|
13239
|
+
}
|
|
13240
|
+
// We want to generate an empty QueryList for root content queries for backwards
|
|
13241
|
+
// compatibility with ViewEngine.
|
|
13242
|
+
if (componentDef.contentQueries) {
|
|
13243
|
+
const tNode = getCurrentTNode();
|
|
13244
|
+
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13245
|
+
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13246
|
+
}
|
|
13247
|
+
const rootTNode = getCurrentTNode();
|
|
13248
|
+
ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
|
|
13249
|
+
if (tView.firstCreatePass &&
|
|
13250
|
+
(componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
|
|
13251
|
+
setSelectedIndex(rootTNode.index);
|
|
13252
|
+
const rootTView = rootLView[TVIEW];
|
|
13253
|
+
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13254
|
+
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13255
|
+
}
|
|
13256
|
+
return component;
|
|
13257
|
+
}
|
|
13258
|
+
function createRootContext(scheduler, playerHandler) {
|
|
13259
|
+
return {
|
|
13260
|
+
components: [],
|
|
13261
|
+
scheduler: scheduler || defaultScheduler,
|
|
13262
|
+
clean: CLEAN_PROMISE,
|
|
13263
|
+
playerHandler: playerHandler || null,
|
|
13264
|
+
flags: 0 /* RootContextFlags.Empty */
|
|
13265
|
+
};
|
|
13266
|
+
}
|
|
13332
13267
|
/**
|
|
13333
|
-
* Used to
|
|
13268
|
+
* Used to enable lifecycle hooks on the root component.
|
|
13334
13269
|
*
|
|
13335
|
-
*
|
|
13336
|
-
*
|
|
13337
|
-
*
|
|
13270
|
+
* Include this feature when calling `renderComponent` if the root component
|
|
13271
|
+
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
13272
|
+
* be called properly.
|
|
13338
13273
|
*
|
|
13339
|
-
*
|
|
13340
|
-
*
|
|
13341
|
-
*
|
|
13342
|
-
*
|
|
13274
|
+
* Example:
|
|
13275
|
+
*
|
|
13276
|
+
* ```
|
|
13277
|
+
* renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
|
|
13278
|
+
* ```
|
|
13343
13279
|
*/
|
|
13344
|
-
function
|
|
13345
|
-
const
|
|
13346
|
-
|
|
13347
|
-
|
|
13280
|
+
function LifecycleHooksFeature() {
|
|
13281
|
+
const tNode = getCurrentTNode();
|
|
13282
|
+
ngDevMode && assertDefined(tNode, 'TNode is required');
|
|
13283
|
+
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13284
|
+
}
|
|
13285
|
+
/**
|
|
13286
|
+
* Wait on component until it is rendered.
|
|
13287
|
+
*
|
|
13288
|
+
* This function returns a `Promise` which is resolved when the component's
|
|
13289
|
+
* change detection is executed. This is determined by finding the scheduler
|
|
13290
|
+
* associated with the `component`'s render tree and waiting until the scheduler
|
|
13291
|
+
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
13292
|
+
*
|
|
13293
|
+
* Example:
|
|
13294
|
+
* ```
|
|
13295
|
+
* await whenRendered(myComponent);
|
|
13296
|
+
* ```
|
|
13297
|
+
*
|
|
13298
|
+
* @param component Component to wait upon
|
|
13299
|
+
* @returns Promise which resolves when the component is rendered.
|
|
13300
|
+
*/
|
|
13301
|
+
function whenRendered(component) {
|
|
13302
|
+
return getRootContext(component).clean;
|
|
13348
13303
|
}
|
|
13349
13304
|
|
|
13350
13305
|
/**
|
|
@@ -13354,407 +13309,312 @@ function tick(component) {
|
|
|
13354
13309
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13355
13310
|
* found in the LICENSE file at https://angular.io/license
|
|
13356
13311
|
*/
|
|
13312
|
+
function getSuperType(type) {
|
|
13313
|
+
return Object.getPrototypeOf(type.prototype).constructor;
|
|
13314
|
+
}
|
|
13357
13315
|
/**
|
|
13358
|
-
*
|
|
13359
|
-
*
|
|
13360
|
-
* @usageNotes
|
|
13361
|
-
* Given the following DOM structure:
|
|
13362
|
-
*
|
|
13363
|
-
* ```html
|
|
13364
|
-
* <app-root>
|
|
13365
|
-
* <div>
|
|
13366
|
-
* <child-comp></child-comp>
|
|
13367
|
-
* </div>
|
|
13368
|
-
* </app-root>
|
|
13369
|
-
* ```
|
|
13370
|
-
*
|
|
13371
|
-
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
13372
|
-
* associated with this DOM element.
|
|
13373
|
-
*
|
|
13374
|
-
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
13375
|
-
*
|
|
13376
|
-
*
|
|
13377
|
-
* @param element DOM element from which the component should be retrieved.
|
|
13378
|
-
* @returns Component instance associated with the element or `null` if there
|
|
13379
|
-
* is no component associated with it.
|
|
13316
|
+
* Merges the definition from a super class to a sub class.
|
|
13317
|
+
* @param definition The definition that is a SubClass of another directive of component
|
|
13380
13318
|
*
|
|
13381
|
-
* @
|
|
13382
|
-
* @globalApi ng
|
|
13319
|
+
* @codeGenApi
|
|
13383
13320
|
*/
|
|
13384
|
-
function
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
|
|
13321
|
+
function ɵɵInheritDefinitionFeature(definition) {
|
|
13322
|
+
let superType = getSuperType(definition.type);
|
|
13323
|
+
let shouldInheritFields = true;
|
|
13324
|
+
const inheritanceChain = [definition];
|
|
13325
|
+
while (superType) {
|
|
13326
|
+
let superDef = undefined;
|
|
13327
|
+
if (isComponentDef(definition)) {
|
|
13328
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13329
|
+
superDef = superType.ɵcmp || superType.ɵdir;
|
|
13393
13330
|
}
|
|
13394
|
-
|
|
13331
|
+
else {
|
|
13332
|
+
if (superType.ɵcmp) {
|
|
13333
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
13334
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
13335
|
+
}
|
|
13336
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13337
|
+
superDef = superType.ɵdir;
|
|
13338
|
+
}
|
|
13339
|
+
if (superDef) {
|
|
13340
|
+
if (shouldInheritFields) {
|
|
13341
|
+
inheritanceChain.push(superDef);
|
|
13342
|
+
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
13343
|
+
// would've justified object creation. Unwrap them if necessary.
|
|
13344
|
+
const writeableDef = definition;
|
|
13345
|
+
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
13346
|
+
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
13347
|
+
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
13348
|
+
// Merge hostBindings
|
|
13349
|
+
const superHostBindings = superDef.hostBindings;
|
|
13350
|
+
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
13351
|
+
// Merge queries
|
|
13352
|
+
const superViewQuery = superDef.viewQuery;
|
|
13353
|
+
const superContentQueries = superDef.contentQueries;
|
|
13354
|
+
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
13355
|
+
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
13356
|
+
// Merge inputs and outputs
|
|
13357
|
+
fillProperties(definition.inputs, superDef.inputs);
|
|
13358
|
+
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
13359
|
+
fillProperties(definition.outputs, superDef.outputs);
|
|
13360
|
+
// Merge animations metadata.
|
|
13361
|
+
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
13362
|
+
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
13363
|
+
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
13364
|
+
// not inherit Components (we throw an error above and cannot reach this code).
|
|
13365
|
+
const defData = definition.data;
|
|
13366
|
+
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
13367
|
+
}
|
|
13368
|
+
}
|
|
13369
|
+
// Run parent features
|
|
13370
|
+
const features = superDef.features;
|
|
13371
|
+
if (features) {
|
|
13372
|
+
for (let i = 0; i < features.length; i++) {
|
|
13373
|
+
const feature = features[i];
|
|
13374
|
+
if (feature && feature.ngInherit) {
|
|
13375
|
+
feature(definition);
|
|
13376
|
+
}
|
|
13377
|
+
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
13378
|
+
// def already has all the necessary information inherited from its super class(es), so we
|
|
13379
|
+
// can stop merging fields from super classes. However we need to iterate through the
|
|
13380
|
+
// prototype chain to look for classes that might contain other "features" (like
|
|
13381
|
+
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
13382
|
+
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
13383
|
+
// logic and only invoking functions from the "features" list.
|
|
13384
|
+
if (feature === ɵɵInheritDefinitionFeature) {
|
|
13385
|
+
shouldInheritFields = false;
|
|
13386
|
+
}
|
|
13387
|
+
}
|
|
13388
|
+
}
|
|
13389
|
+
}
|
|
13390
|
+
superType = Object.getPrototypeOf(superType);
|
|
13395
13391
|
}
|
|
13396
|
-
|
|
13392
|
+
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13397
13393
|
}
|
|
13398
13394
|
/**
|
|
13399
|
-
*
|
|
13400
|
-
* view that the element is part of. Otherwise retrieves the instance of the component whose view
|
|
13401
|
-
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
13402
|
-
*
|
|
13403
|
-
* @param element Element for which to get the surrounding component instance.
|
|
13404
|
-
* @returns Instance of the component that is around the element or null if the element isn't
|
|
13405
|
-
* inside any component.
|
|
13395
|
+
* Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
|
|
13406
13396
|
*
|
|
13407
|
-
* @
|
|
13408
|
-
*
|
|
13397
|
+
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
13398
|
+
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
13399
|
+
* type.
|
|
13409
13400
|
*/
|
|
13410
|
-
function
|
|
13411
|
-
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13401
|
+
function mergeHostAttrsAcrossInheritance(inheritanceChain) {
|
|
13402
|
+
let hostVars = 0;
|
|
13403
|
+
let hostAttrs = null;
|
|
13404
|
+
// We process the inheritance order from the base to the leaves here.
|
|
13405
|
+
for (let i = inheritanceChain.length - 1; i >= 0; i--) {
|
|
13406
|
+
const def = inheritanceChain[i];
|
|
13407
|
+
// For each `hostVars`, we need to add the superclass amount.
|
|
13408
|
+
def.hostVars = (hostVars += def.hostVars);
|
|
13409
|
+
// for each `hostAttrs` we need to merge it with superclass.
|
|
13410
|
+
def.hostAttrs =
|
|
13411
|
+
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
13412
|
+
}
|
|
13415
13413
|
}
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13424
|
-
|
|
13425
|
-
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
13426
|
-
* part of a component view.
|
|
13427
|
-
*
|
|
13428
|
-
* @publicApi
|
|
13429
|
-
* @globalApi ng
|
|
13430
|
-
*/
|
|
13431
|
-
function getOwningComponent(elementOrDir) {
|
|
13432
|
-
const context = getLContext(elementOrDir);
|
|
13433
|
-
let lView = context ? context.lView : null;
|
|
13434
|
-
if (lView === null)
|
|
13435
|
-
return null;
|
|
13436
|
-
let parent;
|
|
13437
|
-
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
13438
|
-
lView = parent;
|
|
13414
|
+
function maybeUnwrapEmpty(value) {
|
|
13415
|
+
if (value === EMPTY_OBJ) {
|
|
13416
|
+
return {};
|
|
13417
|
+
}
|
|
13418
|
+
else if (value === EMPTY_ARRAY) {
|
|
13419
|
+
return [];
|
|
13420
|
+
}
|
|
13421
|
+
else {
|
|
13422
|
+
return value;
|
|
13439
13423
|
}
|
|
13440
|
-
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
13441
13424
|
}
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13425
|
+
function inheritViewQuery(definition, superViewQuery) {
|
|
13426
|
+
const prevViewQuery = definition.viewQuery;
|
|
13427
|
+
if (prevViewQuery) {
|
|
13428
|
+
definition.viewQuery = (rf, ctx) => {
|
|
13429
|
+
superViewQuery(rf, ctx);
|
|
13430
|
+
prevViewQuery(rf, ctx);
|
|
13431
|
+
};
|
|
13432
|
+
}
|
|
13433
|
+
else {
|
|
13434
|
+
definition.viewQuery = superViewQuery;
|
|
13435
|
+
}
|
|
13436
|
+
}
|
|
13437
|
+
function inheritContentQueries(definition, superContentQueries) {
|
|
13438
|
+
const prevContentQueries = definition.contentQueries;
|
|
13439
|
+
if (prevContentQueries) {
|
|
13440
|
+
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
13441
|
+
superContentQueries(rf, ctx, directiveIndex);
|
|
13442
|
+
prevContentQueries(rf, ctx, directiveIndex);
|
|
13443
|
+
};
|
|
13444
|
+
}
|
|
13445
|
+
else {
|
|
13446
|
+
definition.contentQueries = superContentQueries;
|
|
13447
|
+
}
|
|
13448
|
+
}
|
|
13449
|
+
function inheritHostBindings(definition, superHostBindings) {
|
|
13450
|
+
const prevHostBindings = definition.hostBindings;
|
|
13451
|
+
if (prevHostBindings) {
|
|
13452
|
+
definition.hostBindings = (rf, ctx) => {
|
|
13453
|
+
superHostBindings(rf, ctx);
|
|
13454
|
+
prevHostBindings(rf, ctx);
|
|
13455
|
+
};
|
|
13456
|
+
}
|
|
13457
|
+
else {
|
|
13458
|
+
definition.hostBindings = superHostBindings;
|
|
13459
|
+
}
|
|
13456
13460
|
}
|
|
13461
|
+
|
|
13457
13462
|
/**
|
|
13458
|
-
*
|
|
13459
|
-
*
|
|
13460
|
-
* @param elementOrDir DOM element, component or directive instance for which to
|
|
13461
|
-
* retrieve the injector.
|
|
13462
|
-
* @returns Injector associated with the element, component or directive instance.
|
|
13463
|
+
* @license
|
|
13464
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13463
13465
|
*
|
|
13464
|
-
*
|
|
13465
|
-
*
|
|
13466
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13467
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13466
13468
|
*/
|
|
13467
|
-
function getInjector(elementOrDir) {
|
|
13468
|
-
const context = getLContext(elementOrDir);
|
|
13469
|
-
const lView = context ? context.lView : null;
|
|
13470
|
-
if (lView === null)
|
|
13471
|
-
return Injector.NULL;
|
|
13472
|
-
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
13473
|
-
return new NodeInjector(tNode, lView);
|
|
13474
|
-
}
|
|
13475
13469
|
/**
|
|
13476
|
-
*
|
|
13477
|
-
*
|
|
13478
|
-
* @param element Element for which the injection tokens should be retrieved.
|
|
13470
|
+
* Fields which exist on either directive or component definitions, and need to be copied from
|
|
13471
|
+
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13479
13472
|
*/
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13485
|
-
|
|
13486
|
-
const tNode = tView.data[context.nodeIndex];
|
|
13487
|
-
const providerTokens = [];
|
|
13488
|
-
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
13489
|
-
const endIndex = tNode.directiveEnd;
|
|
13490
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
13491
|
-
let value = tView.data[i];
|
|
13492
|
-
if (isDirectiveDefHack(value)) {
|
|
13493
|
-
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
13494
|
-
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
13495
|
-
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
13496
|
-
// is that we should always be storing injectable type in this location.
|
|
13497
|
-
value = value.type;
|
|
13498
|
-
}
|
|
13499
|
-
providerTokens.push(value);
|
|
13500
|
-
}
|
|
13501
|
-
return providerTokens;
|
|
13502
|
-
}
|
|
13473
|
+
const COPY_DIRECTIVE_FIELDS = [
|
|
13474
|
+
// The child class should use the providers of its parent.
|
|
13475
|
+
'providersResolver',
|
|
13476
|
+
// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
|
|
13477
|
+
// as inputs, outputs, and host binding functions.
|
|
13478
|
+
];
|
|
13503
13479
|
/**
|
|
13504
|
-
*
|
|
13505
|
-
*
|
|
13506
|
-
*
|
|
13507
|
-
* @usageNotes
|
|
13508
|
-
* Given the following DOM structure:
|
|
13480
|
+
* Fields which exist only on component definitions, and need to be copied from parent to child
|
|
13481
|
+
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
13509
13482
|
*
|
|
13510
|
-
*
|
|
13511
|
-
*
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13483
|
+
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
13484
|
+
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13485
|
+
*/
|
|
13486
|
+
const COPY_COMPONENT_FIELDS = [
|
|
13487
|
+
// The child class should use the template function of its parent, including all template
|
|
13488
|
+
// semantics.
|
|
13489
|
+
'template',
|
|
13490
|
+
'decls',
|
|
13491
|
+
'consts',
|
|
13492
|
+
'vars',
|
|
13493
|
+
'onPush',
|
|
13494
|
+
'ngContentSelectors',
|
|
13495
|
+
// The child class should use the CSS styles of its parent, including all styling semantics.
|
|
13496
|
+
'styles',
|
|
13497
|
+
'encapsulation',
|
|
13498
|
+
// The child class should be checked by the runtime in the same way as its parent.
|
|
13499
|
+
'schemas',
|
|
13500
|
+
];
|
|
13501
|
+
/**
|
|
13502
|
+
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
13503
|
+
* definition.
|
|
13516
13504
|
*
|
|
13517
|
-
*
|
|
13518
|
-
*
|
|
13505
|
+
* This exists primarily to support ngcc migration of an existing View Engine pattern, where an
|
|
13506
|
+
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
13507
|
+
* generates a skeleton definition on the child class, and applies this feature.
|
|
13519
13508
|
*
|
|
13520
|
-
*
|
|
13509
|
+
* The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
|
|
13510
|
+
* including things like the component template function.
|
|
13521
13511
|
*
|
|
13522
|
-
* @param
|
|
13523
|
-
*
|
|
13512
|
+
* @param definition The definition of a child class which inherits from a parent class with its
|
|
13513
|
+
* own definition.
|
|
13524
13514
|
*
|
|
13525
|
-
* @
|
|
13526
|
-
* @globalApi ng
|
|
13515
|
+
* @codeGenApi
|
|
13527
13516
|
*/
|
|
13528
|
-
function
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
|
|
13517
|
+
function ɵɵCopyDefinitionFeature(definition) {
|
|
13518
|
+
let superType = getSuperType(definition.type);
|
|
13519
|
+
let superDef = undefined;
|
|
13520
|
+
if (isComponentDef(definition)) {
|
|
13521
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13522
|
+
superDef = superType.ɵcmp;
|
|
13532
13523
|
}
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
return [];
|
|
13524
|
+
else {
|
|
13525
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13526
|
+
superDef = superType.ɵdir;
|
|
13537
13527
|
}
|
|
13538
|
-
|
|
13539
|
-
const
|
|
13540
|
-
|
|
13541
|
-
|
|
13528
|
+
// Needed because `definition` fields are readonly.
|
|
13529
|
+
const defAny = definition;
|
|
13530
|
+
// Copy over any fields that apply to either directives or components.
|
|
13531
|
+
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
13532
|
+
defAny[field] = superDef[field];
|
|
13542
13533
|
}
|
|
13543
|
-
if (
|
|
13544
|
-
|
|
13534
|
+
if (isComponentDef(superDef)) {
|
|
13535
|
+
// Copy over any component-specific fields.
|
|
13536
|
+
for (const field of COPY_COMPONENT_FIELDS) {
|
|
13537
|
+
defAny[field] = superDef[field];
|
|
13538
|
+
}
|
|
13545
13539
|
}
|
|
13546
|
-
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
13547
|
-
// result so we don't expose an internal data structure in the user's console.
|
|
13548
|
-
return context.directives === null ? [] : [...context.directives];
|
|
13549
13540
|
}
|
|
13541
|
+
|
|
13550
13542
|
/**
|
|
13551
|
-
*
|
|
13552
|
-
*
|
|
13553
|
-
* metadata.
|
|
13554
|
-
*
|
|
13555
|
-
* @param directiveOrComponentInstance Instance of a directive or component
|
|
13556
|
-
* @returns metadata of the passed directive or component
|
|
13543
|
+
* @license
|
|
13544
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13557
13545
|
*
|
|
13558
|
-
*
|
|
13559
|
-
*
|
|
13546
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13547
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13560
13548
|
*/
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
if (!
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
if (directiveDef) {
|
|
13580
|
-
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
13549
|
+
let _symbolIterator = null;
|
|
13550
|
+
function getSymbolIterator() {
|
|
13551
|
+
if (!_symbolIterator) {
|
|
13552
|
+
const Symbol = _global['Symbol'];
|
|
13553
|
+
if (Symbol && Symbol.iterator) {
|
|
13554
|
+
_symbolIterator = Symbol.iterator;
|
|
13555
|
+
}
|
|
13556
|
+
else {
|
|
13557
|
+
// es6-shim specific logic
|
|
13558
|
+
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
13559
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
13560
|
+
const key = keys[i];
|
|
13561
|
+
if (key !== 'entries' && key !== 'size' &&
|
|
13562
|
+
Map.prototype[key] === Map.prototype['entries']) {
|
|
13563
|
+
_symbolIterator = key;
|
|
13564
|
+
}
|
|
13565
|
+
}
|
|
13566
|
+
}
|
|
13581
13567
|
}
|
|
13582
|
-
return
|
|
13568
|
+
return _symbolIterator;
|
|
13583
13569
|
}
|
|
13570
|
+
|
|
13584
13571
|
/**
|
|
13585
|
-
*
|
|
13586
|
-
*
|
|
13587
|
-
* The references are retrieved as a map of local reference name to element or directive instance.
|
|
13572
|
+
* @license
|
|
13573
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13588
13574
|
*
|
|
13589
|
-
*
|
|
13590
|
-
*
|
|
13575
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13576
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13591
13577
|
*/
|
|
13592
|
-
function
|
|
13593
|
-
|
|
13594
|
-
if (context === null)
|
|
13595
|
-
return {};
|
|
13596
|
-
if (context.localRefs === undefined) {
|
|
13597
|
-
const lView = context.lView;
|
|
13598
|
-
if (lView === null) {
|
|
13599
|
-
return {};
|
|
13600
|
-
}
|
|
13601
|
-
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
13602
|
-
}
|
|
13603
|
-
return context.localRefs || {};
|
|
13604
|
-
}
|
|
13605
|
-
/**
|
|
13606
|
-
* Retrieves the host element of a component or directive instance.
|
|
13607
|
-
* The host element is the DOM element that matched the selector of the directive.
|
|
13608
|
-
*
|
|
13609
|
-
* @param componentOrDirective Component or directive instance for which the host
|
|
13610
|
-
* element should be retrieved.
|
|
13611
|
-
* @returns Host element of the target.
|
|
13612
|
-
*
|
|
13613
|
-
* @publicApi
|
|
13614
|
-
* @globalApi ng
|
|
13615
|
-
*/
|
|
13616
|
-
function getHostElement(componentOrDirective) {
|
|
13617
|
-
return getLContext(componentOrDirective).native;
|
|
13578
|
+
function isIterable(obj) {
|
|
13579
|
+
return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
|
|
13618
13580
|
}
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
* the component as well.
|
|
13626
|
-
*
|
|
13627
|
-
* @param component The component to return the content text for.
|
|
13628
|
-
*/
|
|
13629
|
-
function getRenderedText(component) {
|
|
13630
|
-
const hostElement = getHostElement(component);
|
|
13631
|
-
return hostElement.textContent || '';
|
|
13581
|
+
function isListLikeIterable(obj) {
|
|
13582
|
+
if (!isJsObject(obj))
|
|
13583
|
+
return false;
|
|
13584
|
+
return Array.isArray(obj) ||
|
|
13585
|
+
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
|
|
13586
|
+
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
13632
13587
|
}
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
* ```
|
|
13646
|
-
*
|
|
13647
|
-
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
13648
|
-
*
|
|
13649
|
-
* ```ts
|
|
13650
|
-
* {
|
|
13651
|
-
* name: 'click',
|
|
13652
|
-
* element: <div>,
|
|
13653
|
-
* callback: () => doSomething(),
|
|
13654
|
-
* useCapture: false
|
|
13655
|
-
* }
|
|
13656
|
-
* ```
|
|
13657
|
-
*
|
|
13658
|
-
* @param element Element for which the DOM listeners should be retrieved.
|
|
13659
|
-
* @returns Array of event listeners on the DOM element.
|
|
13660
|
-
*
|
|
13661
|
-
* @publicApi
|
|
13662
|
-
* @globalApi ng
|
|
13663
|
-
*/
|
|
13664
|
-
function getListeners(element) {
|
|
13665
|
-
ngDevMode && assertDomElement(element);
|
|
13666
|
-
const lContext = getLContext(element);
|
|
13667
|
-
const lView = lContext === null ? null : lContext.lView;
|
|
13668
|
-
if (lView === null)
|
|
13669
|
-
return [];
|
|
13670
|
-
const tView = lView[TVIEW];
|
|
13671
|
-
const lCleanup = lView[CLEANUP];
|
|
13672
|
-
const tCleanup = tView.cleanup;
|
|
13673
|
-
const listeners = [];
|
|
13674
|
-
if (tCleanup && lCleanup) {
|
|
13675
|
-
for (let i = 0; i < tCleanup.length;) {
|
|
13676
|
-
const firstParam = tCleanup[i++];
|
|
13677
|
-
const secondParam = tCleanup[i++];
|
|
13678
|
-
if (typeof firstParam === 'string') {
|
|
13679
|
-
const name = firstParam;
|
|
13680
|
-
const listenerElement = unwrapRNode(lView[secondParam]);
|
|
13681
|
-
const callback = lCleanup[tCleanup[i++]];
|
|
13682
|
-
const useCaptureOrIndx = tCleanup[i++];
|
|
13683
|
-
// if useCaptureOrIndx is boolean then report it as is.
|
|
13684
|
-
// if useCaptureOrIndx is positive number then it in unsubscribe method
|
|
13685
|
-
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
13686
|
-
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
13687
|
-
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
13688
|
-
if (element == listenerElement) {
|
|
13689
|
-
listeners.push({ element, name, callback, useCapture, type });
|
|
13690
|
-
}
|
|
13691
|
-
}
|
|
13692
|
-
}
|
|
13588
|
+
function areIterablesEqual(a, b, comparator) {
|
|
13589
|
+
const iterator1 = a[getSymbolIterator()]();
|
|
13590
|
+
const iterator2 = b[getSymbolIterator()]();
|
|
13591
|
+
while (true) {
|
|
13592
|
+
const item1 = iterator1.next();
|
|
13593
|
+
const item2 = iterator2.next();
|
|
13594
|
+
if (item1.done && item2.done)
|
|
13595
|
+
return true;
|
|
13596
|
+
if (item1.done || item2.done)
|
|
13597
|
+
return false;
|
|
13598
|
+
if (!comparator(item1.value, item2.value))
|
|
13599
|
+
return false;
|
|
13693
13600
|
}
|
|
13694
|
-
listeners.sort(sortListeners);
|
|
13695
|
-
return listeners;
|
|
13696
|
-
}
|
|
13697
|
-
function sortListeners(a, b) {
|
|
13698
|
-
if (a.name == b.name)
|
|
13699
|
-
return 0;
|
|
13700
|
-
return a.name < b.name ? -1 : 1;
|
|
13701
|
-
}
|
|
13702
|
-
/**
|
|
13703
|
-
* This function should not exist because it is megamorphic and only mostly correct.
|
|
13704
|
-
*
|
|
13705
|
-
* See call site for more info.
|
|
13706
|
-
*/
|
|
13707
|
-
function isDirectiveDefHack(obj) {
|
|
13708
|
-
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
13709
13601
|
}
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
|
|
13714
|
-
|
|
13715
|
-
function getDebugNode$1(element) {
|
|
13716
|
-
if (ngDevMode && !(element instanceof Node)) {
|
|
13717
|
-
throw new Error('Expecting instance of DOM Element');
|
|
13718
|
-
}
|
|
13719
|
-
const lContext = getLContext(element);
|
|
13720
|
-
const lView = lContext ? lContext.lView : null;
|
|
13721
|
-
if (lView === null) {
|
|
13722
|
-
return null;
|
|
13602
|
+
function iterateListLike(obj, fn) {
|
|
13603
|
+
if (Array.isArray(obj)) {
|
|
13604
|
+
for (let i = 0; i < obj.length; i++) {
|
|
13605
|
+
fn(obj[i]);
|
|
13606
|
+
}
|
|
13723
13607
|
}
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
ngDevMode &&
|
|
13731
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
13732
|
-
return buildDebugNode(tNode, lView);
|
|
13608
|
+
else {
|
|
13609
|
+
const iterator = obj[getSymbolIterator()]();
|
|
13610
|
+
let item;
|
|
13611
|
+
while (!((item = iterator.next()).done)) {
|
|
13612
|
+
fn(item.value);
|
|
13613
|
+
}
|
|
13733
13614
|
}
|
|
13734
|
-
return null;
|
|
13735
|
-
}
|
|
13736
|
-
/**
|
|
13737
|
-
* Retrieve the component `LView` from component/element.
|
|
13738
|
-
*
|
|
13739
|
-
* NOTE: `LView` is a private and should not be leaked outside.
|
|
13740
|
-
* Don't export this method to `ng.*` on window.
|
|
13741
|
-
*
|
|
13742
|
-
* @param target DOM element or component instance for which to retrieve the LView.
|
|
13743
|
-
*/
|
|
13744
|
-
function getComponentLView(target) {
|
|
13745
|
-
const lContext = getLContext(target);
|
|
13746
|
-
const nodeIndx = lContext.nodeIndex;
|
|
13747
|
-
const lView = lContext.lView;
|
|
13748
|
-
ngDevMode && assertLView(lView);
|
|
13749
|
-
const componentLView = lView[nodeIndx];
|
|
13750
|
-
ngDevMode && assertLView(componentLView);
|
|
13751
|
-
return componentLView;
|
|
13752
13615
|
}
|
|
13753
|
-
|
|
13754
|
-
function
|
|
13755
|
-
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
13756
|
-
throw new Error('Expecting instance of DOM Element');
|
|
13757
|
-
}
|
|
13616
|
+
function isJsObject(o) {
|
|
13617
|
+
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
13758
13618
|
}
|
|
13759
13619
|
|
|
13760
13620
|
/**
|
|
@@ -13764,18 +13624,22 @@ function assertDomElement(value) {
|
|
|
13764
13624
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13765
13625
|
* found in the LICENSE file at https://angular.io/license
|
|
13766
13626
|
*/
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13627
|
+
function devModeEqual(a, b) {
|
|
13628
|
+
const isListLikeIterableA = isListLikeIterable(a);
|
|
13629
|
+
const isListLikeIterableB = isListLikeIterable(b);
|
|
13630
|
+
if (isListLikeIterableA && isListLikeIterableB) {
|
|
13631
|
+
return areIterablesEqual(a, b, devModeEqual);
|
|
13632
|
+
}
|
|
13633
|
+
else {
|
|
13634
|
+
const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
|
13635
|
+
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
13636
|
+
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
13637
|
+
return true;
|
|
13638
|
+
}
|
|
13639
|
+
else {
|
|
13640
|
+
return Object.is(a, b);
|
|
13641
|
+
}
|
|
13642
|
+
}
|
|
13779
13643
|
}
|
|
13780
13644
|
|
|
13781
13645
|
/**
|
|
@@ -13785,70 +13649,73 @@ function applyChanges(component) {
|
|
|
13785
13649
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13786
13650
|
* found in the LICENSE file at https://angular.io/license
|
|
13787
13651
|
*/
|
|
13652
|
+
// TODO(misko): consider inlining
|
|
13653
|
+
/** Updates binding and returns the value. */
|
|
13654
|
+
function updateBinding(lView, bindingIndex, value) {
|
|
13655
|
+
return lView[bindingIndex] = value;
|
|
13656
|
+
}
|
|
13657
|
+
/** Gets the current binding value. */
|
|
13658
|
+
function getBinding(lView, bindingIndex) {
|
|
13659
|
+
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
13660
|
+
ngDevMode &&
|
|
13661
|
+
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
13662
|
+
return lView[bindingIndex];
|
|
13663
|
+
}
|
|
13788
13664
|
/**
|
|
13789
|
-
*
|
|
13790
|
-
* to allow for the Angular debugging story to function.
|
|
13791
|
-
*
|
|
13792
|
-
* To see this in action run the following command:
|
|
13793
|
-
*
|
|
13794
|
-
* bazel run //packages/core/test/bundling/todo:devserver
|
|
13665
|
+
* Updates binding if changed, then returns whether it was updated.
|
|
13795
13666
|
*
|
|
13796
|
-
*
|
|
13797
|
-
|
|
13798
|
-
|
|
13799
|
-
* This value reflects the property on the window where the dev
|
|
13800
|
-
* tools are patched (window.ng).
|
|
13801
|
-
* */
|
|
13802
|
-
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
13803
|
-
let _published = false;
|
|
13804
|
-
/**
|
|
13805
|
-
* Publishes a collection of default debug tools onto`window.ng`.
|
|
13667
|
+
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
13668
|
+
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
13669
|
+
* behavior.
|
|
13806
13670
|
*
|
|
13807
|
-
*
|
|
13808
|
-
*
|
|
13671
|
+
* @param lView current `LView`
|
|
13672
|
+
* @param bindingIndex The binding in the `LView` to check
|
|
13673
|
+
* @param value New value to check against `lView[bindingIndex]`
|
|
13674
|
+
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
13675
|
+
* `CheckNoChangesMode`)
|
|
13809
13676
|
*/
|
|
13810
|
-
function
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
*/
|
|
13818
|
-
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
13819
|
-
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
13820
|
-
publishGlobalUtil('getComponent', getComponent$1);
|
|
13821
|
-
publishGlobalUtil('getContext', getContext);
|
|
13822
|
-
publishGlobalUtil('getListeners', getListeners);
|
|
13823
|
-
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
13824
|
-
publishGlobalUtil('getHostElement', getHostElement);
|
|
13825
|
-
publishGlobalUtil('getInjector', getInjector);
|
|
13826
|
-
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
13827
|
-
publishGlobalUtil('getDirectives', getDirectives);
|
|
13828
|
-
publishGlobalUtil('applyChanges', applyChanges);
|
|
13677
|
+
function bindingUpdated(lView, bindingIndex, value) {
|
|
13678
|
+
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
13679
|
+
ngDevMode &&
|
|
13680
|
+
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
13681
|
+
const oldValue = lView[bindingIndex];
|
|
13682
|
+
if (Object.is(oldValue, value)) {
|
|
13683
|
+
return false;
|
|
13829
13684
|
}
|
|
13830
|
-
|
|
13831
|
-
|
|
13832
|
-
|
|
13833
|
-
|
|
13834
|
-
|
|
13835
|
-
|
|
13836
|
-
|
|
13837
|
-
|
|
13838
|
-
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
13839
|
-
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
13840
|
-
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
13841
|
-
const w = _global;
|
|
13842
|
-
ngDevMode && assertDefined(fn, 'function not defined');
|
|
13843
|
-
if (w) {
|
|
13844
|
-
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
13845
|
-
if (!container) {
|
|
13846
|
-
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
13685
|
+
else {
|
|
13686
|
+
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
13687
|
+
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
13688
|
+
// (before the change detection was run).
|
|
13689
|
+
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
13690
|
+
if (!devModeEqual(oldValueToCompare, value)) {
|
|
13691
|
+
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
13692
|
+
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
13847
13693
|
}
|
|
13848
|
-
|
|
13694
|
+
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
13695
|
+
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
13696
|
+
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
13697
|
+
// as change on next CD.)
|
|
13698
|
+
return false;
|
|
13849
13699
|
}
|
|
13700
|
+
lView[bindingIndex] = value;
|
|
13701
|
+
return true;
|
|
13850
13702
|
}
|
|
13851
13703
|
}
|
|
13704
|
+
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
13705
|
+
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
13706
|
+
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
13707
|
+
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
13708
|
+
}
|
|
13709
|
+
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
13710
|
+
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
13711
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13712
|
+
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
13713
|
+
}
|
|
13714
|
+
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
13715
|
+
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
13716
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13717
|
+
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
13718
|
+
}
|
|
13852
13719
|
|
|
13853
13720
|
/**
|
|
13854
13721
|
* @license
|
|
@@ -13857,981 +13724,377 @@ function publishGlobalUtil(name, fn) {
|
|
|
13857
13724
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13858
13725
|
* found in the LICENSE file at https://angular.io/license
|
|
13859
13726
|
*/
|
|
13860
|
-
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13861
|
-
const NULL_INJECTOR = {
|
|
13862
|
-
get: (token, notFoundValue) => {
|
|
13863
|
-
throwProviderNotFoundError(token, 'NullInjector');
|
|
13864
|
-
}
|
|
13865
|
-
};
|
|
13866
13727
|
/**
|
|
13867
|
-
*
|
|
13868
|
-
*
|
|
13728
|
+
* Updates the value of or removes a bound attribute on an Element.
|
|
13729
|
+
*
|
|
13730
|
+
* Used in the case of `[attr.title]="value"`
|
|
13869
13731
|
*
|
|
13870
|
-
*
|
|
13871
|
-
*
|
|
13872
|
-
*
|
|
13873
|
-
*
|
|
13874
|
-
*
|
|
13732
|
+
* @param name name The name of the attribute.
|
|
13733
|
+
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
13734
|
+
* Otherwise the attribute value is set to the stringified value.
|
|
13735
|
+
* @param sanitizer An optional function used to sanitize the value.
|
|
13736
|
+
* @param namespace Optional namespace to use when setting the attribute.
|
|
13875
13737
|
*
|
|
13876
|
-
* @
|
|
13877
|
-
* @param options Optional parameters which control bootstrapping
|
|
13738
|
+
* @codeGenApi
|
|
13878
13739
|
*/
|
|
13879
|
-
function
|
|
13880
|
-
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
componentDef.type = componentType;
|
|
13888
|
-
// The first index of the first selector is the tag name.
|
|
13889
|
-
const componentTag = componentDef.selectors[0][0];
|
|
13890
|
-
const hostRenderer = rendererFactory.createRenderer(null, null);
|
|
13891
|
-
const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
|
|
13892
|
-
const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
13893
|
-
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
13894
|
-
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
13895
|
-
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
13896
|
-
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
13897
|
-
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
13898
|
-
enterView(rootView);
|
|
13899
|
-
let component;
|
|
13900
|
-
try {
|
|
13901
|
-
if (rendererFactory.begin)
|
|
13902
|
-
rendererFactory.begin();
|
|
13903
|
-
const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
|
|
13904
|
-
component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
|
|
13905
|
-
// create mode pass
|
|
13906
|
-
renderView(rootTView, rootView, null);
|
|
13907
|
-
// update mode pass
|
|
13908
|
-
refreshView(rootTView, rootView, null, null);
|
|
13909
|
-
}
|
|
13910
|
-
finally {
|
|
13911
|
-
leaveView();
|
|
13912
|
-
if (rendererFactory.end)
|
|
13913
|
-
rendererFactory.end();
|
|
13740
|
+
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
13741
|
+
const lView = getLView();
|
|
13742
|
+
const bindingIndex = nextBindingIndex();
|
|
13743
|
+
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
13744
|
+
const tView = getTView();
|
|
13745
|
+
const tNode = getSelectedTNode();
|
|
13746
|
+
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
13747
|
+
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
13914
13748
|
}
|
|
13915
|
-
return
|
|
13749
|
+
return ɵɵattribute;
|
|
13916
13750
|
}
|
|
13751
|
+
|
|
13917
13752
|
/**
|
|
13918
|
-
*
|
|
13919
|
-
*
|
|
13920
|
-
* @param rNode Render host element.
|
|
13921
|
-
* @param def ComponentDef
|
|
13922
|
-
* @param rootView The parent view where the host node is stored
|
|
13923
|
-
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13924
|
-
* @param hostRenderer The current renderer
|
|
13925
|
-
* @param sanitizer The sanitizer, if provided
|
|
13753
|
+
* @license
|
|
13754
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13926
13755
|
*
|
|
13927
|
-
*
|
|
13756
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13757
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13928
13758
|
*/
|
|
13929
|
-
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13930
|
-
const tView = rootView[TVIEW];
|
|
13931
|
-
const index = HEADER_OFFSET;
|
|
13932
|
-
ngDevMode && assertIndexInRange(rootView, index);
|
|
13933
|
-
rootView[index] = rNode;
|
|
13934
|
-
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13935
|
-
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13936
|
-
// representing a host element.
|
|
13937
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13938
|
-
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13939
|
-
if (mergedAttrs !== null) {
|
|
13940
|
-
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13941
|
-
if (rNode !== null) {
|
|
13942
|
-
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13943
|
-
if (tNode.classes !== null) {
|
|
13944
|
-
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13945
|
-
}
|
|
13946
|
-
if (tNode.styles !== null) {
|
|
13947
|
-
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13948
|
-
}
|
|
13949
|
-
}
|
|
13950
|
-
}
|
|
13951
|
-
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13952
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13953
|
-
if (tView.firstCreatePass) {
|
|
13954
|
-
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13955
|
-
markAsComponentHost(tView, tNode);
|
|
13956
|
-
initTNodeFlags(tNode, rootView.length, 1);
|
|
13957
|
-
}
|
|
13958
|
-
addToViewTree(rootView, componentView);
|
|
13959
|
-
// Store component view at node index, with node as the HOST
|
|
13960
|
-
return rootView[index] = componentView;
|
|
13961
|
-
}
|
|
13962
13759
|
/**
|
|
13963
|
-
*
|
|
13964
|
-
*
|
|
13760
|
+
* Create interpolation bindings with a variable number of expressions.
|
|
13761
|
+
*
|
|
13762
|
+
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
13763
|
+
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
13764
|
+
*
|
|
13765
|
+
* `values`:
|
|
13766
|
+
* - has static text at even indexes,
|
|
13767
|
+
* - has evaluated expressions at odd indexes.
|
|
13768
|
+
*
|
|
13769
|
+
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
13965
13770
|
*/
|
|
13966
|
-
function
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
feature(component, componentDef);
|
|
13975
|
-
}
|
|
13771
|
+
function interpolationV(lView, values) {
|
|
13772
|
+
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
13773
|
+
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
13774
|
+
let isBindingUpdated = false;
|
|
13775
|
+
let bindingIndex = getBindingIndex();
|
|
13776
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13777
|
+
// Check if bindings (odd indexes) have changed
|
|
13778
|
+
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
13976
13779
|
}
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
const tNode = getCurrentTNode();
|
|
13981
|
-
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13982
|
-
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13780
|
+
setBindingIndex(bindingIndex);
|
|
13781
|
+
if (!isBindingUpdated) {
|
|
13782
|
+
return NO_CHANGE;
|
|
13983
13783
|
}
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
setSelectedIndex(rootTNode.index);
|
|
13989
|
-
const rootTView = rootLView[TVIEW];
|
|
13990
|
-
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13991
|
-
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13784
|
+
// Build the updated content
|
|
13785
|
+
let content = values[0];
|
|
13786
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13787
|
+
content += renderStringify(values[i]) + values[i + 1];
|
|
13992
13788
|
}
|
|
13993
|
-
return
|
|
13994
|
-
}
|
|
13995
|
-
function createRootContext(scheduler, playerHandler) {
|
|
13996
|
-
return {
|
|
13997
|
-
components: [],
|
|
13998
|
-
scheduler: scheduler || defaultScheduler,
|
|
13999
|
-
clean: CLEAN_PROMISE,
|
|
14000
|
-
playerHandler: playerHandler || null,
|
|
14001
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
14002
|
-
};
|
|
13789
|
+
return content;
|
|
14003
13790
|
}
|
|
14004
13791
|
/**
|
|
14005
|
-
*
|
|
14006
|
-
*
|
|
14007
|
-
* Include this feature when calling `renderComponent` if the root component
|
|
14008
|
-
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
14009
|
-
* be called properly.
|
|
14010
|
-
*
|
|
14011
|
-
* Example:
|
|
13792
|
+
* Creates an interpolation binding with 1 expression.
|
|
14012
13793
|
*
|
|
14013
|
-
*
|
|
14014
|
-
*
|
|
14015
|
-
*
|
|
13794
|
+
* @param prefix static value used for concatenation only.
|
|
13795
|
+
* @param v0 value checked for change.
|
|
13796
|
+
* @param suffix static value used for concatenation only.
|
|
14016
13797
|
*/
|
|
14017
|
-
function
|
|
14018
|
-
const
|
|
14019
|
-
|
|
14020
|
-
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13798
|
+
function interpolation1(lView, prefix, v0, suffix) {
|
|
13799
|
+
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
13800
|
+
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14021
13801
|
}
|
|
14022
13802
|
/**
|
|
14023
|
-
*
|
|
14024
|
-
*
|
|
14025
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14026
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14027
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14028
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14029
|
-
*
|
|
14030
|
-
* Example:
|
|
14031
|
-
* ```
|
|
14032
|
-
* await whenRendered(myComponent);
|
|
14033
|
-
* ```
|
|
14034
|
-
*
|
|
14035
|
-
* @param component Component to wait upon
|
|
14036
|
-
* @returns Promise which resolves when the component is rendered.
|
|
13803
|
+
* Creates an interpolation binding with 2 expressions.
|
|
14037
13804
|
*/
|
|
14038
|
-
function
|
|
14039
|
-
|
|
13805
|
+
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
13806
|
+
const bindingIndex = getBindingIndex();
|
|
13807
|
+
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
13808
|
+
incrementBindingIndex(2);
|
|
13809
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14040
13810
|
}
|
|
14041
|
-
|
|
14042
13811
|
/**
|
|
14043
|
-
*
|
|
14044
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14045
|
-
*
|
|
14046
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14047
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13812
|
+
* Creates an interpolation binding with 3 expressions.
|
|
14048
13813
|
*/
|
|
14049
|
-
function
|
|
14050
|
-
|
|
13814
|
+
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
13815
|
+
const bindingIndex = getBindingIndex();
|
|
13816
|
+
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
13817
|
+
incrementBindingIndex(3);
|
|
13818
|
+
return different ?
|
|
13819
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
13820
|
+
NO_CHANGE;
|
|
14051
13821
|
}
|
|
14052
13822
|
/**
|
|
14053
|
-
*
|
|
14054
|
-
* @param definition The definition that is a SubClass of another directive of component
|
|
14055
|
-
*
|
|
14056
|
-
* @codeGenApi
|
|
13823
|
+
* Create an interpolation binding with 4 expressions.
|
|
14057
13824
|
*/
|
|
14058
|
-
function
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14066
|
-
superDef = superType.ɵcmp || superType.ɵdir;
|
|
14067
|
-
}
|
|
14068
|
-
else {
|
|
14069
|
-
if (superType.ɵcmp) {
|
|
14070
|
-
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
14071
|
-
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
14072
|
-
}
|
|
14073
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14074
|
-
superDef = superType.ɵdir;
|
|
14075
|
-
}
|
|
14076
|
-
if (superDef) {
|
|
14077
|
-
if (shouldInheritFields) {
|
|
14078
|
-
inheritanceChain.push(superDef);
|
|
14079
|
-
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
14080
|
-
// would've justified object creation. Unwrap them if necessary.
|
|
14081
|
-
const writeableDef = definition;
|
|
14082
|
-
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
14083
|
-
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
14084
|
-
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
14085
|
-
// Merge hostBindings
|
|
14086
|
-
const superHostBindings = superDef.hostBindings;
|
|
14087
|
-
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
14088
|
-
// Merge queries
|
|
14089
|
-
const superViewQuery = superDef.viewQuery;
|
|
14090
|
-
const superContentQueries = superDef.contentQueries;
|
|
14091
|
-
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
14092
|
-
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
14093
|
-
// Merge inputs and outputs
|
|
14094
|
-
fillProperties(definition.inputs, superDef.inputs);
|
|
14095
|
-
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
14096
|
-
fillProperties(definition.outputs, superDef.outputs);
|
|
14097
|
-
// Merge animations metadata.
|
|
14098
|
-
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
14099
|
-
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
14100
|
-
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
14101
|
-
// not inherit Components (we throw an error above and cannot reach this code).
|
|
14102
|
-
const defData = definition.data;
|
|
14103
|
-
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
14104
|
-
}
|
|
14105
|
-
}
|
|
14106
|
-
// Run parent features
|
|
14107
|
-
const features = superDef.features;
|
|
14108
|
-
if (features) {
|
|
14109
|
-
for (let i = 0; i < features.length; i++) {
|
|
14110
|
-
const feature = features[i];
|
|
14111
|
-
if (feature && feature.ngInherit) {
|
|
14112
|
-
feature(definition);
|
|
14113
|
-
}
|
|
14114
|
-
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
14115
|
-
// def already has all the necessary information inherited from its super class(es), so we
|
|
14116
|
-
// can stop merging fields from super classes. However we need to iterate through the
|
|
14117
|
-
// prototype chain to look for classes that might contain other "features" (like
|
|
14118
|
-
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
14119
|
-
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
14120
|
-
// logic and only invoking functions from the "features" list.
|
|
14121
|
-
if (feature === ɵɵInheritDefinitionFeature) {
|
|
14122
|
-
shouldInheritFields = false;
|
|
14123
|
-
}
|
|
14124
|
-
}
|
|
14125
|
-
}
|
|
14126
|
-
}
|
|
14127
|
-
superType = Object.getPrototypeOf(superType);
|
|
14128
|
-
}
|
|
14129
|
-
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13825
|
+
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
13826
|
+
const bindingIndex = getBindingIndex();
|
|
13827
|
+
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13828
|
+
incrementBindingIndex(4);
|
|
13829
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13830
|
+
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
13831
|
+
NO_CHANGE;
|
|
14130
13832
|
}
|
|
14131
13833
|
/**
|
|
14132
|
-
*
|
|
14133
|
-
*
|
|
14134
|
-
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
14135
|
-
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
14136
|
-
* type.
|
|
13834
|
+
* Creates an interpolation binding with 5 expressions.
|
|
14137
13835
|
*/
|
|
14138
|
-
function
|
|
14139
|
-
|
|
14140
|
-
let
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
// for each `hostAttrs` we need to merge it with superclass.
|
|
14147
|
-
def.hostAttrs =
|
|
14148
|
-
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
14149
|
-
}
|
|
14150
|
-
}
|
|
14151
|
-
function maybeUnwrapEmpty(value) {
|
|
14152
|
-
if (value === EMPTY_OBJ) {
|
|
14153
|
-
return {};
|
|
14154
|
-
}
|
|
14155
|
-
else if (value === EMPTY_ARRAY) {
|
|
14156
|
-
return [];
|
|
14157
|
-
}
|
|
14158
|
-
else {
|
|
14159
|
-
return value;
|
|
14160
|
-
}
|
|
14161
|
-
}
|
|
14162
|
-
function inheritViewQuery(definition, superViewQuery) {
|
|
14163
|
-
const prevViewQuery = definition.viewQuery;
|
|
14164
|
-
if (prevViewQuery) {
|
|
14165
|
-
definition.viewQuery = (rf, ctx) => {
|
|
14166
|
-
superViewQuery(rf, ctx);
|
|
14167
|
-
prevViewQuery(rf, ctx);
|
|
14168
|
-
};
|
|
14169
|
-
}
|
|
14170
|
-
else {
|
|
14171
|
-
definition.viewQuery = superViewQuery;
|
|
14172
|
-
}
|
|
14173
|
-
}
|
|
14174
|
-
function inheritContentQueries(definition, superContentQueries) {
|
|
14175
|
-
const prevContentQueries = definition.contentQueries;
|
|
14176
|
-
if (prevContentQueries) {
|
|
14177
|
-
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
14178
|
-
superContentQueries(rf, ctx, directiveIndex);
|
|
14179
|
-
prevContentQueries(rf, ctx, directiveIndex);
|
|
14180
|
-
};
|
|
14181
|
-
}
|
|
14182
|
-
else {
|
|
14183
|
-
definition.contentQueries = superContentQueries;
|
|
14184
|
-
}
|
|
14185
|
-
}
|
|
14186
|
-
function inheritHostBindings(definition, superHostBindings) {
|
|
14187
|
-
const prevHostBindings = definition.hostBindings;
|
|
14188
|
-
if (prevHostBindings) {
|
|
14189
|
-
definition.hostBindings = (rf, ctx) => {
|
|
14190
|
-
superHostBindings(rf, ctx);
|
|
14191
|
-
prevHostBindings(rf, ctx);
|
|
14192
|
-
};
|
|
14193
|
-
}
|
|
14194
|
-
else {
|
|
14195
|
-
definition.hostBindings = superHostBindings;
|
|
14196
|
-
}
|
|
13836
|
+
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
13837
|
+
const bindingIndex = getBindingIndex();
|
|
13838
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13839
|
+
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
13840
|
+
incrementBindingIndex(5);
|
|
13841
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13842
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
13843
|
+
NO_CHANGE;
|
|
14197
13844
|
}
|
|
14198
|
-
|
|
14199
13845
|
/**
|
|
14200
|
-
*
|
|
14201
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14202
|
-
*
|
|
14203
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14204
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13846
|
+
* Creates an interpolation binding with 6 expressions.
|
|
14205
13847
|
*/
|
|
13848
|
+
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
13849
|
+
const bindingIndex = getBindingIndex();
|
|
13850
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13851
|
+
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
13852
|
+
incrementBindingIndex(6);
|
|
13853
|
+
return different ?
|
|
13854
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
13855
|
+
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
13856
|
+
NO_CHANGE;
|
|
13857
|
+
}
|
|
14206
13858
|
/**
|
|
14207
|
-
*
|
|
14208
|
-
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13859
|
+
* Creates an interpolation binding with 7 expressions.
|
|
14209
13860
|
*/
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
13861
|
+
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
13862
|
+
const bindingIndex = getBindingIndex();
|
|
13863
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13864
|
+
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
13865
|
+
incrementBindingIndex(7);
|
|
13866
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13867
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
13868
|
+
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
13869
|
+
NO_CHANGE;
|
|
13870
|
+
}
|
|
14216
13871
|
/**
|
|
14217
|
-
*
|
|
14218
|
-
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
14219
|
-
*
|
|
14220
|
-
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
14221
|
-
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13872
|
+
* Creates an interpolation binding with 8 expressions.
|
|
14222
13873
|
*/
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
'encapsulation',
|
|
14235
|
-
// The child class should be checked by the runtime in the same way as its parent.
|
|
14236
|
-
'schemas',
|
|
14237
|
-
];
|
|
13874
|
+
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
13875
|
+
const bindingIndex = getBindingIndex();
|
|
13876
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13877
|
+
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
13878
|
+
incrementBindingIndex(8);
|
|
13879
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13880
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
13881
|
+
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
13882
|
+
NO_CHANGE;
|
|
13883
|
+
}
|
|
13884
|
+
|
|
14238
13885
|
/**
|
|
14239
|
-
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
14240
|
-
* definition.
|
|
14241
13886
|
*
|
|
14242
|
-
*
|
|
14243
|
-
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
14244
|
-
* generates a skeleton definition on the child class, and applies this feature.
|
|
13887
|
+
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14245
13888
|
*
|
|
14246
|
-
*
|
|
14247
|
-
* including things like the component template function.
|
|
13889
|
+
* Used when the value passed to a property has 1 interpolated value in it:
|
|
14248
13890
|
*
|
|
14249
|
-
*
|
|
14250
|
-
*
|
|
13891
|
+
* ```html
|
|
13892
|
+
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
13893
|
+
* ```
|
|
14251
13894
|
*
|
|
14252
|
-
*
|
|
14253
|
-
*/
|
|
14254
|
-
function ɵɵCopyDefinitionFeature(definition) {
|
|
14255
|
-
let superType = getSuperType(definition.type);
|
|
14256
|
-
let superDef = undefined;
|
|
14257
|
-
if (isComponentDef(definition)) {
|
|
14258
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14259
|
-
superDef = superType.ɵcmp;
|
|
14260
|
-
}
|
|
14261
|
-
else {
|
|
14262
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14263
|
-
superDef = superType.ɵdir;
|
|
14264
|
-
}
|
|
14265
|
-
// Needed because `definition` fields are readonly.
|
|
14266
|
-
const defAny = definition;
|
|
14267
|
-
// Copy over any fields that apply to either directives or components.
|
|
14268
|
-
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
14269
|
-
defAny[field] = superDef[field];
|
|
14270
|
-
}
|
|
14271
|
-
if (isComponentDef(superDef)) {
|
|
14272
|
-
// Copy over any component-specific fields.
|
|
14273
|
-
for (const field of COPY_COMPONENT_FIELDS) {
|
|
14274
|
-
defAny[field] = superDef[field];
|
|
14275
|
-
}
|
|
14276
|
-
}
|
|
14277
|
-
}
|
|
14278
|
-
|
|
14279
|
-
/**
|
|
14280
|
-
* @license
|
|
14281
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13895
|
+
* Its compiled representation is::
|
|
14282
13896
|
*
|
|
14283
|
-
*
|
|
14284
|
-
*
|
|
13897
|
+
* ```ts
|
|
13898
|
+
* ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
|
|
13899
|
+
* ```
|
|
13900
|
+
*
|
|
13901
|
+
* @param attrName The name of the attribute to update
|
|
13902
|
+
* @param prefix Static value used for concatenation only.
|
|
13903
|
+
* @param v0 Value checked for change.
|
|
13904
|
+
* @param suffix Static value used for concatenation only.
|
|
13905
|
+
* @param sanitizer An optional sanitizer function
|
|
13906
|
+
* @returns itself, so that it may be chained.
|
|
13907
|
+
* @codeGenApi
|
|
14285
13908
|
*/
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
// es6-shim specific logic
|
|
14295
|
-
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
14296
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
14297
|
-
const key = keys[i];
|
|
14298
|
-
if (key !== 'entries' && key !== 'size' &&
|
|
14299
|
-
Map.prototype[key] === Map.prototype['entries']) {
|
|
14300
|
-
_symbolIterator = key;
|
|
14301
|
-
}
|
|
14302
|
-
}
|
|
14303
|
-
}
|
|
13909
|
+
function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
|
|
13910
|
+
const lView = getLView();
|
|
13911
|
+
const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
|
|
13912
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13913
|
+
const tNode = getSelectedTNode();
|
|
13914
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13915
|
+
ngDevMode &&
|
|
13916
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
|
|
14304
13917
|
}
|
|
14305
|
-
return
|
|
13918
|
+
return ɵɵattributeInterpolate1;
|
|
14306
13919
|
}
|
|
14307
|
-
|
|
14308
13920
|
/**
|
|
14309
|
-
* @license
|
|
14310
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14311
13921
|
*
|
|
14312
|
-
*
|
|
14313
|
-
*
|
|
13922
|
+
* Update an interpolated attribute on an element with 2 bound values surrounded by text.
|
|
13923
|
+
*
|
|
13924
|
+
* Used when the value passed to a property has 2 interpolated values in it:
|
|
13925
|
+
*
|
|
13926
|
+
* ```html
|
|
13927
|
+
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
13928
|
+
* ```
|
|
13929
|
+
*
|
|
13930
|
+
* Its compiled representation is::
|
|
13931
|
+
*
|
|
13932
|
+
* ```ts
|
|
13933
|
+
* ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
|
|
13934
|
+
* ```
|
|
13935
|
+
*
|
|
13936
|
+
* @param attrName The name of the attribute to update
|
|
13937
|
+
* @param prefix Static value used for concatenation only.
|
|
13938
|
+
* @param v0 Value checked for change.
|
|
13939
|
+
* @param i0 Static value used for concatenation only.
|
|
13940
|
+
* @param v1 Value checked for change.
|
|
13941
|
+
* @param suffix Static value used for concatenation only.
|
|
13942
|
+
* @param sanitizer An optional sanitizer function
|
|
13943
|
+
* @returns itself, so that it may be chained.
|
|
13944
|
+
* @codeGenApi
|
|
14314
13945
|
*/
|
|
14315
|
-
function
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
14324
|
-
}
|
|
14325
|
-
function areIterablesEqual(a, b, comparator) {
|
|
14326
|
-
const iterator1 = a[getSymbolIterator()]();
|
|
14327
|
-
const iterator2 = b[getSymbolIterator()]();
|
|
14328
|
-
while (true) {
|
|
14329
|
-
const item1 = iterator1.next();
|
|
14330
|
-
const item2 = iterator2.next();
|
|
14331
|
-
if (item1.done && item2.done)
|
|
14332
|
-
return true;
|
|
14333
|
-
if (item1.done || item2.done)
|
|
14334
|
-
return false;
|
|
14335
|
-
if (!comparator(item1.value, item2.value))
|
|
14336
|
-
return false;
|
|
14337
|
-
}
|
|
14338
|
-
}
|
|
14339
|
-
function iterateListLike(obj, fn) {
|
|
14340
|
-
if (Array.isArray(obj)) {
|
|
14341
|
-
for (let i = 0; i < obj.length; i++) {
|
|
14342
|
-
fn(obj[i]);
|
|
14343
|
-
}
|
|
14344
|
-
}
|
|
14345
|
-
else {
|
|
14346
|
-
const iterator = obj[getSymbolIterator()]();
|
|
14347
|
-
let item;
|
|
14348
|
-
while (!((item = iterator.next()).done)) {
|
|
14349
|
-
fn(item.value);
|
|
14350
|
-
}
|
|
13946
|
+
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
13947
|
+
const lView = getLView();
|
|
13948
|
+
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
13949
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13950
|
+
const tNode = getSelectedTNode();
|
|
13951
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13952
|
+
ngDevMode &&
|
|
13953
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14351
13954
|
}
|
|
13955
|
+
return ɵɵattributeInterpolate2;
|
|
14352
13956
|
}
|
|
14353
|
-
function isJsObject(o) {
|
|
14354
|
-
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
14355
|
-
}
|
|
14356
|
-
|
|
14357
13957
|
/**
|
|
14358
|
-
* @license
|
|
14359
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14360
13958
|
*
|
|
14361
|
-
*
|
|
14362
|
-
*
|
|
13959
|
+
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
13960
|
+
*
|
|
13961
|
+
* Used when the value passed to a property has 3 interpolated values in it:
|
|
13962
|
+
*
|
|
13963
|
+
* ```html
|
|
13964
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
13965
|
+
* ```
|
|
13966
|
+
*
|
|
13967
|
+
* Its compiled representation is::
|
|
13968
|
+
*
|
|
13969
|
+
* ```ts
|
|
13970
|
+
* ɵɵattributeInterpolate3(
|
|
13971
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
13972
|
+
* ```
|
|
13973
|
+
*
|
|
13974
|
+
* @param attrName The name of the attribute to update
|
|
13975
|
+
* @param prefix Static value used for concatenation only.
|
|
13976
|
+
* @param v0 Value checked for change.
|
|
13977
|
+
* @param i0 Static value used for concatenation only.
|
|
13978
|
+
* @param v1 Value checked for change.
|
|
13979
|
+
* @param i1 Static value used for concatenation only.
|
|
13980
|
+
* @param v2 Value checked for change.
|
|
13981
|
+
* @param suffix Static value used for concatenation only.
|
|
13982
|
+
* @param sanitizer An optional sanitizer function
|
|
13983
|
+
* @returns itself, so that it may be chained.
|
|
13984
|
+
* @codeGenApi
|
|
14363
13985
|
*/
|
|
14364
|
-
function
|
|
14365
|
-
const
|
|
14366
|
-
const
|
|
14367
|
-
if (
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
14373
|
-
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
14374
|
-
return true;
|
|
14375
|
-
}
|
|
14376
|
-
else {
|
|
14377
|
-
return Object.is(a, b);
|
|
14378
|
-
}
|
|
13986
|
+
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
13987
|
+
const lView = getLView();
|
|
13988
|
+
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
13989
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13990
|
+
const tNode = getSelectedTNode();
|
|
13991
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13992
|
+
ngDevMode &&
|
|
13993
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14379
13994
|
}
|
|
13995
|
+
return ɵɵattributeInterpolate3;
|
|
14380
13996
|
}
|
|
14381
|
-
|
|
14382
13997
|
/**
|
|
14383
|
-
* @license
|
|
14384
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14385
13998
|
*
|
|
14386
|
-
*
|
|
14387
|
-
*
|
|
13999
|
+
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14000
|
+
*
|
|
14001
|
+
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14002
|
+
*
|
|
14003
|
+
* ```html
|
|
14004
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14005
|
+
* ```
|
|
14006
|
+
*
|
|
14007
|
+
* Its compiled representation is::
|
|
14008
|
+
*
|
|
14009
|
+
* ```ts
|
|
14010
|
+
* ɵɵattributeInterpolate4(
|
|
14011
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14012
|
+
* ```
|
|
14013
|
+
*
|
|
14014
|
+
* @param attrName The name of the attribute to update
|
|
14015
|
+
* @param prefix Static value used for concatenation only.
|
|
14016
|
+
* @param v0 Value checked for change.
|
|
14017
|
+
* @param i0 Static value used for concatenation only.
|
|
14018
|
+
* @param v1 Value checked for change.
|
|
14019
|
+
* @param i1 Static value used for concatenation only.
|
|
14020
|
+
* @param v2 Value checked for change.
|
|
14021
|
+
* @param i2 Static value used for concatenation only.
|
|
14022
|
+
* @param v3 Value checked for change.
|
|
14023
|
+
* @param suffix Static value used for concatenation only.
|
|
14024
|
+
* @param sanitizer An optional sanitizer function
|
|
14025
|
+
* @returns itself, so that it may be chained.
|
|
14026
|
+
* @codeGenApi
|
|
14388
14027
|
*/
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
return lView[bindingIndex];
|
|
14028
|
+
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14029
|
+
const lView = getLView();
|
|
14030
|
+
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14031
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
14032
|
+
const tNode = getSelectedTNode();
|
|
14033
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14034
|
+
ngDevMode &&
|
|
14035
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14036
|
+
}
|
|
14037
|
+
return ɵɵattributeInterpolate4;
|
|
14400
14038
|
}
|
|
14401
14039
|
/**
|
|
14402
|
-
* Updates binding if changed, then returns whether it was updated.
|
|
14403
14040
|
*
|
|
14404
|
-
*
|
|
14405
|
-
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
14406
|
-
* behavior.
|
|
14407
|
-
*
|
|
14408
|
-
* @param lView current `LView`
|
|
14409
|
-
* @param bindingIndex The binding in the `LView` to check
|
|
14410
|
-
* @param value New value to check against `lView[bindingIndex]`
|
|
14411
|
-
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
14412
|
-
* `CheckNoChangesMode`)
|
|
14413
|
-
*/
|
|
14414
|
-
function bindingUpdated(lView, bindingIndex, value) {
|
|
14415
|
-
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
14416
|
-
ngDevMode &&
|
|
14417
|
-
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
14418
|
-
const oldValue = lView[bindingIndex];
|
|
14419
|
-
if (Object.is(oldValue, value)) {
|
|
14420
|
-
return false;
|
|
14421
|
-
}
|
|
14422
|
-
else {
|
|
14423
|
-
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
14424
|
-
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
14425
|
-
// (before the change detection was run).
|
|
14426
|
-
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
14427
|
-
if (!devModeEqual(oldValueToCompare, value)) {
|
|
14428
|
-
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
14429
|
-
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
14430
|
-
}
|
|
14431
|
-
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
14432
|
-
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
14433
|
-
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
14434
|
-
// as change on next CD.)
|
|
14435
|
-
return false;
|
|
14436
|
-
}
|
|
14437
|
-
lView[bindingIndex] = value;
|
|
14438
|
-
return true;
|
|
14439
|
-
}
|
|
14440
|
-
}
|
|
14441
|
-
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
14442
|
-
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
14443
|
-
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
14444
|
-
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
14445
|
-
}
|
|
14446
|
-
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
14447
|
-
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
14448
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14449
|
-
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
14450
|
-
}
|
|
14451
|
-
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
14452
|
-
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
14453
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14454
|
-
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
14455
|
-
}
|
|
14456
|
-
|
|
14457
|
-
/**
|
|
14458
|
-
* @license
|
|
14459
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14460
|
-
*
|
|
14461
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14462
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14463
|
-
*/
|
|
14464
|
-
/**
|
|
14465
|
-
* Updates the value of or removes a bound attribute on an Element.
|
|
14466
|
-
*
|
|
14467
|
-
* Used in the case of `[attr.title]="value"`
|
|
14468
|
-
*
|
|
14469
|
-
* @param name name The name of the attribute.
|
|
14470
|
-
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
14471
|
-
* Otherwise the attribute value is set to the stringified value.
|
|
14472
|
-
* @param sanitizer An optional function used to sanitize the value.
|
|
14473
|
-
* @param namespace Optional namespace to use when setting the attribute.
|
|
14474
|
-
*
|
|
14475
|
-
* @codeGenApi
|
|
14476
|
-
*/
|
|
14477
|
-
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
14478
|
-
const lView = getLView();
|
|
14479
|
-
const bindingIndex = nextBindingIndex();
|
|
14480
|
-
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
14481
|
-
const tView = getTView();
|
|
14482
|
-
const tNode = getSelectedTNode();
|
|
14483
|
-
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
14484
|
-
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
14485
|
-
}
|
|
14486
|
-
return ɵɵattribute;
|
|
14487
|
-
}
|
|
14488
|
-
|
|
14489
|
-
/**
|
|
14490
|
-
* @license
|
|
14491
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14492
|
-
*
|
|
14493
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14494
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14495
|
-
*/
|
|
14496
|
-
/**
|
|
14497
|
-
* Create interpolation bindings with a variable number of expressions.
|
|
14498
|
-
*
|
|
14499
|
-
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
14500
|
-
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
14501
|
-
*
|
|
14502
|
-
* `values`:
|
|
14503
|
-
* - has static text at even indexes,
|
|
14504
|
-
* - has evaluated expressions at odd indexes.
|
|
14505
|
-
*
|
|
14506
|
-
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
14507
|
-
*/
|
|
14508
|
-
function interpolationV(lView, values) {
|
|
14509
|
-
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
14510
|
-
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
14511
|
-
let isBindingUpdated = false;
|
|
14512
|
-
let bindingIndex = getBindingIndex();
|
|
14513
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14514
|
-
// Check if bindings (odd indexes) have changed
|
|
14515
|
-
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
14516
|
-
}
|
|
14517
|
-
setBindingIndex(bindingIndex);
|
|
14518
|
-
if (!isBindingUpdated) {
|
|
14519
|
-
return NO_CHANGE;
|
|
14520
|
-
}
|
|
14521
|
-
// Build the updated content
|
|
14522
|
-
let content = values[0];
|
|
14523
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14524
|
-
content += renderStringify(values[i]) + values[i + 1];
|
|
14525
|
-
}
|
|
14526
|
-
return content;
|
|
14527
|
-
}
|
|
14528
|
-
/**
|
|
14529
|
-
* Creates an interpolation binding with 1 expression.
|
|
14530
|
-
*
|
|
14531
|
-
* @param prefix static value used for concatenation only.
|
|
14532
|
-
* @param v0 value checked for change.
|
|
14533
|
-
* @param suffix static value used for concatenation only.
|
|
14534
|
-
*/
|
|
14535
|
-
function interpolation1(lView, prefix, v0, suffix) {
|
|
14536
|
-
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
14537
|
-
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14538
|
-
}
|
|
14539
|
-
/**
|
|
14540
|
-
* Creates an interpolation binding with 2 expressions.
|
|
14541
|
-
*/
|
|
14542
|
-
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
14543
|
-
const bindingIndex = getBindingIndex();
|
|
14544
|
-
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
14545
|
-
incrementBindingIndex(2);
|
|
14546
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14547
|
-
}
|
|
14548
|
-
/**
|
|
14549
|
-
* Creates an interpolation binding with 3 expressions.
|
|
14550
|
-
*/
|
|
14551
|
-
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
14552
|
-
const bindingIndex = getBindingIndex();
|
|
14553
|
-
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
14554
|
-
incrementBindingIndex(3);
|
|
14555
|
-
return different ?
|
|
14556
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
14557
|
-
NO_CHANGE;
|
|
14558
|
-
}
|
|
14559
|
-
/**
|
|
14560
|
-
* Create an interpolation binding with 4 expressions.
|
|
14561
|
-
*/
|
|
14562
|
-
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
14563
|
-
const bindingIndex = getBindingIndex();
|
|
14564
|
-
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14565
|
-
incrementBindingIndex(4);
|
|
14566
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14567
|
-
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
14568
|
-
NO_CHANGE;
|
|
14569
|
-
}
|
|
14570
|
-
/**
|
|
14571
|
-
* Creates an interpolation binding with 5 expressions.
|
|
14572
|
-
*/
|
|
14573
|
-
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
14574
|
-
const bindingIndex = getBindingIndex();
|
|
14575
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14576
|
-
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
14577
|
-
incrementBindingIndex(5);
|
|
14578
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14579
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
14580
|
-
NO_CHANGE;
|
|
14581
|
-
}
|
|
14582
|
-
/**
|
|
14583
|
-
* Creates an interpolation binding with 6 expressions.
|
|
14584
|
-
*/
|
|
14585
|
-
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
14586
|
-
const bindingIndex = getBindingIndex();
|
|
14587
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14588
|
-
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
14589
|
-
incrementBindingIndex(6);
|
|
14590
|
-
return different ?
|
|
14591
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
14592
|
-
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
14593
|
-
NO_CHANGE;
|
|
14594
|
-
}
|
|
14595
|
-
/**
|
|
14596
|
-
* Creates an interpolation binding with 7 expressions.
|
|
14597
|
-
*/
|
|
14598
|
-
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
14599
|
-
const bindingIndex = getBindingIndex();
|
|
14600
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14601
|
-
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
14602
|
-
incrementBindingIndex(7);
|
|
14603
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14604
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14605
|
-
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
14606
|
-
NO_CHANGE;
|
|
14607
|
-
}
|
|
14608
|
-
/**
|
|
14609
|
-
* Creates an interpolation binding with 8 expressions.
|
|
14610
|
-
*/
|
|
14611
|
-
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
14612
|
-
const bindingIndex = getBindingIndex();
|
|
14613
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14614
|
-
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
14615
|
-
incrementBindingIndex(8);
|
|
14616
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14617
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14618
|
-
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
14619
|
-
NO_CHANGE;
|
|
14620
|
-
}
|
|
14621
|
-
|
|
14622
|
-
/**
|
|
14623
|
-
*
|
|
14624
|
-
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14041
|
+
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14625
14042
|
*
|
|
14626
|
-
* Used when the value passed to a property has
|
|
14043
|
+
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14627
14044
|
*
|
|
14628
14045
|
* ```html
|
|
14629
|
-
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
14046
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14630
14047
|
* ```
|
|
14631
14048
|
*
|
|
14632
14049
|
* Its compiled representation is::
|
|
14633
14050
|
*
|
|
14634
14051
|
* ```ts
|
|
14635
|
-
* ɵɵ
|
|
14052
|
+
* ɵɵattributeInterpolate5(
|
|
14053
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14636
14054
|
* ```
|
|
14637
14055
|
*
|
|
14638
14056
|
* @param attrName The name of the attribute to update
|
|
14639
14057
|
* @param prefix Static value used for concatenation only.
|
|
14640
14058
|
* @param v0 Value checked for change.
|
|
14059
|
+
* @param i0 Static value used for concatenation only.
|
|
14060
|
+
* @param v1 Value checked for change.
|
|
14061
|
+
* @param i1 Static value used for concatenation only.
|
|
14062
|
+
* @param v2 Value checked for change.
|
|
14063
|
+
* @param i2 Static value used for concatenation only.
|
|
14064
|
+
* @param v3 Value checked for change.
|
|
14065
|
+
* @param i3 Static value used for concatenation only.
|
|
14066
|
+
* @param v4 Value checked for change.
|
|
14641
14067
|
* @param suffix Static value used for concatenation only.
|
|
14642
14068
|
* @param sanitizer An optional sanitizer function
|
|
14643
14069
|
* @returns itself, so that it may be chained.
|
|
14644
14070
|
* @codeGenApi
|
|
14645
14071
|
*/
|
|
14646
|
-
function ɵɵ
|
|
14072
|
+
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14647
14073
|
const lView = getLView();
|
|
14648
|
-
const interpolatedValue =
|
|
14074
|
+
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14649
14075
|
if (interpolatedValue !== NO_CHANGE) {
|
|
14650
14076
|
const tNode = getSelectedTNode();
|
|
14651
14077
|
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14652
14078
|
ngDevMode &&
|
|
14653
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() -
|
|
14079
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14654
14080
|
}
|
|
14655
|
-
return ɵɵ
|
|
14081
|
+
return ɵɵattributeInterpolate5;
|
|
14656
14082
|
}
|
|
14657
14083
|
/**
|
|
14658
14084
|
*
|
|
14659
|
-
* Update an interpolated attribute on an element with
|
|
14085
|
+
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14660
14086
|
*
|
|
14661
|
-
* Used when the value passed to a property has
|
|
14087
|
+
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14662
14088
|
*
|
|
14663
14089
|
* ```html
|
|
14664
|
-
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
14090
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14665
14091
|
* ```
|
|
14666
14092
|
*
|
|
14667
14093
|
* Its compiled representation is::
|
|
14668
14094
|
*
|
|
14669
14095
|
* ```ts
|
|
14670
|
-
* ɵɵ
|
|
14671
|
-
*
|
|
14672
|
-
*
|
|
14673
|
-
* @param attrName The name of the attribute to update
|
|
14674
|
-
* @param prefix Static value used for concatenation only.
|
|
14675
|
-
* @param v0 Value checked for change.
|
|
14676
|
-
* @param i0 Static value used for concatenation only.
|
|
14677
|
-
* @param v1 Value checked for change.
|
|
14678
|
-
* @param suffix Static value used for concatenation only.
|
|
14679
|
-
* @param sanitizer An optional sanitizer function
|
|
14680
|
-
* @returns itself, so that it may be chained.
|
|
14681
|
-
* @codeGenApi
|
|
14682
|
-
*/
|
|
14683
|
-
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
14684
|
-
const lView = getLView();
|
|
14685
|
-
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
14686
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14687
|
-
const tNode = getSelectedTNode();
|
|
14688
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14689
|
-
ngDevMode &&
|
|
14690
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14691
|
-
}
|
|
14692
|
-
return ɵɵattributeInterpolate2;
|
|
14693
|
-
}
|
|
14694
|
-
/**
|
|
14695
|
-
*
|
|
14696
|
-
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
14697
|
-
*
|
|
14698
|
-
* Used when the value passed to a property has 3 interpolated values in it:
|
|
14699
|
-
*
|
|
14700
|
-
* ```html
|
|
14701
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
14702
|
-
* ```
|
|
14703
|
-
*
|
|
14704
|
-
* Its compiled representation is::
|
|
14705
|
-
*
|
|
14706
|
-
* ```ts
|
|
14707
|
-
* ɵɵattributeInterpolate3(
|
|
14708
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
14709
|
-
* ```
|
|
14710
|
-
*
|
|
14711
|
-
* @param attrName The name of the attribute to update
|
|
14712
|
-
* @param prefix Static value used for concatenation only.
|
|
14713
|
-
* @param v0 Value checked for change.
|
|
14714
|
-
* @param i0 Static value used for concatenation only.
|
|
14715
|
-
* @param v1 Value checked for change.
|
|
14716
|
-
* @param i1 Static value used for concatenation only.
|
|
14717
|
-
* @param v2 Value checked for change.
|
|
14718
|
-
* @param suffix Static value used for concatenation only.
|
|
14719
|
-
* @param sanitizer An optional sanitizer function
|
|
14720
|
-
* @returns itself, so that it may be chained.
|
|
14721
|
-
* @codeGenApi
|
|
14722
|
-
*/
|
|
14723
|
-
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14724
|
-
const lView = getLView();
|
|
14725
|
-
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14726
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14727
|
-
const tNode = getSelectedTNode();
|
|
14728
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14729
|
-
ngDevMode &&
|
|
14730
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14731
|
-
}
|
|
14732
|
-
return ɵɵattributeInterpolate3;
|
|
14733
|
-
}
|
|
14734
|
-
/**
|
|
14735
|
-
*
|
|
14736
|
-
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14737
|
-
*
|
|
14738
|
-
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14739
|
-
*
|
|
14740
|
-
* ```html
|
|
14741
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14742
|
-
* ```
|
|
14743
|
-
*
|
|
14744
|
-
* Its compiled representation is::
|
|
14745
|
-
*
|
|
14746
|
-
* ```ts
|
|
14747
|
-
* ɵɵattributeInterpolate4(
|
|
14748
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14749
|
-
* ```
|
|
14750
|
-
*
|
|
14751
|
-
* @param attrName The name of the attribute to update
|
|
14752
|
-
* @param prefix Static value used for concatenation only.
|
|
14753
|
-
* @param v0 Value checked for change.
|
|
14754
|
-
* @param i0 Static value used for concatenation only.
|
|
14755
|
-
* @param v1 Value checked for change.
|
|
14756
|
-
* @param i1 Static value used for concatenation only.
|
|
14757
|
-
* @param v2 Value checked for change.
|
|
14758
|
-
* @param i2 Static value used for concatenation only.
|
|
14759
|
-
* @param v3 Value checked for change.
|
|
14760
|
-
* @param suffix Static value used for concatenation only.
|
|
14761
|
-
* @param sanitizer An optional sanitizer function
|
|
14762
|
-
* @returns itself, so that it may be chained.
|
|
14763
|
-
* @codeGenApi
|
|
14764
|
-
*/
|
|
14765
|
-
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14766
|
-
const lView = getLView();
|
|
14767
|
-
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14768
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14769
|
-
const tNode = getSelectedTNode();
|
|
14770
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14771
|
-
ngDevMode &&
|
|
14772
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14773
|
-
}
|
|
14774
|
-
return ɵɵattributeInterpolate4;
|
|
14775
|
-
}
|
|
14776
|
-
/**
|
|
14777
|
-
*
|
|
14778
|
-
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14779
|
-
*
|
|
14780
|
-
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14781
|
-
*
|
|
14782
|
-
* ```html
|
|
14783
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14784
|
-
* ```
|
|
14785
|
-
*
|
|
14786
|
-
* Its compiled representation is::
|
|
14787
|
-
*
|
|
14788
|
-
* ```ts
|
|
14789
|
-
* ɵɵattributeInterpolate5(
|
|
14790
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14791
|
-
* ```
|
|
14792
|
-
*
|
|
14793
|
-
* @param attrName The name of the attribute to update
|
|
14794
|
-
* @param prefix Static value used for concatenation only.
|
|
14795
|
-
* @param v0 Value checked for change.
|
|
14796
|
-
* @param i0 Static value used for concatenation only.
|
|
14797
|
-
* @param v1 Value checked for change.
|
|
14798
|
-
* @param i1 Static value used for concatenation only.
|
|
14799
|
-
* @param v2 Value checked for change.
|
|
14800
|
-
* @param i2 Static value used for concatenation only.
|
|
14801
|
-
* @param v3 Value checked for change.
|
|
14802
|
-
* @param i3 Static value used for concatenation only.
|
|
14803
|
-
* @param v4 Value checked for change.
|
|
14804
|
-
* @param suffix Static value used for concatenation only.
|
|
14805
|
-
* @param sanitizer An optional sanitizer function
|
|
14806
|
-
* @returns itself, so that it may be chained.
|
|
14807
|
-
* @codeGenApi
|
|
14808
|
-
*/
|
|
14809
|
-
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14810
|
-
const lView = getLView();
|
|
14811
|
-
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14812
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14813
|
-
const tNode = getSelectedTNode();
|
|
14814
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14815
|
-
ngDevMode &&
|
|
14816
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14817
|
-
}
|
|
14818
|
-
return ɵɵattributeInterpolate5;
|
|
14819
|
-
}
|
|
14820
|
-
/**
|
|
14821
|
-
*
|
|
14822
|
-
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14823
|
-
*
|
|
14824
|
-
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14825
|
-
*
|
|
14826
|
-
* ```html
|
|
14827
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14828
|
-
* ```
|
|
14829
|
-
*
|
|
14830
|
-
* Its compiled representation is::
|
|
14831
|
-
*
|
|
14832
|
-
* ```ts
|
|
14833
|
-
* ɵɵattributeInterpolate6(
|
|
14834
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14096
|
+
* ɵɵattributeInterpolate6(
|
|
14097
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14835
14098
|
* ```
|
|
14836
14099
|
*
|
|
14837
14100
|
* @param attrName The name of the attribute to update
|
|
@@ -15004,6 +14267,57 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
|
|
|
15004
14267
|
return ɵɵattributeInterpolateV;
|
|
15005
14268
|
}
|
|
15006
14269
|
|
|
14270
|
+
/**
|
|
14271
|
+
* @license
|
|
14272
|
+
* Copyright Google LLC All Rights Reserved.
|
|
14273
|
+
*
|
|
14274
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
14275
|
+
* found in the LICENSE file at https://angular.io/license
|
|
14276
|
+
*/
|
|
14277
|
+
/**
|
|
14278
|
+
* Synchronously perform change detection on a component (and possibly its sub-components).
|
|
14279
|
+
*
|
|
14280
|
+
* This function triggers change detection in a synchronous way on a component.
|
|
14281
|
+
*
|
|
14282
|
+
* @param component The component which the change detection should be performed on.
|
|
14283
|
+
*/
|
|
14284
|
+
function detectChanges(component) {
|
|
14285
|
+
const view = getComponentViewByInstance(component);
|
|
14286
|
+
detectChangesInternal(view[TVIEW], view, component);
|
|
14287
|
+
}
|
|
14288
|
+
/**
|
|
14289
|
+
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
14290
|
+
* schedule a change detection on it at some point in the future.
|
|
14291
|
+
*
|
|
14292
|
+
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
14293
|
+
* detection can be scheduled per component tree.
|
|
14294
|
+
*
|
|
14295
|
+
* @param component Component to mark as dirty.
|
|
14296
|
+
*/
|
|
14297
|
+
function markDirty(component) {
|
|
14298
|
+
ngDevMode && assertDefined(component, 'component');
|
|
14299
|
+
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
14300
|
+
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
14301
|
+
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
14302
|
+
}
|
|
14303
|
+
/**
|
|
14304
|
+
* Used to perform change detection on the whole application.
|
|
14305
|
+
*
|
|
14306
|
+
* This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
|
|
14307
|
+
* executes lifecycle hooks and conditionally checks components based on their
|
|
14308
|
+
* `ChangeDetectionStrategy` and dirtiness.
|
|
14309
|
+
*
|
|
14310
|
+
* The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
|
|
14311
|
+
* schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
|
|
14312
|
+
* single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
|
|
14313
|
+
* be changed when calling `renderComponent` and providing the `scheduler` option.
|
|
14314
|
+
*/
|
|
14315
|
+
function tick(component) {
|
|
14316
|
+
const rootView = getRootView(component);
|
|
14317
|
+
const rootContext = rootView[CONTEXT];
|
|
14318
|
+
tickRootContext(rootContext);
|
|
14319
|
+
}
|
|
14320
|
+
|
|
15007
14321
|
/**
|
|
15008
14322
|
* @license
|
|
15009
14323
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -15548,51 +14862,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15548
14862
|
tNode.index;
|
|
15549
14863
|
// In order to match current behavior, native DOM event listeners must be added for all
|
|
15550
14864
|
// events (including outputs).
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
processOutputs = false;
|
|
15581
|
-
}
|
|
15582
|
-
else {
|
|
15583
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
15584
|
-
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15585
|
-
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15586
|
-
lCleanup.push(listenerFn, cleanupFn);
|
|
15587
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15588
|
-
}
|
|
14865
|
+
// There might be cases where multiple directives on the same element try to register an event
|
|
14866
|
+
// handler function for the same event. In this situation we want to avoid registration of
|
|
14867
|
+
// several native listeners as each registration would be intercepted by NgZone and
|
|
14868
|
+
// trigger change detection. This would mean that a single user action would result in several
|
|
14869
|
+
// change detections being invoked. To avoid this situation we want to have only one call to
|
|
14870
|
+
// native handler registration (for the same element and same type of event).
|
|
14871
|
+
//
|
|
14872
|
+
// In order to have just one native event handler in presence of multiple handler functions,
|
|
14873
|
+
// we just register a first handler function as a native event listener and then chain
|
|
14874
|
+
// (coalesce) other handler functions on top of the first native handler function.
|
|
14875
|
+
let existingListener = null;
|
|
14876
|
+
// Please note that the coalescing described here doesn't happen for events specifying an
|
|
14877
|
+
// alternative target (ex. (document:click)) - this is to keep backward compatibility with the
|
|
14878
|
+
// view engine.
|
|
14879
|
+
// Also, we don't have to search for existing listeners is there are no directives
|
|
14880
|
+
// matching on a given node as we can't register multiple event handlers for the same event in
|
|
14881
|
+
// a template (this would mean having duplicate attributes).
|
|
14882
|
+
if (!eventTargetResolver && isTNodeDirectiveHost) {
|
|
14883
|
+
existingListener = findExistingListener(tView, lView, eventName, tNode.index);
|
|
14884
|
+
}
|
|
14885
|
+
if (existingListener !== null) {
|
|
14886
|
+
// Attach a new listener to coalesced listeners list, maintaining the order in which
|
|
14887
|
+
// listeners are registered. For performance reasons, we keep a reference to the last
|
|
14888
|
+
// listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
|
|
14889
|
+
// the entire set each time we need to add a new listener.
|
|
14890
|
+
const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
|
|
14891
|
+
lastListenerFn.__ngNextListenerFn__ = listenerFn;
|
|
14892
|
+
existingListener.__ngLastListenerFn__ = listenerFn;
|
|
14893
|
+
processOutputs = false;
|
|
15589
14894
|
}
|
|
15590
14895
|
else {
|
|
15591
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn,
|
|
15592
|
-
|
|
14896
|
+
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
14897
|
+
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15593
14898
|
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15594
|
-
lCleanup.push(listenerFn);
|
|
15595
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex,
|
|
14899
|
+
lCleanup.push(listenerFn, cleanupFn);
|
|
14900
|
+
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15596
14901
|
}
|
|
15597
14902
|
}
|
|
15598
14903
|
else {
|
|
@@ -17666,7 +16971,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
|
|
|
17666
16971
|
valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
|
|
17667
16972
|
}
|
|
17668
16973
|
let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
|
|
17669
|
-
key === prop ? valueAtLViewIndex : undefined;
|
|
16974
|
+
(key === prop ? valueAtLViewIndex : undefined);
|
|
17670
16975
|
if (containsStatics && !isStylingValuePresent(currentValue)) {
|
|
17671
16976
|
currentValue = keyValueArrayGet(rawKey, prop);
|
|
17672
16977
|
}
|
|
@@ -21519,7 +20824,7 @@ function noComponentFactoryError(component) {
|
|
|
21519
20824
|
return error;
|
|
21520
20825
|
}
|
|
21521
20826
|
const ERROR_COMPONENT = 'ngComponent';
|
|
21522
|
-
function getComponent(error) {
|
|
20827
|
+
function getComponent$1(error) {
|
|
21523
20828
|
return error[ERROR_COMPONENT];
|
|
21524
20829
|
}
|
|
21525
20830
|
class _NullComponentFactoryResolver {
|
|
@@ -21703,14 +21008,6 @@ class Renderer2 {
|
|
|
21703
21008
|
* @nocollapse
|
|
21704
21009
|
*/
|
|
21705
21010
|
Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
|
|
21706
|
-
/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
|
|
21707
|
-
function getOrCreateRenderer2(lView) {
|
|
21708
|
-
const renderer = lView[RENDERER];
|
|
21709
|
-
if (ngDevMode && !isProceduralRenderer(renderer)) {
|
|
21710
|
-
throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
|
|
21711
|
-
}
|
|
21712
|
-
return renderer;
|
|
21713
|
-
}
|
|
21714
21011
|
/** Injects a Renderer2 for the current component. */
|
|
21715
21012
|
function injectRenderer2() {
|
|
21716
21013
|
// We need the Renderer to be based on the component that it's being injected into, however since
|
|
@@ -21718,7 +21015,7 @@ function injectRenderer2() {
|
|
|
21718
21015
|
const lView = getLView();
|
|
21719
21016
|
const tNode = getCurrentTNode();
|
|
21720
21017
|
const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
|
|
21721
|
-
return
|
|
21018
|
+
return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
|
|
21722
21019
|
}
|
|
21723
21020
|
|
|
21724
21021
|
/**
|
|
@@ -21765,7 +21062,7 @@ class Version {
|
|
|
21765
21062
|
/**
|
|
21766
21063
|
* @publicApi
|
|
21767
21064
|
*/
|
|
21768
|
-
const VERSION = new Version('14.0.
|
|
21065
|
+
const VERSION = new Version('14.0.5');
|
|
21769
21066
|
|
|
21770
21067
|
/**
|
|
21771
21068
|
* @license
|
|
@@ -22144,367 +21441,783 @@ class RootViewRef extends ViewRef$1 {
|
|
|
22144
21441
|
* Use of this source code is governed by an MIT-style license that can be
|
|
22145
21442
|
* found in the LICENSE file at https://angular.io/license
|
|
22146
21443
|
*/
|
|
22147
|
-
class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
|
|
22148
|
-
/**
|
|
22149
|
-
* @param ngModule The NgModuleRef to which all resolved factories are bound.
|
|
22150
|
-
*/
|
|
22151
|
-
constructor(ngModule) {
|
|
22152
|
-
super();
|
|
22153
|
-
this.ngModule = ngModule;
|
|
22154
|
-
}
|
|
22155
|
-
resolveComponentFactory(component) {
|
|
22156
|
-
ngDevMode && assertComponentType(component);
|
|
22157
|
-
const componentDef = getComponentDef(component);
|
|
22158
|
-
return new ComponentFactory(componentDef, this.ngModule);
|
|
22159
|
-
}
|
|
22160
|
-
}
|
|
22161
|
-
function toRefArray(map) {
|
|
22162
|
-
const array = [];
|
|
22163
|
-
for (let nonMinified in map) {
|
|
22164
|
-
if (map.hasOwnProperty(nonMinified)) {
|
|
22165
|
-
const minified = map[nonMinified];
|
|
22166
|
-
array.push({ propName: minified, templateName: nonMinified });
|
|
21444
|
+
class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
|
|
21445
|
+
/**
|
|
21446
|
+
* @param ngModule The NgModuleRef to which all resolved factories are bound.
|
|
21447
|
+
*/
|
|
21448
|
+
constructor(ngModule) {
|
|
21449
|
+
super();
|
|
21450
|
+
this.ngModule = ngModule;
|
|
21451
|
+
}
|
|
21452
|
+
resolveComponentFactory(component) {
|
|
21453
|
+
ngDevMode && assertComponentType(component);
|
|
21454
|
+
const componentDef = getComponentDef(component);
|
|
21455
|
+
return new ComponentFactory(componentDef, this.ngModule);
|
|
21456
|
+
}
|
|
21457
|
+
}
|
|
21458
|
+
function toRefArray(map) {
|
|
21459
|
+
const array = [];
|
|
21460
|
+
for (let nonMinified in map) {
|
|
21461
|
+
if (map.hasOwnProperty(nonMinified)) {
|
|
21462
|
+
const minified = map[nonMinified];
|
|
21463
|
+
array.push({ propName: minified, templateName: nonMinified });
|
|
21464
|
+
}
|
|
21465
|
+
}
|
|
21466
|
+
return array;
|
|
21467
|
+
}
|
|
21468
|
+
function getNamespace(elementName) {
|
|
21469
|
+
const name = elementName.toLowerCase();
|
|
21470
|
+
return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
|
|
21471
|
+
}
|
|
21472
|
+
/**
|
|
21473
|
+
* Injector that looks up a value using a specific injector, before falling back to the module
|
|
21474
|
+
* injector. Used primarily when creating components or embedded views dynamically.
|
|
21475
|
+
*/
|
|
21476
|
+
class ChainedInjector {
|
|
21477
|
+
constructor(injector, parentInjector) {
|
|
21478
|
+
this.injector = injector;
|
|
21479
|
+
this.parentInjector = parentInjector;
|
|
21480
|
+
}
|
|
21481
|
+
get(token, notFoundValue, flags) {
|
|
21482
|
+
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
|
|
21483
|
+
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
|
|
21484
|
+
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
21485
|
+
// Return the value from the root element injector when
|
|
21486
|
+
// - it provides it
|
|
21487
|
+
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21488
|
+
// - the module injector should not be checked
|
|
21489
|
+
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21490
|
+
return value;
|
|
21491
|
+
}
|
|
21492
|
+
return this.parentInjector.get(token, notFoundValue, flags);
|
|
21493
|
+
}
|
|
21494
|
+
}
|
|
21495
|
+
/**
|
|
21496
|
+
* Render3 implementation of {@link viewEngine_ComponentFactory}.
|
|
21497
|
+
*/
|
|
21498
|
+
class ComponentFactory extends ComponentFactory$1 {
|
|
21499
|
+
/**
|
|
21500
|
+
* @param componentDef The component definition.
|
|
21501
|
+
* @param ngModule The NgModuleRef to which the factory is bound.
|
|
21502
|
+
*/
|
|
21503
|
+
constructor(componentDef, ngModule) {
|
|
21504
|
+
super();
|
|
21505
|
+
this.componentDef = componentDef;
|
|
21506
|
+
this.ngModule = ngModule;
|
|
21507
|
+
this.componentType = componentDef.type;
|
|
21508
|
+
this.selector = stringifyCSSSelectorList(componentDef.selectors);
|
|
21509
|
+
this.ngContentSelectors =
|
|
21510
|
+
componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
|
|
21511
|
+
this.isBoundToModule = !!ngModule;
|
|
21512
|
+
}
|
|
21513
|
+
get inputs() {
|
|
21514
|
+
return toRefArray(this.componentDef.inputs);
|
|
21515
|
+
}
|
|
21516
|
+
get outputs() {
|
|
21517
|
+
return toRefArray(this.componentDef.outputs);
|
|
21518
|
+
}
|
|
21519
|
+
create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
|
|
21520
|
+
environmentInjector = environmentInjector || this.ngModule;
|
|
21521
|
+
let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
|
|
21522
|
+
environmentInjector :
|
|
21523
|
+
environmentInjector === null || environmentInjector === void 0 ? void 0 : environmentInjector.injector;
|
|
21524
|
+
if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
|
|
21525
|
+
realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
|
|
21526
|
+
realEnvironmentInjector;
|
|
21527
|
+
}
|
|
21528
|
+
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
|
|
21529
|
+
const rendererFactory = rootViewInjector.get(RendererFactory2, null);
|
|
21530
|
+
if (rendererFactory === null) {
|
|
21531
|
+
throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
|
|
21532
|
+
'Angular was not able to inject a renderer (RendererFactory2). ' +
|
|
21533
|
+
'Likely this is due to a broken DI hierarchy. ' +
|
|
21534
|
+
'Make sure that any injector used to create this component has a correct parent.');
|
|
21535
|
+
}
|
|
21536
|
+
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
21537
|
+
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
21538
|
+
// Determine a tag name used for creating host elements when this component is created
|
|
21539
|
+
// dynamically. Default to 'div' if this component did not specify any tag name in its selector.
|
|
21540
|
+
const elementName = this.componentDef.selectors[0][0] || 'div';
|
|
21541
|
+
const hostRNode = rootSelectorOrNode ?
|
|
21542
|
+
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
|
|
21543
|
+
createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
|
|
21544
|
+
const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
21545
|
+
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
21546
|
+
const rootContext = createRootContext();
|
|
21547
|
+
// Create the root view. Uses empty TView and ContentTemplate.
|
|
21548
|
+
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
21549
|
+
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
21550
|
+
// rootView is the parent when bootstrapping
|
|
21551
|
+
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
21552
|
+
// `renderView` does that. However as the code is written it is needed because
|
|
21553
|
+
// `createRootComponentView` and `createRootComponent` both read global state. Fixing those
|
|
21554
|
+
// issues would allow us to drop this.
|
|
21555
|
+
enterView(rootLView);
|
|
21556
|
+
let component;
|
|
21557
|
+
let tElementNode;
|
|
21558
|
+
try {
|
|
21559
|
+
const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
|
|
21560
|
+
if (hostRNode) {
|
|
21561
|
+
if (rootSelectorOrNode) {
|
|
21562
|
+
setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
|
|
21563
|
+
}
|
|
21564
|
+
else {
|
|
21565
|
+
// If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
|
|
21566
|
+
// is not defined), also apply attributes and classes extracted from component selector.
|
|
21567
|
+
// Extract attributes and classes from the first selector only to match VE behavior.
|
|
21568
|
+
const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
|
|
21569
|
+
if (attrs) {
|
|
21570
|
+
setUpAttributes(hostRenderer, hostRNode, attrs);
|
|
21571
|
+
}
|
|
21572
|
+
if (classes && classes.length > 0) {
|
|
21573
|
+
writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
|
|
21574
|
+
}
|
|
21575
|
+
}
|
|
21576
|
+
}
|
|
21577
|
+
tElementNode = getTNode(rootTView, HEADER_OFFSET);
|
|
21578
|
+
if (projectableNodes !== undefined) {
|
|
21579
|
+
const projection = tElementNode.projection = [];
|
|
21580
|
+
for (let i = 0; i < this.ngContentSelectors.length; i++) {
|
|
21581
|
+
const nodesforSlot = projectableNodes[i];
|
|
21582
|
+
// Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
|
|
21583
|
+
// case). Here we do normalize passed data structure to be an array of arrays to avoid
|
|
21584
|
+
// complex checks down the line.
|
|
21585
|
+
// We also normalize the length of the passed in projectable nodes (to match the number of
|
|
21586
|
+
// <ng-container> slots defined by a component).
|
|
21587
|
+
projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
|
|
21588
|
+
}
|
|
21589
|
+
}
|
|
21590
|
+
// TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
|
|
21591
|
+
// executed here?
|
|
21592
|
+
// Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
|
|
21593
|
+
component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
|
|
21594
|
+
renderView(rootTView, rootLView, null);
|
|
21595
|
+
}
|
|
21596
|
+
finally {
|
|
21597
|
+
leaveView();
|
|
21598
|
+
}
|
|
21599
|
+
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
21600
|
+
}
|
|
21601
|
+
}
|
|
21602
|
+
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21603
|
+
/**
|
|
21604
|
+
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
21605
|
+
* ComponentFactoryResolver
|
|
21606
|
+
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21607
|
+
*
|
|
21608
|
+
* @returns The ComponentFactoryResolver instance to use
|
|
21609
|
+
*/
|
|
21610
|
+
function injectComponentFactoryResolver() {
|
|
21611
|
+
return componentFactoryResolver;
|
|
21612
|
+
}
|
|
21613
|
+
/**
|
|
21614
|
+
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
21615
|
+
*
|
|
21616
|
+
* `ComponentRef` provides access to the Component Instance as well other objects related to this
|
|
21617
|
+
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
|
|
21618
|
+
* method.
|
|
21619
|
+
*
|
|
21620
|
+
*/
|
|
21621
|
+
class ComponentRef extends ComponentRef$1 {
|
|
21622
|
+
constructor(componentType, instance, location, _rootLView, _tNode) {
|
|
21623
|
+
super();
|
|
21624
|
+
this.location = location;
|
|
21625
|
+
this._rootLView = _rootLView;
|
|
21626
|
+
this._tNode = _tNode;
|
|
21627
|
+
this.instance = instance;
|
|
21628
|
+
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
21629
|
+
this.componentType = componentType;
|
|
21630
|
+
}
|
|
21631
|
+
get injector() {
|
|
21632
|
+
return new NodeInjector(this._tNode, this._rootLView);
|
|
21633
|
+
}
|
|
21634
|
+
destroy() {
|
|
21635
|
+
this.hostView.destroy();
|
|
21636
|
+
}
|
|
21637
|
+
onDestroy(callback) {
|
|
21638
|
+
this.hostView.onDestroy(callback);
|
|
21639
|
+
}
|
|
21640
|
+
}
|
|
21641
|
+
|
|
21642
|
+
/**
|
|
21643
|
+
* @license
|
|
21644
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21645
|
+
*
|
|
21646
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21647
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21648
|
+
*/
|
|
21649
|
+
/**
|
|
21650
|
+
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
21651
|
+
* @param ngModule NgModule class.
|
|
21652
|
+
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
21653
|
+
* not provided, `NullInjector` will be used instead.
|
|
21654
|
+
* @publicApi
|
|
21655
|
+
*/
|
|
21656
|
+
function createNgModuleRef(ngModule, parentInjector) {
|
|
21657
|
+
return new NgModuleRef(ngModule, parentInjector !== null && parentInjector !== void 0 ? parentInjector : null);
|
|
21658
|
+
}
|
|
21659
|
+
class NgModuleRef extends NgModuleRef$1 {
|
|
21660
|
+
constructor(ngModuleType, _parent) {
|
|
21661
|
+
super();
|
|
21662
|
+
this._parent = _parent;
|
|
21663
|
+
// tslint:disable-next-line:require-internal-with-underscore
|
|
21664
|
+
this._bootstrapComponents = [];
|
|
21665
|
+
this.injector = this;
|
|
21666
|
+
this.destroyCbs = [];
|
|
21667
|
+
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
21668
|
+
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
21669
|
+
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
21670
|
+
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
21671
|
+
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
21672
|
+
// and providing it, rather than letting the injector resolve it.
|
|
21673
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21674
|
+
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
21675
|
+
ngDevMode &&
|
|
21676
|
+
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
21677
|
+
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
21678
|
+
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
21679
|
+
{ provide: NgModuleRef$1, useValue: this }, {
|
|
21680
|
+
provide: ComponentFactoryResolver$1,
|
|
21681
|
+
useValue: this.componentFactoryResolver
|
|
21682
|
+
}
|
|
21683
|
+
], stringify(ngModuleType), new Set(['environment']));
|
|
21684
|
+
// We need to resolve the injector types separately from the injector creation, because
|
|
21685
|
+
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21686
|
+
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21687
|
+
this._r3Injector.resolveInjectorInitializers();
|
|
21688
|
+
this.instance = this.get(ngModuleType);
|
|
21689
|
+
}
|
|
21690
|
+
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
21691
|
+
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
21692
|
+
return this;
|
|
21693
|
+
}
|
|
21694
|
+
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
21695
|
+
}
|
|
21696
|
+
destroy() {
|
|
21697
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21698
|
+
const injector = this._r3Injector;
|
|
21699
|
+
!injector.destroyed && injector.destroy();
|
|
21700
|
+
this.destroyCbs.forEach(fn => fn());
|
|
21701
|
+
this.destroyCbs = null;
|
|
21702
|
+
}
|
|
21703
|
+
onDestroy(callback) {
|
|
21704
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21705
|
+
this.destroyCbs.push(callback);
|
|
21706
|
+
}
|
|
21707
|
+
}
|
|
21708
|
+
class NgModuleFactory extends NgModuleFactory$1 {
|
|
21709
|
+
constructor(moduleType) {
|
|
21710
|
+
super();
|
|
21711
|
+
this.moduleType = moduleType;
|
|
21712
|
+
}
|
|
21713
|
+
create(parentInjector) {
|
|
21714
|
+
return new NgModuleRef(this.moduleType, parentInjector);
|
|
21715
|
+
}
|
|
21716
|
+
}
|
|
21717
|
+
class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
21718
|
+
constructor(providers, parent, source) {
|
|
21719
|
+
super();
|
|
21720
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21721
|
+
this.instance = null;
|
|
21722
|
+
const injector = new R3Injector([
|
|
21723
|
+
...providers,
|
|
21724
|
+
{ provide: NgModuleRef$1, useValue: this },
|
|
21725
|
+
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
21726
|
+
], parent || getNullInjector(), source, new Set(['environment']));
|
|
21727
|
+
this.injector = injector;
|
|
21728
|
+
injector.resolveInjectorInitializers();
|
|
21729
|
+
}
|
|
21730
|
+
destroy() {
|
|
21731
|
+
this.injector.destroy();
|
|
21732
|
+
}
|
|
21733
|
+
onDestroy(callback) {
|
|
21734
|
+
this.injector.onDestroy(callback);
|
|
21735
|
+
}
|
|
21736
|
+
}
|
|
21737
|
+
/**
|
|
21738
|
+
* Create a new environment injector.
|
|
21739
|
+
*
|
|
21740
|
+
* @publicApi
|
|
21741
|
+
* @developerPreview
|
|
21742
|
+
*/
|
|
21743
|
+
function createEnvironmentInjector(providers, parent = null, debugName = null) {
|
|
21744
|
+
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
21745
|
+
return adapter.injector;
|
|
21746
|
+
}
|
|
21747
|
+
|
|
21748
|
+
/**
|
|
21749
|
+
* @license
|
|
21750
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21751
|
+
*
|
|
21752
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21753
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21754
|
+
*/
|
|
21755
|
+
/**
|
|
21756
|
+
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
21757
|
+
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
21758
|
+
* collected from the imports graph rooted at a given standalone component.
|
|
21759
|
+
*/
|
|
21760
|
+
class StandaloneService {
|
|
21761
|
+
constructor(_injector) {
|
|
21762
|
+
this._injector = _injector;
|
|
21763
|
+
this.cachedInjectors = new Map();
|
|
21764
|
+
}
|
|
21765
|
+
getOrCreateStandaloneInjector(componentDef) {
|
|
21766
|
+
if (!componentDef.standalone) {
|
|
21767
|
+
return null;
|
|
21768
|
+
}
|
|
21769
|
+
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
21770
|
+
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
21771
|
+
const standaloneInjector = providers.length > 0 ?
|
|
21772
|
+
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
21773
|
+
null;
|
|
21774
|
+
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
21775
|
+
}
|
|
21776
|
+
return this.cachedInjectors.get(componentDef.id);
|
|
21777
|
+
}
|
|
21778
|
+
ngOnDestroy() {
|
|
21779
|
+
try {
|
|
21780
|
+
for (const injector of this.cachedInjectors.values()) {
|
|
21781
|
+
if (injector !== null) {
|
|
21782
|
+
injector.destroy();
|
|
21783
|
+
}
|
|
21784
|
+
}
|
|
21785
|
+
}
|
|
21786
|
+
finally {
|
|
21787
|
+
this.cachedInjectors.clear();
|
|
21788
|
+
}
|
|
21789
|
+
}
|
|
21790
|
+
}
|
|
21791
|
+
/** @nocollapse */
|
|
21792
|
+
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
21793
|
+
token: StandaloneService,
|
|
21794
|
+
providedIn: 'environment',
|
|
21795
|
+
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
21796
|
+
});
|
|
21797
|
+
/**
|
|
21798
|
+
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
21799
|
+
*
|
|
21800
|
+
* The most important responsaibility of this feature is to expose the "getStandaloneInjector"
|
|
21801
|
+
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
21802
|
+
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
21803
|
+
* is tree-shakable and not included in applications that don't use standalone components.
|
|
21804
|
+
*
|
|
21805
|
+
* @codeGenApi
|
|
21806
|
+
*/
|
|
21807
|
+
function ɵɵStandaloneFeature(definition) {
|
|
21808
|
+
definition.getStandaloneInjector = (parentInjector) => {
|
|
21809
|
+
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
|
|
21810
|
+
};
|
|
21811
|
+
}
|
|
21812
|
+
|
|
21813
|
+
/**
|
|
21814
|
+
* @license
|
|
21815
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21816
|
+
*
|
|
21817
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21818
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21819
|
+
*/
|
|
21820
|
+
/**
|
|
21821
|
+
* Retrieves the component instance associated with a given DOM element.
|
|
21822
|
+
*
|
|
21823
|
+
* @usageNotes
|
|
21824
|
+
* Given the following DOM structure:
|
|
21825
|
+
*
|
|
21826
|
+
* ```html
|
|
21827
|
+
* <app-root>
|
|
21828
|
+
* <div>
|
|
21829
|
+
* <child-comp></child-comp>
|
|
21830
|
+
* </div>
|
|
21831
|
+
* </app-root>
|
|
21832
|
+
* ```
|
|
21833
|
+
*
|
|
21834
|
+
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
21835
|
+
* associated with this DOM element.
|
|
21836
|
+
*
|
|
21837
|
+
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
21838
|
+
*
|
|
21839
|
+
*
|
|
21840
|
+
* @param element DOM element from which the component should be retrieved.
|
|
21841
|
+
* @returns Component instance associated with the element or `null` if there
|
|
21842
|
+
* is no component associated with it.
|
|
21843
|
+
*
|
|
21844
|
+
* @publicApi
|
|
21845
|
+
* @globalApi ng
|
|
21846
|
+
*/
|
|
21847
|
+
function getComponent(element) {
|
|
21848
|
+
ngDevMode && assertDomElement(element);
|
|
21849
|
+
const context = getLContext(element);
|
|
21850
|
+
if (context === null)
|
|
21851
|
+
return null;
|
|
21852
|
+
if (context.component === undefined) {
|
|
21853
|
+
const lView = context.lView;
|
|
21854
|
+
if (lView === null) {
|
|
21855
|
+
return null;
|
|
22167
21856
|
}
|
|
21857
|
+
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
22168
21858
|
}
|
|
22169
|
-
return
|
|
21859
|
+
return context.component;
|
|
22170
21860
|
}
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
21861
|
+
/**
|
|
21862
|
+
* If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
|
|
21863
|
+
* view that the element is part of. Otherwise retrieves the instance of the component whose view
|
|
21864
|
+
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
21865
|
+
*
|
|
21866
|
+
* @param element Element for which to get the surrounding component instance.
|
|
21867
|
+
* @returns Instance of the component that is around the element or null if the element isn't
|
|
21868
|
+
* inside any component.
|
|
21869
|
+
*
|
|
21870
|
+
* @publicApi
|
|
21871
|
+
* @globalApi ng
|
|
21872
|
+
*/
|
|
21873
|
+
function getContext(element) {
|
|
21874
|
+
assertDomElement(element);
|
|
21875
|
+
const context = getLContext(element);
|
|
21876
|
+
const lView = context ? context.lView : null;
|
|
21877
|
+
return lView === null ? null : lView[CONTEXT];
|
|
22174
21878
|
}
|
|
22175
21879
|
/**
|
|
22176
|
-
*
|
|
22177
|
-
*
|
|
21880
|
+
* Retrieves the component instance whose view contains the DOM element.
|
|
21881
|
+
*
|
|
21882
|
+
* For example, if `<child-comp>` is used in the template of `<app-comp>`
|
|
21883
|
+
* (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
|
|
21884
|
+
* would return `<app-comp>`.
|
|
21885
|
+
*
|
|
21886
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21887
|
+
* for which to retrieve the root components.
|
|
21888
|
+
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
21889
|
+
* part of a component view.
|
|
21890
|
+
*
|
|
21891
|
+
* @publicApi
|
|
21892
|
+
* @globalApi ng
|
|
22178
21893
|
*/
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
|
-
|
|
22187
|
-
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
22188
|
-
// Return the value from the root element injector when
|
|
22189
|
-
// - it provides it
|
|
22190
|
-
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
22191
|
-
// - the module injector should not be checked
|
|
22192
|
-
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
22193
|
-
return value;
|
|
22194
|
-
}
|
|
22195
|
-
return this.parentInjector.get(token, notFoundValue, flags);
|
|
21894
|
+
function getOwningComponent(elementOrDir) {
|
|
21895
|
+
const context = getLContext(elementOrDir);
|
|
21896
|
+
let lView = context ? context.lView : null;
|
|
21897
|
+
if (lView === null)
|
|
21898
|
+
return null;
|
|
21899
|
+
let parent;
|
|
21900
|
+
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
21901
|
+
lView = parent;
|
|
22196
21902
|
}
|
|
21903
|
+
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
22197
21904
|
}
|
|
22198
21905
|
/**
|
|
22199
|
-
*
|
|
21906
|
+
* Retrieves all root components associated with a DOM element, directive or component instance.
|
|
21907
|
+
* Root components are those which have been bootstrapped by Angular.
|
|
21908
|
+
*
|
|
21909
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21910
|
+
* for which to retrieve the root components.
|
|
21911
|
+
* @returns Root components associated with the target object.
|
|
21912
|
+
*
|
|
21913
|
+
* @publicApi
|
|
21914
|
+
* @globalApi ng
|
|
22200
21915
|
*/
|
|
22201
|
-
|
|
22202
|
-
|
|
22203
|
-
|
|
22204
|
-
|
|
22205
|
-
|
|
22206
|
-
|
|
22207
|
-
|
|
22208
|
-
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
22247
|
-
// rootView is the parent when bootstrapping
|
|
22248
|
-
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
22249
|
-
// `renderView` does that. However as the code is written it is needed because
|
|
22250
|
-
// `createRootComponentView` and `createRootComponent` both read global state. Fixing those
|
|
22251
|
-
// issues would allow us to drop this.
|
|
22252
|
-
enterView(rootLView);
|
|
22253
|
-
let component;
|
|
22254
|
-
let tElementNode;
|
|
22255
|
-
try {
|
|
22256
|
-
const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
|
|
22257
|
-
if (hostRNode) {
|
|
22258
|
-
if (rootSelectorOrNode) {
|
|
22259
|
-
setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
|
|
22260
|
-
}
|
|
22261
|
-
else {
|
|
22262
|
-
// If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
|
|
22263
|
-
// is not defined), also apply attributes and classes extracted from component selector.
|
|
22264
|
-
// Extract attributes and classes from the first selector only to match VE behavior.
|
|
22265
|
-
const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
|
|
22266
|
-
if (attrs) {
|
|
22267
|
-
setUpAttributes(hostRenderer, hostRNode, attrs);
|
|
22268
|
-
}
|
|
22269
|
-
if (classes && classes.length > 0) {
|
|
22270
|
-
writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
|
|
22271
|
-
}
|
|
22272
|
-
}
|
|
22273
|
-
}
|
|
22274
|
-
tElementNode = getTNode(rootTView, HEADER_OFFSET);
|
|
22275
|
-
if (projectableNodes !== undefined) {
|
|
22276
|
-
const projection = tElementNode.projection = [];
|
|
22277
|
-
for (let i = 0; i < this.ngContentSelectors.length; i++) {
|
|
22278
|
-
const nodesforSlot = projectableNodes[i];
|
|
22279
|
-
// Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
|
|
22280
|
-
// case). Here we do normalize passed data structure to be an array of arrays to avoid
|
|
22281
|
-
// complex checks down the line.
|
|
22282
|
-
// We also normalize the length of the passed in projectable nodes (to match the number of
|
|
22283
|
-
// <ng-container> slots defined by a component).
|
|
22284
|
-
projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
|
|
22285
|
-
}
|
|
22286
|
-
}
|
|
22287
|
-
// TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
|
|
22288
|
-
// executed here?
|
|
22289
|
-
// Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
|
|
22290
|
-
component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
|
|
22291
|
-
renderView(rootTView, rootLView, null);
|
|
22292
|
-
}
|
|
22293
|
-
finally {
|
|
22294
|
-
leaveView();
|
|
21916
|
+
function getRootComponents(elementOrDir) {
|
|
21917
|
+
const lView = readPatchedLView(elementOrDir);
|
|
21918
|
+
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
21919
|
+
}
|
|
21920
|
+
/**
|
|
21921
|
+
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
21922
|
+
*
|
|
21923
|
+
* @param elementOrDir DOM element, component or directive instance for which to
|
|
21924
|
+
* retrieve the injector.
|
|
21925
|
+
* @returns Injector associated with the element, component or directive instance.
|
|
21926
|
+
*
|
|
21927
|
+
* @publicApi
|
|
21928
|
+
* @globalApi ng
|
|
21929
|
+
*/
|
|
21930
|
+
function getInjector(elementOrDir) {
|
|
21931
|
+
const context = getLContext(elementOrDir);
|
|
21932
|
+
const lView = context ? context.lView : null;
|
|
21933
|
+
if (lView === null)
|
|
21934
|
+
return Injector.NULL;
|
|
21935
|
+
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
21936
|
+
return new NodeInjector(tNode, lView);
|
|
21937
|
+
}
|
|
21938
|
+
/**
|
|
21939
|
+
* Retrieve a set of injection tokens at a given DOM node.
|
|
21940
|
+
*
|
|
21941
|
+
* @param element Element for which the injection tokens should be retrieved.
|
|
21942
|
+
*/
|
|
21943
|
+
function getInjectionTokens(element) {
|
|
21944
|
+
const context = getLContext(element);
|
|
21945
|
+
const lView = context ? context.lView : null;
|
|
21946
|
+
if (lView === null)
|
|
21947
|
+
return [];
|
|
21948
|
+
const tView = lView[TVIEW];
|
|
21949
|
+
const tNode = tView.data[context.nodeIndex];
|
|
21950
|
+
const providerTokens = [];
|
|
21951
|
+
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
21952
|
+
const endIndex = tNode.directiveEnd;
|
|
21953
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
21954
|
+
let value = tView.data[i];
|
|
21955
|
+
if (isDirectiveDefHack(value)) {
|
|
21956
|
+
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
21957
|
+
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
21958
|
+
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
21959
|
+
// is that we should always be storing injectable type in this location.
|
|
21960
|
+
value = value.type;
|
|
22295
21961
|
}
|
|
22296
|
-
|
|
21962
|
+
providerTokens.push(value);
|
|
22297
21963
|
}
|
|
21964
|
+
return providerTokens;
|
|
22298
21965
|
}
|
|
22299
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
22300
21966
|
/**
|
|
22301
|
-
*
|
|
22302
|
-
*
|
|
22303
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21967
|
+
* Retrieves directive instances associated with a given DOM node. Does not include
|
|
21968
|
+
* component instances.
|
|
22304
21969
|
*
|
|
22305
|
-
* @
|
|
21970
|
+
* @usageNotes
|
|
21971
|
+
* Given the following DOM structure:
|
|
21972
|
+
*
|
|
21973
|
+
* ```html
|
|
21974
|
+
* <app-root>
|
|
21975
|
+
* <button my-button></button>
|
|
21976
|
+
* <my-comp></my-comp>
|
|
21977
|
+
* </app-root>
|
|
21978
|
+
* ```
|
|
21979
|
+
*
|
|
21980
|
+
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
21981
|
+
* directive that is associated with the DOM node.
|
|
21982
|
+
*
|
|
21983
|
+
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
21984
|
+
*
|
|
21985
|
+
* @param node DOM node for which to get the directives.
|
|
21986
|
+
* @returns Array of directives associated with the node.
|
|
21987
|
+
*
|
|
21988
|
+
* @publicApi
|
|
21989
|
+
* @globalApi ng
|
|
22306
21990
|
*/
|
|
22307
|
-
function
|
|
22308
|
-
|
|
21991
|
+
function getDirectives(node) {
|
|
21992
|
+
// Skip text nodes because we can't have directives associated with them.
|
|
21993
|
+
if (node instanceof Text) {
|
|
21994
|
+
return [];
|
|
21995
|
+
}
|
|
21996
|
+
const context = getLContext(node);
|
|
21997
|
+
const lView = context ? context.lView : null;
|
|
21998
|
+
if (lView === null) {
|
|
21999
|
+
return [];
|
|
22000
|
+
}
|
|
22001
|
+
const tView = lView[TVIEW];
|
|
22002
|
+
const nodeIndex = context.nodeIndex;
|
|
22003
|
+
if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
|
|
22004
|
+
return [];
|
|
22005
|
+
}
|
|
22006
|
+
if (context.directives === undefined) {
|
|
22007
|
+
context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
|
|
22008
|
+
}
|
|
22009
|
+
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
22010
|
+
// result so we don't expose an internal data structure in the user's console.
|
|
22011
|
+
return context.directives === null ? [] : [...context.directives];
|
|
22309
22012
|
}
|
|
22310
22013
|
/**
|
|
22311
|
-
*
|
|
22014
|
+
* Returns the debug (partial) metadata for a particular directive or component instance.
|
|
22015
|
+
* The function accepts an instance of a directive or component and returns the corresponding
|
|
22016
|
+
* metadata.
|
|
22312
22017
|
*
|
|
22313
|
-
*
|
|
22314
|
-
*
|
|
22315
|
-
* method.
|
|
22018
|
+
* @param directiveOrComponentInstance Instance of a directive or component
|
|
22019
|
+
* @returns metadata of the passed directive or component
|
|
22316
22020
|
*
|
|
22021
|
+
* @publicApi
|
|
22022
|
+
* @globalApi ng
|
|
22317
22023
|
*/
|
|
22318
|
-
|
|
22319
|
-
|
|
22320
|
-
|
|
22321
|
-
|
|
22322
|
-
this._rootLView = _rootLView;
|
|
22323
|
-
this._tNode = _tNode;
|
|
22324
|
-
this.instance = instance;
|
|
22325
|
-
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
22326
|
-
this.componentType = componentType;
|
|
22327
|
-
}
|
|
22328
|
-
get injector() {
|
|
22329
|
-
return new NodeInjector(this._tNode, this._rootLView);
|
|
22024
|
+
function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
22025
|
+
const { constructor } = directiveOrComponentInstance;
|
|
22026
|
+
if (!constructor) {
|
|
22027
|
+
throw new Error('Unable to find the instance constructor');
|
|
22330
22028
|
}
|
|
22331
|
-
|
|
22332
|
-
|
|
22029
|
+
// In case a component inherits from a directive, we may have component and directive metadata
|
|
22030
|
+
// To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
|
|
22031
|
+
const componentDef = getComponentDef(constructor);
|
|
22032
|
+
if (componentDef) {
|
|
22033
|
+
return {
|
|
22034
|
+
inputs: componentDef.inputs,
|
|
22035
|
+
outputs: componentDef.outputs,
|
|
22036
|
+
encapsulation: componentDef.encapsulation,
|
|
22037
|
+
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
|
|
22038
|
+
ChangeDetectionStrategy.Default
|
|
22039
|
+
};
|
|
22333
22040
|
}
|
|
22334
|
-
|
|
22335
|
-
|
|
22041
|
+
const directiveDef = getDirectiveDef(constructor);
|
|
22042
|
+
if (directiveDef) {
|
|
22043
|
+
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
22336
22044
|
}
|
|
22045
|
+
return null;
|
|
22337
22046
|
}
|
|
22338
|
-
|
|
22339
22047
|
/**
|
|
22340
|
-
*
|
|
22341
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22048
|
+
* Retrieve map of local references.
|
|
22342
22049
|
*
|
|
22343
|
-
*
|
|
22344
|
-
*
|
|
22050
|
+
* The references are retrieved as a map of local reference name to element or directive instance.
|
|
22051
|
+
*
|
|
22052
|
+
* @param target DOM element, component or directive instance for which to retrieve
|
|
22053
|
+
* the local references.
|
|
22345
22054
|
*/
|
|
22055
|
+
function getLocalRefs(target) {
|
|
22056
|
+
const context = getLContext(target);
|
|
22057
|
+
if (context === null)
|
|
22058
|
+
return {};
|
|
22059
|
+
if (context.localRefs === undefined) {
|
|
22060
|
+
const lView = context.lView;
|
|
22061
|
+
if (lView === null) {
|
|
22062
|
+
return {};
|
|
22063
|
+
}
|
|
22064
|
+
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
22065
|
+
}
|
|
22066
|
+
return context.localRefs || {};
|
|
22067
|
+
}
|
|
22346
22068
|
/**
|
|
22347
|
-
*
|
|
22348
|
-
*
|
|
22349
|
-
*
|
|
22350
|
-
*
|
|
22069
|
+
* Retrieves the host element of a component or directive instance.
|
|
22070
|
+
* The host element is the DOM element that matched the selector of the directive.
|
|
22071
|
+
*
|
|
22072
|
+
* @param componentOrDirective Component or directive instance for which the host
|
|
22073
|
+
* element should be retrieved.
|
|
22074
|
+
* @returns Host element of the target.
|
|
22075
|
+
*
|
|
22351
22076
|
* @publicApi
|
|
22077
|
+
* @globalApi ng
|
|
22352
22078
|
*/
|
|
22353
|
-
function
|
|
22354
|
-
return
|
|
22079
|
+
function getHostElement(componentOrDirective) {
|
|
22080
|
+
return getLContext(componentOrDirective).native;
|
|
22355
22081
|
}
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22378
|
-
|
|
22082
|
+
/**
|
|
22083
|
+
* Retrieves the rendered text for a given component.
|
|
22084
|
+
*
|
|
22085
|
+
* This function retrieves the host element of a component and
|
|
22086
|
+
* and then returns the `textContent` for that element. This implies
|
|
22087
|
+
* that the text returned will include re-projected content of
|
|
22088
|
+
* the component as well.
|
|
22089
|
+
*
|
|
22090
|
+
* @param component The component to return the content text for.
|
|
22091
|
+
*/
|
|
22092
|
+
function getRenderedText(component) {
|
|
22093
|
+
const hostElement = getHostElement(component);
|
|
22094
|
+
return hostElement.textContent || '';
|
|
22095
|
+
}
|
|
22096
|
+
/**
|
|
22097
|
+
* Retrieves a list of event listeners associated with a DOM element. The list does include host
|
|
22098
|
+
* listeners, but it does not include event listeners defined outside of the Angular context
|
|
22099
|
+
* (e.g. through `addEventListener`).
|
|
22100
|
+
*
|
|
22101
|
+
* @usageNotes
|
|
22102
|
+
* Given the following DOM structure:
|
|
22103
|
+
*
|
|
22104
|
+
* ```html
|
|
22105
|
+
* <app-root>
|
|
22106
|
+
* <div (click)="doSomething()"></div>
|
|
22107
|
+
* </app-root>
|
|
22108
|
+
* ```
|
|
22109
|
+
*
|
|
22110
|
+
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
22111
|
+
*
|
|
22112
|
+
* ```ts
|
|
22113
|
+
* {
|
|
22114
|
+
* name: 'click',
|
|
22115
|
+
* element: <div>,
|
|
22116
|
+
* callback: () => doSomething(),
|
|
22117
|
+
* useCapture: false
|
|
22118
|
+
* }
|
|
22119
|
+
* ```
|
|
22120
|
+
*
|
|
22121
|
+
* @param element Element for which the DOM listeners should be retrieved.
|
|
22122
|
+
* @returns Array of event listeners on the DOM element.
|
|
22123
|
+
*
|
|
22124
|
+
* @publicApi
|
|
22125
|
+
* @globalApi ng
|
|
22126
|
+
*/
|
|
22127
|
+
function getListeners(element) {
|
|
22128
|
+
ngDevMode && assertDomElement(element);
|
|
22129
|
+
const lContext = getLContext(element);
|
|
22130
|
+
const lView = lContext === null ? null : lContext.lView;
|
|
22131
|
+
if (lView === null)
|
|
22132
|
+
return [];
|
|
22133
|
+
const tView = lView[TVIEW];
|
|
22134
|
+
const lCleanup = lView[CLEANUP];
|
|
22135
|
+
const tCleanup = tView.cleanup;
|
|
22136
|
+
const listeners = [];
|
|
22137
|
+
if (tCleanup && lCleanup) {
|
|
22138
|
+
for (let i = 0; i < tCleanup.length;) {
|
|
22139
|
+
const firstParam = tCleanup[i++];
|
|
22140
|
+
const secondParam = tCleanup[i++];
|
|
22141
|
+
if (typeof firstParam === 'string') {
|
|
22142
|
+
const name = firstParam;
|
|
22143
|
+
const listenerElement = unwrapRNode(lView[secondParam]);
|
|
22144
|
+
const callback = lCleanup[tCleanup[i++]];
|
|
22145
|
+
const useCaptureOrIndx = tCleanup[i++];
|
|
22146
|
+
// if useCaptureOrIndx is boolean then report it as is.
|
|
22147
|
+
// if useCaptureOrIndx is positive number then it in unsubscribe method
|
|
22148
|
+
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
22149
|
+
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
22150
|
+
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
22151
|
+
if (element == listenerElement) {
|
|
22152
|
+
listeners.push({ element, name, callback, useCapture, type });
|
|
22153
|
+
}
|
|
22379
22154
|
}
|
|
22380
|
-
], stringify(ngModuleType), new Set(['environment']));
|
|
22381
|
-
// We need to resolve the injector types separately from the injector creation, because
|
|
22382
|
-
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
22383
|
-
// circular error that will eventually error out, because the injector isn't created yet.
|
|
22384
|
-
this._r3Injector.resolveInjectorInitializers();
|
|
22385
|
-
this.instance = this.get(ngModuleType);
|
|
22386
|
-
}
|
|
22387
|
-
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
22388
|
-
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
22389
|
-
return this;
|
|
22390
22155
|
}
|
|
22391
|
-
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
22392
|
-
}
|
|
22393
|
-
destroy() {
|
|
22394
|
-
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
22395
|
-
const injector = this._r3Injector;
|
|
22396
|
-
!injector.destroyed && injector.destroy();
|
|
22397
|
-
this.destroyCbs.forEach(fn => fn());
|
|
22398
|
-
this.destroyCbs = null;
|
|
22399
|
-
}
|
|
22400
|
-
onDestroy(callback) {
|
|
22401
|
-
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
22402
|
-
this.destroyCbs.push(callback);
|
|
22403
|
-
}
|
|
22404
|
-
}
|
|
22405
|
-
class NgModuleFactory extends NgModuleFactory$1 {
|
|
22406
|
-
constructor(moduleType) {
|
|
22407
|
-
super();
|
|
22408
|
-
this.moduleType = moduleType;
|
|
22409
|
-
}
|
|
22410
|
-
create(parentInjector) {
|
|
22411
|
-
return new NgModuleRef(this.moduleType, parentInjector);
|
|
22412
22156
|
}
|
|
22157
|
+
listeners.sort(sortListeners);
|
|
22158
|
+
return listeners;
|
|
22413
22159
|
}
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
this.instance = null;
|
|
22419
|
-
const injector = new R3Injector([
|
|
22420
|
-
...providers,
|
|
22421
|
-
{ provide: NgModuleRef$1, useValue: this },
|
|
22422
|
-
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
22423
|
-
], parent || getNullInjector(), source, new Set(['environment']));
|
|
22424
|
-
this.injector = injector;
|
|
22425
|
-
injector.resolveInjectorInitializers();
|
|
22426
|
-
}
|
|
22427
|
-
destroy() {
|
|
22428
|
-
this.injector.destroy();
|
|
22429
|
-
}
|
|
22430
|
-
onDestroy(callback) {
|
|
22431
|
-
this.injector.onDestroy(callback);
|
|
22432
|
-
}
|
|
22160
|
+
function sortListeners(a, b) {
|
|
22161
|
+
if (a.name == b.name)
|
|
22162
|
+
return 0;
|
|
22163
|
+
return a.name < b.name ? -1 : 1;
|
|
22433
22164
|
}
|
|
22434
22165
|
/**
|
|
22435
|
-
*
|
|
22166
|
+
* This function should not exist because it is megamorphic and only mostly correct.
|
|
22436
22167
|
*
|
|
22437
|
-
*
|
|
22438
|
-
* @developerPreview
|
|
22168
|
+
* See call site for more info.
|
|
22439
22169
|
*/
|
|
22440
|
-
function
|
|
22441
|
-
|
|
22442
|
-
return adapter.injector;
|
|
22170
|
+
function isDirectiveDefHack(obj) {
|
|
22171
|
+
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22443
22172
|
}
|
|
22444
|
-
|
|
22445
22173
|
/**
|
|
22446
|
-
*
|
|
22447
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22174
|
+
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22448
22175
|
*
|
|
22449
|
-
*
|
|
22450
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22451
|
-
*/
|
|
22452
|
-
/**
|
|
22453
|
-
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
22454
|
-
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
22455
|
-
* collected from the imports graph rooted at a given standalone component.
|
|
22176
|
+
* @param element DOM element which is owned by an existing component's view.
|
|
22456
22177
|
*/
|
|
22457
|
-
|
|
22458
|
-
|
|
22459
|
-
|
|
22460
|
-
this.cachedInjectors = new Map();
|
|
22178
|
+
function getDebugNode$1(element) {
|
|
22179
|
+
if (ngDevMode && !(element instanceof Node)) {
|
|
22180
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22461
22181
|
}
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
22467
|
-
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
22468
|
-
const standaloneInjector = providers.length > 0 ?
|
|
22469
|
-
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22470
|
-
null;
|
|
22471
|
-
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
22472
|
-
}
|
|
22473
|
-
return this.cachedInjectors.get(componentDef.id);
|
|
22182
|
+
const lContext = getLContext(element);
|
|
22183
|
+
const lView = lContext ? lContext.lView : null;
|
|
22184
|
+
if (lView === null) {
|
|
22185
|
+
return null;
|
|
22474
22186
|
}
|
|
22475
|
-
|
|
22476
|
-
|
|
22477
|
-
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
this.cachedInjectors.clear();
|
|
22485
|
-
}
|
|
22187
|
+
const nodeIndex = lContext.nodeIndex;
|
|
22188
|
+
if (nodeIndex !== -1) {
|
|
22189
|
+
const valueInLView = lView[nodeIndex];
|
|
22190
|
+
// this means that value in the lView is a component with its own
|
|
22191
|
+
// data. In this situation the TNode is not accessed at the same spot.
|
|
22192
|
+
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22193
|
+
ngDevMode &&
|
|
22194
|
+
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22195
|
+
return buildDebugNode(tNode, lView);
|
|
22486
22196
|
}
|
|
22197
|
+
return null;
|
|
22487
22198
|
}
|
|
22488
|
-
/** @nocollapse */
|
|
22489
|
-
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22490
|
-
token: StandaloneService,
|
|
22491
|
-
providedIn: 'environment',
|
|
22492
|
-
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22493
|
-
});
|
|
22494
22199
|
/**
|
|
22495
|
-
*
|
|
22200
|
+
* Retrieve the component `LView` from component/element.
|
|
22496
22201
|
*
|
|
22497
|
-
*
|
|
22498
|
-
*
|
|
22499
|
-
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
22500
|
-
* is tree-shakable and not included in applications that don't use standalone components.
|
|
22202
|
+
* NOTE: `LView` is a private and should not be leaked outside.
|
|
22203
|
+
* Don't export this method to `ng.*` on window.
|
|
22501
22204
|
*
|
|
22502
|
-
* @
|
|
22205
|
+
* @param target DOM element or component instance for which to retrieve the LView.
|
|
22503
22206
|
*/
|
|
22504
|
-
function
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
|
|
22207
|
+
function getComponentLView(target) {
|
|
22208
|
+
const lContext = getLContext(target);
|
|
22209
|
+
const nodeIndx = lContext.nodeIndex;
|
|
22210
|
+
const lView = lContext.lView;
|
|
22211
|
+
ngDevMode && assertLView(lView);
|
|
22212
|
+
const componentLView = lView[nodeIndx];
|
|
22213
|
+
ngDevMode && assertLView(componentLView);
|
|
22214
|
+
return componentLView;
|
|
22215
|
+
}
|
|
22216
|
+
/** Asserts that a value is a DOM Element. */
|
|
22217
|
+
function assertDomElement(value) {
|
|
22218
|
+
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
22219
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22220
|
+
}
|
|
22508
22221
|
}
|
|
22509
22222
|
|
|
22510
22223
|
/**
|
|
@@ -23725,7 +23438,7 @@ const unusedValueExportToPlacateAjd = 1;
|
|
|
23725
23438
|
* Use of this source code is governed by an MIT-style license that can be
|
|
23726
23439
|
* found in the LICENSE file at https://angular.io/license
|
|
23727
23440
|
*/
|
|
23728
|
-
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$
|
|
23441
|
+
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
|
|
23729
23442
|
class LQuery_ {
|
|
23730
23443
|
constructor(queryList) {
|
|
23731
23444
|
this.queryList = queryList;
|
|
@@ -26147,6 +25860,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
|
26147
25860
|
class CompilerFactory {
|
|
26148
25861
|
}
|
|
26149
25862
|
|
|
25863
|
+
/**
|
|
25864
|
+
* @license
|
|
25865
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25866
|
+
*
|
|
25867
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25868
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25869
|
+
*/
|
|
25870
|
+
/**
|
|
25871
|
+
* Marks a component for check (in case of OnPush components) and synchronously
|
|
25872
|
+
* performs change detection on the application this component belongs to.
|
|
25873
|
+
*
|
|
25874
|
+
* @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
|
|
25875
|
+
*
|
|
25876
|
+
* @publicApi
|
|
25877
|
+
* @globalApi ng
|
|
25878
|
+
*/
|
|
25879
|
+
function applyChanges(component) {
|
|
25880
|
+
markDirty(component);
|
|
25881
|
+
getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
|
|
25882
|
+
}
|
|
25883
|
+
|
|
25884
|
+
/**
|
|
25885
|
+
* @license
|
|
25886
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25887
|
+
*
|
|
25888
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25889
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25890
|
+
*/
|
|
25891
|
+
/**
|
|
25892
|
+
* This file introduces series of globally accessible debug tools
|
|
25893
|
+
* to allow for the Angular debugging story to function.
|
|
25894
|
+
*
|
|
25895
|
+
* To see this in action run the following command:
|
|
25896
|
+
*
|
|
25897
|
+
* bazel run //packages/core/test/bundling/todo:devserver
|
|
25898
|
+
*
|
|
25899
|
+
* Then load `localhost:5432` and start using the console tools.
|
|
25900
|
+
*/
|
|
25901
|
+
/**
|
|
25902
|
+
* This value reflects the property on the window where the dev
|
|
25903
|
+
* tools are patched (window.ng).
|
|
25904
|
+
* */
|
|
25905
|
+
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
25906
|
+
let _published = false;
|
|
25907
|
+
/**
|
|
25908
|
+
* Publishes a collection of default debug tools onto`window.ng`.
|
|
25909
|
+
*
|
|
25910
|
+
* These functions are available globally when Angular is in development
|
|
25911
|
+
* mode and are automatically stripped away from prod mode is on.
|
|
25912
|
+
*/
|
|
25913
|
+
function publishDefaultGlobalUtils$1() {
|
|
25914
|
+
if (!_published) {
|
|
25915
|
+
_published = true;
|
|
25916
|
+
/**
|
|
25917
|
+
* Warning: this function is *INTERNAL* and should not be relied upon in application's code.
|
|
25918
|
+
* The contract of the function might be changed in any release and/or the function can be
|
|
25919
|
+
* removed completely.
|
|
25920
|
+
*/
|
|
25921
|
+
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
25922
|
+
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
25923
|
+
publishGlobalUtil('getComponent', getComponent);
|
|
25924
|
+
publishGlobalUtil('getContext', getContext);
|
|
25925
|
+
publishGlobalUtil('getListeners', getListeners);
|
|
25926
|
+
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
25927
|
+
publishGlobalUtil('getHostElement', getHostElement);
|
|
25928
|
+
publishGlobalUtil('getInjector', getInjector);
|
|
25929
|
+
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
25930
|
+
publishGlobalUtil('getDirectives', getDirectives);
|
|
25931
|
+
publishGlobalUtil('applyChanges', applyChanges);
|
|
25932
|
+
}
|
|
25933
|
+
}
|
|
25934
|
+
/**
|
|
25935
|
+
* Publishes the given function to `window.ng` so that it can be
|
|
25936
|
+
* used from the browser console when an application is not in production.
|
|
25937
|
+
*/
|
|
25938
|
+
function publishGlobalUtil(name, fn) {
|
|
25939
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
|
25940
|
+
// Note: we can't export `ng` when using closure enhanced optimization as:
|
|
25941
|
+
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
25942
|
+
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
25943
|
+
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
25944
|
+
const w = _global;
|
|
25945
|
+
ngDevMode && assertDefined(fn, 'function not defined');
|
|
25946
|
+
if (w) {
|
|
25947
|
+
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
25948
|
+
if (!container) {
|
|
25949
|
+
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
25950
|
+
}
|
|
25951
|
+
container[name] = fn;
|
|
25952
|
+
}
|
|
25953
|
+
}
|
|
25954
|
+
}
|
|
25955
|
+
|
|
26150
25956
|
/**
|
|
26151
25957
|
* @license
|
|
26152
25958
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -28063,7 +27869,7 @@ class DebugNode {
|
|
|
28063
27869
|
get componentInstance() {
|
|
28064
27870
|
const nativeElement = this.nativeNode;
|
|
28065
27871
|
return nativeElement &&
|
|
28066
|
-
(getComponent
|
|
27872
|
+
(getComponent(nativeElement) || getOwningComponent(nativeElement));
|
|
28067
27873
|
}
|
|
28068
27874
|
/**
|
|
28069
27875
|
* An object that provides parent context for this element. Often an ancestor component instance
|
|
@@ -28074,7 +27880,7 @@ class DebugNode {
|
|
|
28074
27880
|
* of heroes"`.
|
|
28075
27881
|
*/
|
|
28076
27882
|
get context() {
|
|
28077
|
-
return getComponent
|
|
27883
|
+
return getComponent(this.nativeNode) || getContext(this.nativeNode);
|
|
28078
27884
|
}
|
|
28079
27885
|
/**
|
|
28080
27886
|
* The callbacks attached to the component's @Output properties and/or the element's event
|
|
@@ -28414,8 +28220,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28414
28220
|
// Renderer2, however that's not the case in Ivy. This approach is being used because:
|
|
28415
28221
|
// 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
|
|
28416
28222
|
// from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
|
|
28417
|
-
// 2.
|
|
28418
|
-
// 3. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28223
|
+
// 2. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28419
28224
|
nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
|
|
28420
28225
|
}
|
|
28421
28226
|
// In all cases, if a dynamic container exists for this node, each view inside it has to be
|
|
@@ -29887,5 +29692,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
29887
29692
|
* Generated bundle index. Do not edit.
|
|
29888
29693
|
*/
|
|
29889
29694
|
|
|
29890
|
-
export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData,
|
|
29695
|
+
export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
|
|
29891
29696
|
//# sourceMappingURL=core.mjs.map
|