@angular/core 14.1.0-next.2 → 14.1.0-rc.0
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 +29 -15
- package/esm2020/src/change_detection/change_detector_ref.mjs +1 -1
- package/esm2020/src/core.mjs +2 -2
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +3 -4
- package/esm2020/src/di/index.mjs +1 -1
- package/esm2020/src/di/injector_compatibility.mjs +13 -8
- package/esm2020/src/di/injector_token.mjs +2 -2
- package/esm2020/src/di/interface/injector.mjs +2 -1
- package/esm2020/src/di/jit/util.mjs +3 -2
- package/esm2020/src/di/r3_injector.mjs +13 -1
- package/esm2020/src/di/reflective_key.mjs +3 -2
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/locale_data_api.mjs +3 -2
- package/esm2020/src/linker/component_factory.mjs +1 -1
- package/esm2020/src/linker/ng_module_factory.mjs +2 -2
- package/esm2020/src/linker/view_container_ref.mjs +2 -2
- package/esm2020/src/metadata/di.mjs +1 -1
- package/esm2020/src/render/api.mjs +2 -11
- package/esm2020/src/render3/component.mjs +3 -57
- package/esm2020/src/render3/component_ref.mjs +30 -5
- package/esm2020/src/render3/features/standalone_feature.mjs +2 -2
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +2 -20
- package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
- package/esm2020/src/render3/instructions/listener.mjs +34 -44
- package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
- package/esm2020/src/render3/instructions/property_interpolation.mjs +2 -2
- package/esm2020/src/render3/instructions/shared.mjs +22 -59
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/i18n.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -17
- package/esm2020/src/render3/interfaces/styling.mjs +1 -1
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/ng_module_ref.mjs +15 -2
- 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/src/zone/ng_zone.mjs +9 -4
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +1697 -1830
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1037 -1279
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1697 -1830
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +1037 -1279
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +169 -144
- package/package.json +1 -1
- package/schematics/migrations/typed-forms/util.js +2 -2
- package/schematics/utils/typescript/symbol.js +2 -2
- package/testing/index.d.ts +1 -1
- package/schematics/utils/schematics_prompt.d.ts +0 -17
- package/schematics/utils/schematics_prompt.js +0 -45
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0-
|
|
2
|
+
* @license Angular v14.1.0-rc.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -499,6 +499,7 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
|
|
|
499
499
|
* Injection flags for DI.
|
|
500
500
|
*
|
|
501
501
|
* @publicApi
|
|
502
|
+
* @deprecated use an options object for `inject` instead.
|
|
502
503
|
*/
|
|
503
504
|
var InjectFlags;
|
|
504
505
|
(function (InjectFlags) {
|
|
@@ -1586,87 +1587,6 @@ function getNamespaceUri(namespace) {
|
|
|
1586
1587
|
(name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
|
|
1587
1588
|
}
|
|
1588
1589
|
|
|
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
|
-
const domRendererFactory3 = {
|
|
1662
|
-
createRenderer: (hostElement, rendererType) => {
|
|
1663
|
-
return getDocument();
|
|
1664
|
-
}
|
|
1665
|
-
};
|
|
1666
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
1667
|
-
// failure based on types.
|
|
1668
|
-
const unusedValueExportToPlacateAjd$6 = 1;
|
|
1669
|
-
|
|
1670
1590
|
/**
|
|
1671
1591
|
* @license
|
|
1672
1592
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1749,7 +1669,6 @@ function getNativeByTNode(tNode, lView) {
|
|
|
1749
1669
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1750
1670
|
ngDevMode && assertIndexInRange(lView, tNode.index);
|
|
1751
1671
|
const node = unwrapRNode(lView[tNode.index]);
|
|
1752
|
-
ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1753
1672
|
return node;
|
|
1754
1673
|
}
|
|
1755
1674
|
/**
|
|
@@ -1765,7 +1684,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
|
|
|
1765
1684
|
if (index !== -1) {
|
|
1766
1685
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1767
1686
|
const node = unwrapRNode(lView[index]);
|
|
1768
|
-
ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1769
1687
|
return node;
|
|
1770
1688
|
}
|
|
1771
1689
|
return null;
|
|
@@ -2714,7 +2632,7 @@ function isFactory(obj) {
|
|
|
2714
2632
|
}
|
|
2715
2633
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2716
2634
|
// failure based on types.
|
|
2717
|
-
const unusedValueExportToPlacateAjd$
|
|
2635
|
+
const unusedValueExportToPlacateAjd$6 = 1;
|
|
2718
2636
|
|
|
2719
2637
|
/**
|
|
2720
2638
|
* Converts `TNodeType` into human readable text.
|
|
@@ -2733,7 +2651,7 @@ function toTNodeTypeAsString(tNodeType) {
|
|
|
2733
2651
|
}
|
|
2734
2652
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2735
2653
|
// failure based on types.
|
|
2736
|
-
const unusedValueExportToPlacateAjd$
|
|
2654
|
+
const unusedValueExportToPlacateAjd$5 = 1;
|
|
2737
2655
|
/**
|
|
2738
2656
|
* Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
|
|
2739
2657
|
*
|
|
@@ -2837,7 +2755,6 @@ function assertPureTNodeType(type) {
|
|
|
2837
2755
|
* @returns the index value that was last accessed in the attributes array
|
|
2838
2756
|
*/
|
|
2839
2757
|
function setUpAttributes(renderer, native, attrs) {
|
|
2840
|
-
const isProc = isProceduralRenderer(renderer);
|
|
2841
2758
|
let i = 0;
|
|
2842
2759
|
while (i < attrs.length) {
|
|
2843
2760
|
const value = attrs[i];
|
|
@@ -2854,9 +2771,7 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2854
2771
|
const attrName = attrs[i++];
|
|
2855
2772
|
const attrVal = attrs[i++];
|
|
2856
2773
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2857
|
-
|
|
2858
|
-
renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
|
|
2859
|
-
native.setAttributeNS(namespaceURI, attrName, attrVal);
|
|
2774
|
+
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
|
|
2860
2775
|
}
|
|
2861
2776
|
else {
|
|
2862
2777
|
// attrName is string;
|
|
@@ -2865,14 +2780,10 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2865
2780
|
// Standard attributes
|
|
2866
2781
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2867
2782
|
if (isAnimationProp(attrName)) {
|
|
2868
|
-
|
|
2869
|
-
renderer.setProperty(native, attrName, attrVal);
|
|
2870
|
-
}
|
|
2783
|
+
renderer.setProperty(native, attrName, attrVal);
|
|
2871
2784
|
}
|
|
2872
2785
|
else {
|
|
2873
|
-
|
|
2874
|
-
renderer.setAttribute(native, attrName, attrVal) :
|
|
2875
|
-
native.setAttribute(attrName, attrVal);
|
|
2786
|
+
renderer.setAttribute(native, attrName, attrVal);
|
|
2876
2787
|
}
|
|
2877
2788
|
i++;
|
|
2878
2789
|
}
|
|
@@ -4854,22 +4765,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
|
|
|
4854
4765
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
4855
4766
|
* particular class.
|
|
4856
4767
|
*
|
|
4857
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
4858
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
4859
|
-
*
|
|
4860
4768
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
4861
4769
|
* and thus in the stack trace.
|
|
4862
4770
|
*
|
|
4863
4771
|
* @codeGenApi
|
|
4864
4772
|
*/
|
|
4865
4773
|
function ɵɵinvalidFactoryDep(index) {
|
|
4866
|
-
|
|
4774
|
+
throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
|
|
4867
4775
|
`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
|
|
4868
4776
|
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
|
|
4869
4777
|
|
|
4870
|
-
Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`
|
|
4871
|
-
'invalid';
|
|
4872
|
-
throw new Error(msg);
|
|
4778
|
+
Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
|
|
4873
4779
|
}
|
|
4874
4780
|
/**
|
|
4875
4781
|
* Injects a token from the currently active injector.
|
|
@@ -4936,6 +4842,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
4936
4842
|
* @publicApi
|
|
4937
4843
|
*/
|
|
4938
4844
|
function inject(token, flags = InjectFlags.Default) {
|
|
4845
|
+
if (typeof flags !== 'number') {
|
|
4846
|
+
// While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
|
|
4847
|
+
// JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
|
|
4848
|
+
// `InjectOptions` to `InjectFlags`.
|
|
4849
|
+
flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
|
|
4850
|
+
(flags.optional && 8 /* InternalInjectFlags.Optional */) |
|
|
4851
|
+
(flags.host && 1 /* InternalInjectFlags.Host */) |
|
|
4852
|
+
(flags.self && 2 /* InternalInjectFlags.Self */) |
|
|
4853
|
+
(flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
|
|
4854
|
+
}
|
|
4939
4855
|
return ɵɵinject(token, flags);
|
|
4940
4856
|
}
|
|
4941
4857
|
function injectArgs(types) {
|
|
@@ -5133,7 +5049,7 @@ function reflectDependency(dep) {
|
|
|
5133
5049
|
}
|
|
5134
5050
|
else if (param instanceof Attribute) {
|
|
5135
5051
|
if (param.attributeName === undefined) {
|
|
5136
|
-
throw new
|
|
5052
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
|
|
5137
5053
|
}
|
|
5138
5054
|
meta.attribute = param.attributeName;
|
|
5139
5055
|
}
|
|
@@ -5319,6 +5235,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5319
5235
|
checkForDuplicateNgModules = !allowDuplicates;
|
|
5320
5236
|
}
|
|
5321
5237
|
|
|
5238
|
+
/**
|
|
5239
|
+
* @license
|
|
5240
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5241
|
+
*
|
|
5242
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5243
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5244
|
+
*/
|
|
5245
|
+
/**
|
|
5246
|
+
* Most of the use of `document` in Angular is from within the DI system so it is possible to simply
|
|
5247
|
+
* inject the `DOCUMENT` token and are done.
|
|
5248
|
+
*
|
|
5249
|
+
* Ivy is special because it does not rely upon the DI and must get hold of the document some other
|
|
5250
|
+
* way.
|
|
5251
|
+
*
|
|
5252
|
+
* The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
|
|
5253
|
+
* Wherever ivy needs the global document, it calls `getDocument()` instead.
|
|
5254
|
+
*
|
|
5255
|
+
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
5256
|
+
* tell ivy what the global `document` is.
|
|
5257
|
+
*
|
|
5258
|
+
* Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
|
|
5259
|
+
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
5260
|
+
*/
|
|
5261
|
+
let DOCUMENT = undefined;
|
|
5262
|
+
/**
|
|
5263
|
+
* Tell ivy what the `document` is for this platform.
|
|
5264
|
+
*
|
|
5265
|
+
* It is only necessary to call this if the current platform is not a browser.
|
|
5266
|
+
*
|
|
5267
|
+
* @param document The object representing the global `document` in this environment.
|
|
5268
|
+
*/
|
|
5269
|
+
function setDocument(document) {
|
|
5270
|
+
DOCUMENT = document;
|
|
5271
|
+
}
|
|
5272
|
+
/**
|
|
5273
|
+
* Access the object that represents the `document` for this platform.
|
|
5274
|
+
*
|
|
5275
|
+
* Ivy calls this whenever it needs to access the `document` object.
|
|
5276
|
+
* For example to create the renderer or to do sanitization.
|
|
5277
|
+
*/
|
|
5278
|
+
function getDocument() {
|
|
5279
|
+
if (DOCUMENT !== undefined) {
|
|
5280
|
+
return DOCUMENT;
|
|
5281
|
+
}
|
|
5282
|
+
else if (typeof document !== 'undefined') {
|
|
5283
|
+
return document;
|
|
5284
|
+
}
|
|
5285
|
+
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
5286
|
+
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
5287
|
+
// this should not happen in Angular apps.
|
|
5288
|
+
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
5289
|
+
// public API. Meanwhile we just return `undefined` and let the application fail.
|
|
5290
|
+
return undefined;
|
|
5291
|
+
}
|
|
5292
|
+
|
|
5322
5293
|
/**
|
|
5323
5294
|
* @license
|
|
5324
5295
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7054,6 +7025,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
7054
7025
|
}
|
|
7055
7026
|
}
|
|
7056
7027
|
|
|
7028
|
+
/**
|
|
7029
|
+
* @license
|
|
7030
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7031
|
+
*
|
|
7032
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7033
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7034
|
+
*/
|
|
7035
|
+
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
7036
|
+
// failure based on types.
|
|
7037
|
+
const unusedValueExportToPlacateAjd$4 = 1;
|
|
7038
|
+
|
|
7057
7039
|
/**
|
|
7058
7040
|
* @license
|
|
7059
7041
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7136,7 +7118,7 @@ function getNearestLContainer(viewOrContainer) {
|
|
|
7136
7118
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7137
7119
|
* found in the LICENSE file at https://angular.io/license
|
|
7138
7120
|
*/
|
|
7139
|
-
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$
|
|
7121
|
+
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
|
|
7140
7122
|
/**
|
|
7141
7123
|
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
7142
7124
|
* being passed as an argument.
|
|
@@ -7161,7 +7143,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7161
7143
|
lNodeToHandle = lNodeToHandle[HOST];
|
|
7162
7144
|
}
|
|
7163
7145
|
const rNode = unwrapRNode(lNodeToHandle);
|
|
7164
|
-
ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
|
|
7165
7146
|
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7166
7147
|
if (beforeNode == null) {
|
|
7167
7148
|
nativeAppendChild(renderer, parent, rNode);
|
|
@@ -7188,17 +7169,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7188
7169
|
function createTextNode(renderer, value) {
|
|
7189
7170
|
ngDevMode && ngDevMode.rendererCreateTextNode++;
|
|
7190
7171
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7191
|
-
return
|
|
7192
|
-
renderer.createTextNode(value);
|
|
7172
|
+
return renderer.createText(value);
|
|
7193
7173
|
}
|
|
7194
7174
|
function updateTextNode(renderer, rNode, value) {
|
|
7195
7175
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7196
|
-
|
|
7176
|
+
renderer.setValue(rNode, value);
|
|
7197
7177
|
}
|
|
7198
7178
|
function createCommentNode(renderer, value) {
|
|
7199
7179
|
ngDevMode && ngDevMode.rendererCreateComment++;
|
|
7200
|
-
// isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
|
|
7201
|
-
// method name.
|
|
7202
7180
|
return renderer.createComment(escapeCommentText(value));
|
|
7203
7181
|
}
|
|
7204
7182
|
/**
|
|
@@ -7210,14 +7188,7 @@ function createCommentNode(renderer, value) {
|
|
|
7210
7188
|
*/
|
|
7211
7189
|
function createElementNode(renderer, name, namespace) {
|
|
7212
7190
|
ngDevMode && ngDevMode.rendererCreateElement++;
|
|
7213
|
-
|
|
7214
|
-
return renderer.createElement(name, namespace);
|
|
7215
|
-
}
|
|
7216
|
-
else {
|
|
7217
|
-
const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
|
|
7218
|
-
return namespaceUri === null ? renderer.createElement(name) :
|
|
7219
|
-
renderer.createElementNS(namespaceUri, name);
|
|
7220
|
-
}
|
|
7191
|
+
return renderer.createElement(name, namespace);
|
|
7221
7192
|
}
|
|
7222
7193
|
/**
|
|
7223
7194
|
* Removes all DOM elements associated with a view.
|
|
@@ -7449,7 +7420,7 @@ function detachView(lContainer, removeIndex) {
|
|
|
7449
7420
|
function destroyLView(tView, lView) {
|
|
7450
7421
|
if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
|
|
7451
7422
|
const renderer = lView[RENDERER];
|
|
7452
|
-
if (
|
|
7423
|
+
if (renderer.destroyNode) {
|
|
7453
7424
|
applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
|
|
7454
7425
|
}
|
|
7455
7426
|
destroyViewTree(lView);
|
|
@@ -7477,7 +7448,7 @@ function cleanUpView(tView, lView) {
|
|
|
7477
7448
|
executeOnDestroys(tView, lView);
|
|
7478
7449
|
processCleanups(tView, lView);
|
|
7479
7450
|
// For component views only, the local renderer is destroyed at clean up time.
|
|
7480
|
-
if (lView[TVIEW].type === 1 /* TViewType.Component */
|
|
7451
|
+
if (lView[TVIEW].type === 1 /* TViewType.Component */) {
|
|
7481
7452
|
ngDevMode && ngDevMode.rendererDestroy++;
|
|
7482
7453
|
lView[RENDERER].destroy();
|
|
7483
7454
|
}
|
|
@@ -7653,30 +7624,17 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7653
7624
|
}
|
|
7654
7625
|
}
|
|
7655
7626
|
/**
|
|
7656
|
-
* Inserts a native node before another native node for a given parent
|
|
7657
|
-
* This is a utility function that can be used when native nodes were determined
|
|
7658
|
-
* actual renderer being used.
|
|
7627
|
+
* Inserts a native node before another native node for a given parent.
|
|
7628
|
+
* This is a utility function that can be used when native nodes were determined.
|
|
7659
7629
|
*/
|
|
7660
7630
|
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7661
7631
|
ngDevMode && ngDevMode.rendererInsertBefore++;
|
|
7662
|
-
|
|
7663
|
-
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7664
|
-
}
|
|
7665
|
-
else {
|
|
7666
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7667
|
-
targetParent.insertBefore(child, beforeNode, isMove);
|
|
7668
|
-
}
|
|
7632
|
+
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7669
7633
|
}
|
|
7670
7634
|
function nativeAppendChild(renderer, parent, child) {
|
|
7671
7635
|
ngDevMode && ngDevMode.rendererAppendChild++;
|
|
7672
7636
|
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
7673
|
-
|
|
7674
|
-
renderer.appendChild(parent, child);
|
|
7675
|
-
}
|
|
7676
|
-
else {
|
|
7677
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7678
|
-
targetParent.appendChild(child);
|
|
7679
|
-
}
|
|
7637
|
+
renderer.appendChild(parent, child);
|
|
7680
7638
|
}
|
|
7681
7639
|
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7682
7640
|
if (beforeNode !== null) {
|
|
@@ -7688,12 +7646,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
|
|
|
7688
7646
|
}
|
|
7689
7647
|
/** Removes a node from the DOM given its native parent. */
|
|
7690
7648
|
function nativeRemoveChild(renderer, parent, child, isHostElement) {
|
|
7691
|
-
|
|
7692
|
-
renderer.removeChild(parent, child, isHostElement);
|
|
7693
|
-
}
|
|
7694
|
-
else {
|
|
7695
|
-
parent.removeChild(child);
|
|
7696
|
-
}
|
|
7649
|
+
renderer.removeChild(parent, child, isHostElement);
|
|
7697
7650
|
}
|
|
7698
7651
|
/** Checks if an element is a `<template>` node. */
|
|
7699
7652
|
function isTemplateNode(node) {
|
|
@@ -7703,13 +7656,13 @@ function isTemplateNode(node) {
|
|
|
7703
7656
|
* Returns a native parent of a given native node.
|
|
7704
7657
|
*/
|
|
7705
7658
|
function nativeParentNode(renderer, node) {
|
|
7706
|
-
return
|
|
7659
|
+
return renderer.parentNode(node);
|
|
7707
7660
|
}
|
|
7708
7661
|
/**
|
|
7709
7662
|
* Returns a native sibling of a given native node.
|
|
7710
7663
|
*/
|
|
7711
7664
|
function nativeNextSibling(renderer, node) {
|
|
7712
|
-
return
|
|
7665
|
+
return renderer.nextSibling(node);
|
|
7713
7666
|
}
|
|
7714
7667
|
/**
|
|
7715
7668
|
* Find a node in front of which `currentTNode` should be inserted.
|
|
@@ -8018,39 +7971,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
|
|
|
8018
7971
|
* otherwise).
|
|
8019
7972
|
*/
|
|
8020
7973
|
function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
8021
|
-
const isProcedural = isProceduralRenderer(renderer);
|
|
8022
7974
|
if (isClassBased) {
|
|
8023
7975
|
// We actually want JS true/false here because any truthy value should add the class
|
|
8024
7976
|
if (!value) {
|
|
8025
7977
|
ngDevMode && ngDevMode.rendererRemoveClass++;
|
|
8026
|
-
|
|
8027
|
-
renderer.removeClass(rNode, prop);
|
|
8028
|
-
}
|
|
8029
|
-
else {
|
|
8030
|
-
rNode.classList.remove(prop);
|
|
8031
|
-
}
|
|
7978
|
+
renderer.removeClass(rNode, prop);
|
|
8032
7979
|
}
|
|
8033
7980
|
else {
|
|
8034
7981
|
ngDevMode && ngDevMode.rendererAddClass++;
|
|
8035
|
-
|
|
8036
|
-
renderer.addClass(rNode, prop);
|
|
8037
|
-
}
|
|
8038
|
-
else {
|
|
8039
|
-
ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
|
|
8040
|
-
rNode.classList.add(prop);
|
|
8041
|
-
}
|
|
7982
|
+
renderer.addClass(rNode, prop);
|
|
8042
7983
|
}
|
|
8043
7984
|
}
|
|
8044
7985
|
else {
|
|
8045
7986
|
let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
|
|
8046
7987
|
if (value == null /** || value === undefined */) {
|
|
8047
7988
|
ngDevMode && ngDevMode.rendererRemoveStyle++;
|
|
8048
|
-
|
|
8049
|
-
renderer.removeStyle(rNode, prop, flags);
|
|
8050
|
-
}
|
|
8051
|
-
else {
|
|
8052
|
-
rNode.style.removeProperty(prop);
|
|
8053
|
-
}
|
|
7989
|
+
renderer.removeStyle(rNode, prop, flags);
|
|
8054
7990
|
}
|
|
8055
7991
|
else {
|
|
8056
7992
|
// A value is important if it ends with `!important`. The style
|
|
@@ -8062,13 +7998,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8062
7998
|
flags |= RendererStyleFlags2.Important;
|
|
8063
7999
|
}
|
|
8064
8000
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8065
|
-
|
|
8066
|
-
renderer.setStyle(rNode, prop, value, flags);
|
|
8067
|
-
}
|
|
8068
|
-
else {
|
|
8069
|
-
ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
|
|
8070
|
-
rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
|
|
8071
|
-
}
|
|
8001
|
+
renderer.setStyle(rNode, prop, value, flags);
|
|
8072
8002
|
}
|
|
8073
8003
|
}
|
|
8074
8004
|
}
|
|
@@ -8084,12 +8014,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8084
8014
|
*/
|
|
8085
8015
|
function writeDirectStyle(renderer, element, newValue) {
|
|
8086
8016
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8087
|
-
|
|
8088
|
-
renderer.setAttribute(element, 'style', newValue);
|
|
8089
|
-
}
|
|
8090
|
-
else {
|
|
8091
|
-
element.style.cssText = newValue;
|
|
8092
|
-
}
|
|
8017
|
+
renderer.setAttribute(element, 'style', newValue);
|
|
8093
8018
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8094
8019
|
}
|
|
8095
8020
|
/**
|
|
@@ -8104,17 +8029,12 @@ function writeDirectStyle(renderer, element, newValue) {
|
|
|
8104
8029
|
*/
|
|
8105
8030
|
function writeDirectClass(renderer, element, newValue) {
|
|
8106
8031
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8107
|
-
if (
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
renderer.removeAttribute(element, 'class');
|
|
8111
|
-
}
|
|
8112
|
-
else {
|
|
8113
|
-
renderer.setAttribute(element, 'class', newValue);
|
|
8114
|
-
}
|
|
8032
|
+
if (newValue === '') {
|
|
8033
|
+
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
8034
|
+
renderer.removeAttribute(element, 'class');
|
|
8115
8035
|
}
|
|
8116
8036
|
else {
|
|
8117
|
-
element
|
|
8037
|
+
renderer.setAttribute(element, 'class', newValue);
|
|
8118
8038
|
}
|
|
8119
8039
|
ngDevMode && ngDevMode.rendererSetClassName++;
|
|
8120
8040
|
}
|
|
@@ -8164,7 +8084,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
8164
8084
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8165
8085
|
* found in the LICENSE file at https://angular.io/license
|
|
8166
8086
|
*/
|
|
8167
|
-
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$
|
|
8087
|
+
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
|
|
8168
8088
|
const NG_TEMPLATE_SELECTOR = 'ng-template';
|
|
8169
8089
|
/**
|
|
8170
8090
|
* Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
|
|
@@ -9049,7 +8969,7 @@ function isClassProvider(value) {
|
|
|
9049
8969
|
* @publicApi
|
|
9050
8970
|
*/
|
|
9051
8971
|
const INJECTOR = new InjectionToken('INJECTOR',
|
|
9052
|
-
//
|
|
8972
|
+
// Disable tslint because this is const enum which gets inlined not top level prop access.
|
|
9053
8973
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
9054
8974
|
-1 /* InjectorMarkers.Injector */);
|
|
9055
8975
|
|
|
@@ -9193,6 +9113,18 @@ class R3Injector extends EnvironmentInjector {
|
|
|
9193
9113
|
onDestroy(callback) {
|
|
9194
9114
|
this._onDestroyHooks.push(callback);
|
|
9195
9115
|
}
|
|
9116
|
+
runInContext(fn) {
|
|
9117
|
+
this.assertNotDestroyed();
|
|
9118
|
+
const previousInjector = setCurrentInjector(this);
|
|
9119
|
+
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
9120
|
+
try {
|
|
9121
|
+
return fn();
|
|
9122
|
+
}
|
|
9123
|
+
finally {
|
|
9124
|
+
setCurrentInjector(previousInjector);
|
|
9125
|
+
setInjectImplementation(previousInjectImplementation);
|
|
9126
|
+
}
|
|
9127
|
+
}
|
|
9196
9128
|
get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
|
|
9197
9129
|
this.assertNotDestroyed();
|
|
9198
9130
|
// Set the injection context.
|
|
@@ -9804,7 +9736,7 @@ class ReflectiveKey {
|
|
|
9804
9736
|
this.token = token;
|
|
9805
9737
|
this.id = id;
|
|
9806
9738
|
if (!token) {
|
|
9807
|
-
throw new
|
|
9739
|
+
throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
|
|
9808
9740
|
}
|
|
9809
9741
|
this.displayName = stringify(this.token);
|
|
9810
9742
|
}
|
|
@@ -10608,6 +10540,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
|
|
|
10608
10540
|
`the ${schemas} of this component.`;
|
|
10609
10541
|
}
|
|
10610
10542
|
}
|
|
10543
|
+
reportUnknownPropertyError(message);
|
|
10544
|
+
}
|
|
10545
|
+
function reportUnknownPropertyError(message) {
|
|
10611
10546
|
if (shouldThrowErrorOnUnknownProperty) {
|
|
10612
10547
|
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
10613
10548
|
}
|
|
@@ -11495,6 +11430,13 @@ class LContainerDebug {
|
|
|
11495
11430
|
}
|
|
11496
11431
|
}
|
|
11497
11432
|
|
|
11433
|
+
/**
|
|
11434
|
+
* @license
|
|
11435
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11436
|
+
*
|
|
11437
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11438
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11439
|
+
*/
|
|
11498
11440
|
/**
|
|
11499
11441
|
* A permanent marker promise which signifies that the current CD tree is
|
|
11500
11442
|
* clean.
|
|
@@ -11562,7 +11504,7 @@ function refreshChildComponents(hostLView, components) {
|
|
|
11562
11504
|
/** Renders child components in the current view (creation mode). */
|
|
11563
11505
|
function renderChildComponents(hostLView, components) {
|
|
11564
11506
|
for (let i = 0; i < components.length; i++) {
|
|
11565
|
-
renderComponent
|
|
11507
|
+
renderComponent(hostLView, components[i]);
|
|
11566
11508
|
}
|
|
11567
11509
|
}
|
|
11568
11510
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
@@ -12080,16 +12022,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
|
12080
12022
|
function createError(text, token) {
|
|
12081
12023
|
return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
|
|
12082
12024
|
}
|
|
12083
|
-
function assertHostNodeExists(rElement, elementOrSelector) {
|
|
12084
|
-
if (!rElement) {
|
|
12085
|
-
if (typeof elementOrSelector === 'string') {
|
|
12086
|
-
throw createError('Host node with selector not found:', elementOrSelector);
|
|
12087
|
-
}
|
|
12088
|
-
else {
|
|
12089
|
-
throw createError('Host node is required:', elementOrSelector);
|
|
12090
|
-
}
|
|
12091
|
-
}
|
|
12092
|
-
}
|
|
12093
12025
|
/**
|
|
12094
12026
|
* Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
|
|
12095
12027
|
*
|
|
@@ -12098,21 +12030,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
|
|
|
12098
12030
|
* @param encapsulation View Encapsulation defined for component that requests host element.
|
|
12099
12031
|
*/
|
|
12100
12032
|
function locateHostElement(renderer, elementOrSelector, encapsulation) {
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12105
|
-
}
|
|
12106
|
-
let rElement = typeof elementOrSelector === 'string' ?
|
|
12107
|
-
renderer.querySelector(elementOrSelector) :
|
|
12108
|
-
elementOrSelector;
|
|
12109
|
-
ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
|
|
12110
|
-
// Always clear host element's content when Renderer3 is in use. For procedural renderer case we
|
|
12111
|
-
// make it depend on whether ShadowDom encapsulation is used (in which case the content should be
|
|
12112
|
-
// preserved to allow native slot projection). ShadowDom encapsulation requires procedural
|
|
12113
|
-
// renderer, and procedural renderer case is handled above.
|
|
12114
|
-
rElement.textContent = '';
|
|
12115
|
-
return rElement;
|
|
12033
|
+
// When using native Shadow DOM, do not clear host element to allow native slot projection
|
|
12034
|
+
const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
|
|
12035
|
+
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12116
12036
|
}
|
|
12117
12037
|
/**
|
|
12118
12038
|
* Saves context for this cleanup function in LView.cleanupInstances.
|
|
@@ -12327,13 +12247,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12327
12247
|
// It is assumed that the sanitizer is only added when the compiler determines that the
|
|
12328
12248
|
// property is risky, so sanitization can be done without further checks.
|
|
12329
12249
|
value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
|
|
12330
|
-
|
|
12331
|
-
renderer.setProperty(element, propName, value);
|
|
12332
|
-
}
|
|
12333
|
-
else if (!isAnimationProp(propName)) {
|
|
12334
|
-
element.setProperty ? element.setProperty(propName, value) :
|
|
12335
|
-
element[propName] = value;
|
|
12336
|
-
}
|
|
12250
|
+
renderer.setProperty(element, propName, value);
|
|
12337
12251
|
}
|
|
12338
12252
|
else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
|
|
12339
12253
|
// If the node is a container and the property didn't
|
|
@@ -12357,23 +12271,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
|
12357
12271
|
const debugValue = normalizeDebugBindingValue(value);
|
|
12358
12272
|
if (type & 3 /* TNodeType.AnyRNode */) {
|
|
12359
12273
|
if (value == null) {
|
|
12360
|
-
|
|
12361
|
-
element.removeAttribute(attrName);
|
|
12274
|
+
renderer.removeAttribute(element, attrName);
|
|
12362
12275
|
}
|
|
12363
12276
|
else {
|
|
12364
|
-
|
|
12365
|
-
renderer.setAttribute(element, attrName, debugValue) :
|
|
12366
|
-
element.setAttribute(attrName, debugValue);
|
|
12277
|
+
renderer.setAttribute(element, attrName, debugValue);
|
|
12367
12278
|
}
|
|
12368
12279
|
}
|
|
12369
12280
|
else {
|
|
12370
12281
|
const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
|
|
12371
|
-
|
|
12372
|
-
renderer.setValue(element, textContent);
|
|
12373
|
-
}
|
|
12374
|
-
else {
|
|
12375
|
-
element.textContent = textContent;
|
|
12376
|
-
}
|
|
12282
|
+
renderer.setValue(element, textContent);
|
|
12377
12283
|
}
|
|
12378
12284
|
}
|
|
12379
12285
|
function setNgReflectProperties(lView, element, type, dataValue, value) {
|
|
@@ -12403,6 +12309,7 @@ function instantiateRootComponent(tView, lView, def) {
|
|
|
12403
12309
|
ngDevMode &&
|
|
12404
12310
|
assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
|
|
12405
12311
|
configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
|
|
12312
|
+
initializeInputAndOutputAliases(tView, rootTNode);
|
|
12406
12313
|
}
|
|
12407
12314
|
const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
|
|
12408
12315
|
attachPatchData(directive, lView);
|
|
@@ -12727,19 +12634,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
|
|
|
12727
12634
|
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
|
|
12728
12635
|
if (value == null) {
|
|
12729
12636
|
ngDevMode && ngDevMode.rendererRemoveAttribute++;
|
|
12730
|
-
|
|
12731
|
-
element.removeAttribute(name);
|
|
12637
|
+
renderer.removeAttribute(element, name, namespace);
|
|
12732
12638
|
}
|
|
12733
12639
|
else {
|
|
12734
12640
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
12735
12641
|
const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
|
|
12736
|
-
|
|
12737
|
-
renderer.setAttribute(element, name, strValue, namespace);
|
|
12738
|
-
}
|
|
12739
|
-
else {
|
|
12740
|
-
namespace ? element.setAttributeNS(namespace, name, strValue) :
|
|
12741
|
-
element.setAttribute(name, strValue);
|
|
12742
|
-
}
|
|
12642
|
+
renderer.setAttribute(element, name, strValue, namespace);
|
|
12743
12643
|
}
|
|
12744
12644
|
}
|
|
12745
12645
|
/**
|
|
@@ -12831,7 +12731,6 @@ const LContainerArray = class LContainer extends Array {
|
|
|
12831
12731
|
*/
|
|
12832
12732
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
12833
12733
|
ngDevMode && assertLView(currentView);
|
|
12834
|
-
ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
|
|
12835
12734
|
// https://jsperf.com/array-literal-vs-new-array-really
|
|
12836
12735
|
const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
|
|
12837
12736
|
true, // Boolean `true` in this position signifies that this is an `LContainer`
|
|
@@ -12947,7 +12846,7 @@ function refreshContainsDirtyView(lView) {
|
|
|
12947
12846
|
}
|
|
12948
12847
|
}
|
|
12949
12848
|
}
|
|
12950
|
-
function renderComponent
|
|
12849
|
+
function renderComponent(hostLView, componentHostIdx) {
|
|
12951
12850
|
ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
|
|
12952
12851
|
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
|
|
12953
12852
|
const componentTView = componentView[TVIEW];
|
|
@@ -13299,458 +13198,450 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
|
|
|
13299
13198
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13300
13199
|
* found in the LICENSE file at https://angular.io/license
|
|
13301
13200
|
*/
|
|
13201
|
+
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13202
|
+
const NULL_INJECTOR = {
|
|
13203
|
+
get: (token, notFoundValue) => {
|
|
13204
|
+
throwProviderNotFoundError(token, 'NullInjector');
|
|
13205
|
+
}
|
|
13206
|
+
};
|
|
13302
13207
|
/**
|
|
13303
|
-
*
|
|
13304
|
-
*
|
|
13305
|
-
* This function triggers change detection in a synchronous way on a component.
|
|
13306
|
-
*
|
|
13307
|
-
* @param component The component which the change detection should be performed on.
|
|
13308
|
-
*/
|
|
13309
|
-
function detectChanges(component) {
|
|
13310
|
-
const view = getComponentViewByInstance(component);
|
|
13311
|
-
detectChangesInternal(view[TVIEW], view, component);
|
|
13312
|
-
}
|
|
13313
|
-
/**
|
|
13314
|
-
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
13315
|
-
* schedule a change detection on it at some point in the future.
|
|
13316
|
-
*
|
|
13317
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
13318
|
-
* detection can be scheduled per component tree.
|
|
13319
|
-
*
|
|
13320
|
-
* @param component Component to mark as dirty.
|
|
13321
|
-
*/
|
|
13322
|
-
function markDirty(component) {
|
|
13323
|
-
ngDevMode && assertDefined(component, 'component');
|
|
13324
|
-
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
13325
|
-
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
13326
|
-
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
13327
|
-
}
|
|
13328
|
-
/**
|
|
13329
|
-
* Used to perform change detection on the whole application.
|
|
13330
|
-
*
|
|
13331
|
-
* This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
|
|
13332
|
-
* executes lifecycle hooks and conditionally checks components based on their
|
|
13333
|
-
* `ChangeDetectionStrategy` and dirtiness.
|
|
13208
|
+
* Creates the root component view and the root component node.
|
|
13334
13209
|
*
|
|
13335
|
-
*
|
|
13336
|
-
*
|
|
13337
|
-
*
|
|
13338
|
-
*
|
|
13339
|
-
|
|
13340
|
-
|
|
13341
|
-
const rootView = getRootView(component);
|
|
13342
|
-
const rootContext = rootView[CONTEXT];
|
|
13343
|
-
tickRootContext(rootContext);
|
|
13344
|
-
}
|
|
13345
|
-
|
|
13346
|
-
/**
|
|
13347
|
-
* @license
|
|
13348
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13210
|
+
* @param rNode Render host element.
|
|
13211
|
+
* @param def ComponentDef
|
|
13212
|
+
* @param rootView The parent view where the host node is stored
|
|
13213
|
+
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13214
|
+
* @param hostRenderer The current renderer
|
|
13215
|
+
* @param sanitizer The sanitizer, if provided
|
|
13349
13216
|
*
|
|
13350
|
-
*
|
|
13351
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13217
|
+
* @returns Component view created
|
|
13352
13218
|
*/
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
* @param element DOM element from which the component should be retrieved.
|
|
13374
|
-
* @returns Component instance associated with the element or `null` if there
|
|
13375
|
-
* is no component associated with it.
|
|
13376
|
-
*
|
|
13377
|
-
* @publicApi
|
|
13378
|
-
* @globalApi ng
|
|
13379
|
-
*/
|
|
13380
|
-
function getComponent$1(element) {
|
|
13381
|
-
ngDevMode && assertDomElement(element);
|
|
13382
|
-
const context = getLContext(element);
|
|
13383
|
-
if (context === null)
|
|
13384
|
-
return null;
|
|
13385
|
-
if (context.component === undefined) {
|
|
13386
|
-
const lView = context.lView;
|
|
13387
|
-
if (lView === null) {
|
|
13388
|
-
return null;
|
|
13219
|
+
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13220
|
+
const tView = rootView[TVIEW];
|
|
13221
|
+
const index = HEADER_OFFSET;
|
|
13222
|
+
ngDevMode && assertIndexInRange(rootView, index);
|
|
13223
|
+
rootView[index] = rNode;
|
|
13224
|
+
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13225
|
+
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13226
|
+
// representing a host element.
|
|
13227
|
+
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13228
|
+
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13229
|
+
if (mergedAttrs !== null) {
|
|
13230
|
+
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13231
|
+
if (rNode !== null) {
|
|
13232
|
+
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13233
|
+
if (tNode.classes !== null) {
|
|
13234
|
+
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13235
|
+
}
|
|
13236
|
+
if (tNode.styles !== null) {
|
|
13237
|
+
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13238
|
+
}
|
|
13389
13239
|
}
|
|
13390
|
-
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
13391
13240
|
}
|
|
13392
|
-
|
|
13241
|
+
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13242
|
+
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13243
|
+
if (tView.firstCreatePass) {
|
|
13244
|
+
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13245
|
+
markAsComponentHost(tView, tNode);
|
|
13246
|
+
initTNodeFlags(tNode, rootView.length, 1);
|
|
13247
|
+
}
|
|
13248
|
+
addToViewTree(rootView, componentView);
|
|
13249
|
+
// Store component view at node index, with node as the HOST
|
|
13250
|
+
return rootView[index] = componentView;
|
|
13393
13251
|
}
|
|
13394
13252
|
/**
|
|
13395
|
-
*
|
|
13396
|
-
*
|
|
13397
|
-
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
13398
|
-
*
|
|
13399
|
-
* @param element Element for which to get the surrounding component instance.
|
|
13400
|
-
* @returns Instance of the component that is around the element or null if the element isn't
|
|
13401
|
-
* inside any component.
|
|
13402
|
-
*
|
|
13403
|
-
* @publicApi
|
|
13404
|
-
* @globalApi ng
|
|
13253
|
+
* Creates a root component and sets it up with features and host bindings. Shared by
|
|
13254
|
+
* renderComponent() and ViewContainerRef.createComponent().
|
|
13405
13255
|
*/
|
|
13406
|
-
function
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
const
|
|
13410
|
-
|
|
13256
|
+
function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
|
|
13257
|
+
const tView = rootLView[TVIEW];
|
|
13258
|
+
// Create directive instance with factory() and store at next index in viewData
|
|
13259
|
+
const component = instantiateRootComponent(tView, rootLView, componentDef);
|
|
13260
|
+
rootContext.components.push(component);
|
|
13261
|
+
componentView[CONTEXT] = component;
|
|
13262
|
+
if (hostFeatures !== null) {
|
|
13263
|
+
for (const feature of hostFeatures) {
|
|
13264
|
+
feature(component, componentDef);
|
|
13265
|
+
}
|
|
13266
|
+
}
|
|
13267
|
+
// We want to generate an empty QueryList for root content queries for backwards
|
|
13268
|
+
// compatibility with ViewEngine.
|
|
13269
|
+
if (componentDef.contentQueries) {
|
|
13270
|
+
const tNode = getCurrentTNode();
|
|
13271
|
+
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13272
|
+
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13273
|
+
}
|
|
13274
|
+
const rootTNode = getCurrentTNode();
|
|
13275
|
+
ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
|
|
13276
|
+
if (tView.firstCreatePass &&
|
|
13277
|
+
(componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
|
|
13278
|
+
setSelectedIndex(rootTNode.index);
|
|
13279
|
+
const rootTView = rootLView[TVIEW];
|
|
13280
|
+
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13281
|
+
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13282
|
+
}
|
|
13283
|
+
return component;
|
|
13284
|
+
}
|
|
13285
|
+
function createRootContext(scheduler, playerHandler) {
|
|
13286
|
+
return {
|
|
13287
|
+
components: [],
|
|
13288
|
+
scheduler: scheduler || defaultScheduler,
|
|
13289
|
+
clean: CLEAN_PROMISE,
|
|
13290
|
+
playerHandler: playerHandler || null,
|
|
13291
|
+
flags: 0 /* RootContextFlags.Empty */
|
|
13292
|
+
};
|
|
13411
13293
|
}
|
|
13412
13294
|
/**
|
|
13413
|
-
*
|
|
13295
|
+
* Used to enable lifecycle hooks on the root component.
|
|
13414
13296
|
*
|
|
13415
|
-
*
|
|
13416
|
-
*
|
|
13417
|
-
*
|
|
13297
|
+
* Include this feature when calling `renderComponent` if the root component
|
|
13298
|
+
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
13299
|
+
* be called properly.
|
|
13418
13300
|
*
|
|
13419
|
-
*
|
|
13420
|
-
* for which to retrieve the root components.
|
|
13421
|
-
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
13422
|
-
* part of a component view.
|
|
13301
|
+
* Example:
|
|
13423
13302
|
*
|
|
13424
|
-
*
|
|
13425
|
-
*
|
|
13303
|
+
* ```
|
|
13304
|
+
* renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
|
|
13305
|
+
* ```
|
|
13426
13306
|
*/
|
|
13427
|
-
function
|
|
13428
|
-
const
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
return null;
|
|
13432
|
-
let parent;
|
|
13433
|
-
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
13434
|
-
lView = parent;
|
|
13435
|
-
}
|
|
13436
|
-
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
13307
|
+
function LifecycleHooksFeature() {
|
|
13308
|
+
const tNode = getCurrentTNode();
|
|
13309
|
+
ngDevMode && assertDefined(tNode, 'TNode is required');
|
|
13310
|
+
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13437
13311
|
}
|
|
13438
13312
|
/**
|
|
13439
|
-
*
|
|
13440
|
-
* Root components are those which have been bootstrapped by Angular.
|
|
13441
|
-
*
|
|
13442
|
-
* @param elementOrDir DOM element, component or directive instance
|
|
13443
|
-
* for which to retrieve the root components.
|
|
13444
|
-
* @returns Root components associated with the target object.
|
|
13313
|
+
* Wait on component until it is rendered.
|
|
13445
13314
|
*
|
|
13446
|
-
*
|
|
13447
|
-
*
|
|
13448
|
-
|
|
13449
|
-
function
|
|
13450
|
-
const lView = readPatchedLView(elementOrDir);
|
|
13451
|
-
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
13452
|
-
}
|
|
13453
|
-
/**
|
|
13454
|
-
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
13315
|
+
* This function returns a `Promise` which is resolved when the component's
|
|
13316
|
+
* change detection is executed. This is determined by finding the scheduler
|
|
13317
|
+
* associated with the `component`'s render tree and waiting until the scheduler
|
|
13318
|
+
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
13455
13319
|
*
|
|
13456
|
-
*
|
|
13457
|
-
*
|
|
13458
|
-
*
|
|
13320
|
+
* Example:
|
|
13321
|
+
* ```
|
|
13322
|
+
* await whenRendered(myComponent);
|
|
13323
|
+
* ```
|
|
13459
13324
|
*
|
|
13460
|
-
* @
|
|
13461
|
-
* @
|
|
13325
|
+
* @param component Component to wait upon
|
|
13326
|
+
* @returns Promise which resolves when the component is rendered.
|
|
13462
13327
|
*/
|
|
13463
|
-
function
|
|
13464
|
-
|
|
13465
|
-
const lView = context ? context.lView : null;
|
|
13466
|
-
if (lView === null)
|
|
13467
|
-
return Injector.NULL;
|
|
13468
|
-
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
13469
|
-
return new NodeInjector(tNode, lView);
|
|
13328
|
+
function whenRendered(component) {
|
|
13329
|
+
return getRootContext(component).clean;
|
|
13470
13330
|
}
|
|
13331
|
+
|
|
13471
13332
|
/**
|
|
13472
|
-
*
|
|
13333
|
+
* @license
|
|
13334
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13473
13335
|
*
|
|
13474
|
-
*
|
|
13336
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13337
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13475
13338
|
*/
|
|
13476
|
-
function
|
|
13477
|
-
|
|
13478
|
-
const lView = context ? context.lView : null;
|
|
13479
|
-
if (lView === null)
|
|
13480
|
-
return [];
|
|
13481
|
-
const tView = lView[TVIEW];
|
|
13482
|
-
const tNode = tView.data[context.nodeIndex];
|
|
13483
|
-
const providerTokens = [];
|
|
13484
|
-
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
13485
|
-
const endIndex = tNode.directiveEnd;
|
|
13486
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
13487
|
-
let value = tView.data[i];
|
|
13488
|
-
if (isDirectiveDefHack(value)) {
|
|
13489
|
-
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
13490
|
-
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
13491
|
-
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
13492
|
-
// is that we should always be storing injectable type in this location.
|
|
13493
|
-
value = value.type;
|
|
13494
|
-
}
|
|
13495
|
-
providerTokens.push(value);
|
|
13496
|
-
}
|
|
13497
|
-
return providerTokens;
|
|
13339
|
+
function getSuperType(type) {
|
|
13340
|
+
return Object.getPrototypeOf(type.prototype).constructor;
|
|
13498
13341
|
}
|
|
13499
13342
|
/**
|
|
13500
|
-
*
|
|
13501
|
-
* component
|
|
13502
|
-
*
|
|
13503
|
-
* @usageNotes
|
|
13504
|
-
* Given the following DOM structure:
|
|
13505
|
-
*
|
|
13506
|
-
* ```html
|
|
13507
|
-
* <app-root>
|
|
13508
|
-
* <button my-button></button>
|
|
13509
|
-
* <my-comp></my-comp>
|
|
13510
|
-
* </app-root>
|
|
13511
|
-
* ```
|
|
13512
|
-
*
|
|
13513
|
-
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
13514
|
-
* directive that is associated with the DOM node.
|
|
13515
|
-
*
|
|
13516
|
-
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
13517
|
-
*
|
|
13518
|
-
* @param node DOM node for which to get the directives.
|
|
13519
|
-
* @returns Array of directives associated with the node.
|
|
13343
|
+
* Merges the definition from a super class to a sub class.
|
|
13344
|
+
* @param definition The definition that is a SubClass of another directive of component
|
|
13520
13345
|
*
|
|
13521
|
-
* @
|
|
13522
|
-
* @globalApi ng
|
|
13346
|
+
* @codeGenApi
|
|
13523
13347
|
*/
|
|
13524
|
-
function
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
13530
|
-
|
|
13531
|
-
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13348
|
+
function ɵɵInheritDefinitionFeature(definition) {
|
|
13349
|
+
let superType = getSuperType(definition.type);
|
|
13350
|
+
let shouldInheritFields = true;
|
|
13351
|
+
const inheritanceChain = [definition];
|
|
13352
|
+
while (superType) {
|
|
13353
|
+
let superDef = undefined;
|
|
13354
|
+
if (isComponentDef(definition)) {
|
|
13355
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13356
|
+
superDef = superType.ɵcmp || superType.ɵdir;
|
|
13357
|
+
}
|
|
13358
|
+
else {
|
|
13359
|
+
if (superType.ɵcmp) {
|
|
13360
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
13361
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
13362
|
+
}
|
|
13363
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13364
|
+
superDef = superType.ɵdir;
|
|
13365
|
+
}
|
|
13366
|
+
if (superDef) {
|
|
13367
|
+
if (shouldInheritFields) {
|
|
13368
|
+
inheritanceChain.push(superDef);
|
|
13369
|
+
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
13370
|
+
// would've justified object creation. Unwrap them if necessary.
|
|
13371
|
+
const writeableDef = definition;
|
|
13372
|
+
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
13373
|
+
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
13374
|
+
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
13375
|
+
// Merge hostBindings
|
|
13376
|
+
const superHostBindings = superDef.hostBindings;
|
|
13377
|
+
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
13378
|
+
// Merge queries
|
|
13379
|
+
const superViewQuery = superDef.viewQuery;
|
|
13380
|
+
const superContentQueries = superDef.contentQueries;
|
|
13381
|
+
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
13382
|
+
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
13383
|
+
// Merge inputs and outputs
|
|
13384
|
+
fillProperties(definition.inputs, superDef.inputs);
|
|
13385
|
+
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
13386
|
+
fillProperties(definition.outputs, superDef.outputs);
|
|
13387
|
+
// Merge animations metadata.
|
|
13388
|
+
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
13389
|
+
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
13390
|
+
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
13391
|
+
// not inherit Components (we throw an error above and cannot reach this code).
|
|
13392
|
+
const defData = definition.data;
|
|
13393
|
+
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
13394
|
+
}
|
|
13395
|
+
}
|
|
13396
|
+
// Run parent features
|
|
13397
|
+
const features = superDef.features;
|
|
13398
|
+
if (features) {
|
|
13399
|
+
for (let i = 0; i < features.length; i++) {
|
|
13400
|
+
const feature = features[i];
|
|
13401
|
+
if (feature && feature.ngInherit) {
|
|
13402
|
+
feature(definition);
|
|
13403
|
+
}
|
|
13404
|
+
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
13405
|
+
// def already has all the necessary information inherited from its super class(es), so we
|
|
13406
|
+
// can stop merging fields from super classes. However we need to iterate through the
|
|
13407
|
+
// prototype chain to look for classes that might contain other "features" (like
|
|
13408
|
+
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
13409
|
+
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
13410
|
+
// logic and only invoking functions from the "features" list.
|
|
13411
|
+
if (feature === ɵɵInheritDefinitionFeature) {
|
|
13412
|
+
shouldInheritFields = false;
|
|
13413
|
+
}
|
|
13414
|
+
}
|
|
13415
|
+
}
|
|
13416
|
+
}
|
|
13417
|
+
superType = Object.getPrototypeOf(superType);
|
|
13541
13418
|
}
|
|
13542
|
-
|
|
13543
|
-
// result so we don't expose an internal data structure in the user's console.
|
|
13544
|
-
return context.directives === null ? [] : [...context.directives];
|
|
13419
|
+
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13545
13420
|
}
|
|
13546
13421
|
/**
|
|
13547
|
-
*
|
|
13548
|
-
* The function accepts an instance of a directive or component and returns the corresponding
|
|
13549
|
-
* metadata.
|
|
13550
|
-
*
|
|
13551
|
-
* @param directiveOrComponentInstance Instance of a directive or component
|
|
13552
|
-
* @returns metadata of the passed directive or component
|
|
13422
|
+
* Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
|
|
13553
13423
|
*
|
|
13554
|
-
* @
|
|
13555
|
-
*
|
|
13424
|
+
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
13425
|
+
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
13426
|
+
* type.
|
|
13556
13427
|
*/
|
|
13557
|
-
function
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13428
|
+
function mergeHostAttrsAcrossInheritance(inheritanceChain) {
|
|
13429
|
+
let hostVars = 0;
|
|
13430
|
+
let hostAttrs = null;
|
|
13431
|
+
// We process the inheritance order from the base to the leaves here.
|
|
13432
|
+
for (let i = inheritanceChain.length - 1; i >= 0; i--) {
|
|
13433
|
+
const def = inheritanceChain[i];
|
|
13434
|
+
// For each `hostVars`, we need to add the superclass amount.
|
|
13435
|
+
def.hostVars = (hostVars += def.hostVars);
|
|
13436
|
+
// for each `hostAttrs` we need to merge it with superclass.
|
|
13437
|
+
def.hostAttrs =
|
|
13438
|
+
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
13561
13439
|
}
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13571
|
-
|
|
13440
|
+
}
|
|
13441
|
+
function maybeUnwrapEmpty(value) {
|
|
13442
|
+
if (value === EMPTY_OBJ) {
|
|
13443
|
+
return {};
|
|
13444
|
+
}
|
|
13445
|
+
else if (value === EMPTY_ARRAY) {
|
|
13446
|
+
return [];
|
|
13447
|
+
}
|
|
13448
|
+
else {
|
|
13449
|
+
return value;
|
|
13450
|
+
}
|
|
13451
|
+
}
|
|
13452
|
+
function inheritViewQuery(definition, superViewQuery) {
|
|
13453
|
+
const prevViewQuery = definition.viewQuery;
|
|
13454
|
+
if (prevViewQuery) {
|
|
13455
|
+
definition.viewQuery = (rf, ctx) => {
|
|
13456
|
+
superViewQuery(rf, ctx);
|
|
13457
|
+
prevViewQuery(rf, ctx);
|
|
13572
13458
|
};
|
|
13573
13459
|
}
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
13460
|
+
else {
|
|
13461
|
+
definition.viewQuery = superViewQuery;
|
|
13577
13462
|
}
|
|
13578
|
-
return null;
|
|
13579
13463
|
}
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
|
|
13597
|
-
|
|
13464
|
+
function inheritContentQueries(definition, superContentQueries) {
|
|
13465
|
+
const prevContentQueries = definition.contentQueries;
|
|
13466
|
+
if (prevContentQueries) {
|
|
13467
|
+
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
13468
|
+
superContentQueries(rf, ctx, directiveIndex);
|
|
13469
|
+
prevContentQueries(rf, ctx, directiveIndex);
|
|
13470
|
+
};
|
|
13471
|
+
}
|
|
13472
|
+
else {
|
|
13473
|
+
definition.contentQueries = superContentQueries;
|
|
13474
|
+
}
|
|
13475
|
+
}
|
|
13476
|
+
function inheritHostBindings(definition, superHostBindings) {
|
|
13477
|
+
const prevHostBindings = definition.hostBindings;
|
|
13478
|
+
if (prevHostBindings) {
|
|
13479
|
+
definition.hostBindings = (rf, ctx) => {
|
|
13480
|
+
superHostBindings(rf, ctx);
|
|
13481
|
+
prevHostBindings(rf, ctx);
|
|
13482
|
+
};
|
|
13483
|
+
}
|
|
13484
|
+
else {
|
|
13485
|
+
definition.hostBindings = superHostBindings;
|
|
13598
13486
|
}
|
|
13599
|
-
return context.localRefs || {};
|
|
13600
13487
|
}
|
|
13488
|
+
|
|
13601
13489
|
/**
|
|
13602
|
-
*
|
|
13603
|
-
*
|
|
13604
|
-
*
|
|
13605
|
-
* @param componentOrDirective Component or directive instance for which the host
|
|
13606
|
-
* element should be retrieved.
|
|
13607
|
-
* @returns Host element of the target.
|
|
13490
|
+
* @license
|
|
13491
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13608
13492
|
*
|
|
13609
|
-
*
|
|
13610
|
-
*
|
|
13493
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13494
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13611
13495
|
*/
|
|
13612
|
-
function getHostElement(componentOrDirective) {
|
|
13613
|
-
return getLContext(componentOrDirective).native;
|
|
13614
|
-
}
|
|
13615
13496
|
/**
|
|
13616
|
-
*
|
|
13617
|
-
*
|
|
13618
|
-
|
|
13619
|
-
|
|
13620
|
-
|
|
13621
|
-
|
|
13497
|
+
* Fields which exist on either directive or component definitions, and need to be copied from
|
|
13498
|
+
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13499
|
+
*/
|
|
13500
|
+
const COPY_DIRECTIVE_FIELDS = [
|
|
13501
|
+
// The child class should use the providers of its parent.
|
|
13502
|
+
'providersResolver',
|
|
13503
|
+
// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
|
|
13504
|
+
// as inputs, outputs, and host binding functions.
|
|
13505
|
+
];
|
|
13506
|
+
/**
|
|
13507
|
+
* Fields which exist only on component definitions, and need to be copied from parent to child
|
|
13508
|
+
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
13622
13509
|
*
|
|
13623
|
-
*
|
|
13510
|
+
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
13511
|
+
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13624
13512
|
*/
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13513
|
+
const COPY_COMPONENT_FIELDS = [
|
|
13514
|
+
// The child class should use the template function of its parent, including all template
|
|
13515
|
+
// semantics.
|
|
13516
|
+
'template',
|
|
13517
|
+
'decls',
|
|
13518
|
+
'consts',
|
|
13519
|
+
'vars',
|
|
13520
|
+
'onPush',
|
|
13521
|
+
'ngContentSelectors',
|
|
13522
|
+
// The child class should use the CSS styles of its parent, including all styling semantics.
|
|
13523
|
+
'styles',
|
|
13524
|
+
'encapsulation',
|
|
13525
|
+
// The child class should be checked by the runtime in the same way as its parent.
|
|
13526
|
+
'schemas',
|
|
13527
|
+
];
|
|
13629
13528
|
/**
|
|
13630
|
-
*
|
|
13631
|
-
*
|
|
13632
|
-
* (e.g. through `addEventListener`).
|
|
13529
|
+
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
13530
|
+
* definition.
|
|
13633
13531
|
*
|
|
13634
|
-
*
|
|
13635
|
-
*
|
|
13532
|
+
* This exists primarily to support ngcc migration of an existing View Engine pattern, where an
|
|
13533
|
+
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
13534
|
+
* generates a skeleton definition on the child class, and applies this feature.
|
|
13636
13535
|
*
|
|
13637
|
-
*
|
|
13638
|
-
*
|
|
13639
|
-
* <div (click)="doSomething()"></div>
|
|
13640
|
-
* </app-root>
|
|
13641
|
-
* ```
|
|
13642
|
-
*
|
|
13643
|
-
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
13644
|
-
*
|
|
13645
|
-
* ```ts
|
|
13646
|
-
* {
|
|
13647
|
-
* name: 'click',
|
|
13648
|
-
* element: <div>,
|
|
13649
|
-
* callback: () => doSomething(),
|
|
13650
|
-
* useCapture: false
|
|
13651
|
-
* }
|
|
13652
|
-
* ```
|
|
13536
|
+
* The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
|
|
13537
|
+
* including things like the component template function.
|
|
13653
13538
|
*
|
|
13654
|
-
* @param
|
|
13655
|
-
*
|
|
13539
|
+
* @param definition The definition of a child class which inherits from a parent class with its
|
|
13540
|
+
* own definition.
|
|
13656
13541
|
*
|
|
13657
|
-
* @
|
|
13658
|
-
* @globalApi ng
|
|
13542
|
+
* @codeGenApi
|
|
13659
13543
|
*/
|
|
13660
|
-
function
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
13682
|
-
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
13683
|
-
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
13684
|
-
if (element == listenerElement) {
|
|
13685
|
-
listeners.push({ element, name, callback, useCapture, type });
|
|
13686
|
-
}
|
|
13687
|
-
}
|
|
13544
|
+
function ɵɵCopyDefinitionFeature(definition) {
|
|
13545
|
+
let superType = getSuperType(definition.type);
|
|
13546
|
+
let superDef = undefined;
|
|
13547
|
+
if (isComponentDef(definition)) {
|
|
13548
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13549
|
+
superDef = superType.ɵcmp;
|
|
13550
|
+
}
|
|
13551
|
+
else {
|
|
13552
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13553
|
+
superDef = superType.ɵdir;
|
|
13554
|
+
}
|
|
13555
|
+
// Needed because `definition` fields are readonly.
|
|
13556
|
+
const defAny = definition;
|
|
13557
|
+
// Copy over any fields that apply to either directives or components.
|
|
13558
|
+
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
13559
|
+
defAny[field] = superDef[field];
|
|
13560
|
+
}
|
|
13561
|
+
if (isComponentDef(superDef)) {
|
|
13562
|
+
// Copy over any component-specific fields.
|
|
13563
|
+
for (const field of COPY_COMPONENT_FIELDS) {
|
|
13564
|
+
defAny[field] = superDef[field];
|
|
13688
13565
|
}
|
|
13689
13566
|
}
|
|
13690
|
-
listeners.sort(sortListeners);
|
|
13691
|
-
return listeners;
|
|
13692
|
-
}
|
|
13693
|
-
function sortListeners(a, b) {
|
|
13694
|
-
if (a.name == b.name)
|
|
13695
|
-
return 0;
|
|
13696
|
-
return a.name < b.name ? -1 : 1;
|
|
13697
13567
|
}
|
|
13568
|
+
|
|
13698
13569
|
/**
|
|
13699
|
-
*
|
|
13570
|
+
* @license
|
|
13571
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13700
13572
|
*
|
|
13701
|
-
*
|
|
13573
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13574
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13702
13575
|
*/
|
|
13703
|
-
|
|
13704
|
-
|
|
13576
|
+
let _symbolIterator = null;
|
|
13577
|
+
function getSymbolIterator() {
|
|
13578
|
+
if (!_symbolIterator) {
|
|
13579
|
+
const Symbol = _global['Symbol'];
|
|
13580
|
+
if (Symbol && Symbol.iterator) {
|
|
13581
|
+
_symbolIterator = Symbol.iterator;
|
|
13582
|
+
}
|
|
13583
|
+
else {
|
|
13584
|
+
// es6-shim specific logic
|
|
13585
|
+
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
13586
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
13587
|
+
const key = keys[i];
|
|
13588
|
+
if (key !== 'entries' && key !== 'size' &&
|
|
13589
|
+
Map.prototype[key] === Map.prototype['entries']) {
|
|
13590
|
+
_symbolIterator = key;
|
|
13591
|
+
}
|
|
13592
|
+
}
|
|
13593
|
+
}
|
|
13594
|
+
}
|
|
13595
|
+
return _symbolIterator;
|
|
13705
13596
|
}
|
|
13597
|
+
|
|
13706
13598
|
/**
|
|
13707
|
-
*
|
|
13599
|
+
* @license
|
|
13600
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13708
13601
|
*
|
|
13709
|
-
*
|
|
13602
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13603
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13710
13604
|
*/
|
|
13711
|
-
function
|
|
13712
|
-
|
|
13713
|
-
|
|
13605
|
+
function isIterable(obj) {
|
|
13606
|
+
return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
|
|
13607
|
+
}
|
|
13608
|
+
function isListLikeIterable(obj) {
|
|
13609
|
+
if (!isJsObject(obj))
|
|
13610
|
+
return false;
|
|
13611
|
+
return Array.isArray(obj) ||
|
|
13612
|
+
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
|
|
13613
|
+
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
13614
|
+
}
|
|
13615
|
+
function areIterablesEqual(a, b, comparator) {
|
|
13616
|
+
const iterator1 = a[getSymbolIterator()]();
|
|
13617
|
+
const iterator2 = b[getSymbolIterator()]();
|
|
13618
|
+
while (true) {
|
|
13619
|
+
const item1 = iterator1.next();
|
|
13620
|
+
const item2 = iterator2.next();
|
|
13621
|
+
if (item1.done && item2.done)
|
|
13622
|
+
return true;
|
|
13623
|
+
if (item1.done || item2.done)
|
|
13624
|
+
return false;
|
|
13625
|
+
if (!comparator(item1.value, item2.value))
|
|
13626
|
+
return false;
|
|
13714
13627
|
}
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
if (
|
|
13718
|
-
|
|
13628
|
+
}
|
|
13629
|
+
function iterateListLike(obj, fn) {
|
|
13630
|
+
if (Array.isArray(obj)) {
|
|
13631
|
+
for (let i = 0; i < obj.length; i++) {
|
|
13632
|
+
fn(obj[i]);
|
|
13633
|
+
}
|
|
13719
13634
|
}
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
ngDevMode &&
|
|
13727
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
13728
|
-
return buildDebugNode(tNode, lView);
|
|
13635
|
+
else {
|
|
13636
|
+
const iterator = obj[getSymbolIterator()]();
|
|
13637
|
+
let item;
|
|
13638
|
+
while (!((item = iterator.next()).done)) {
|
|
13639
|
+
fn(item.value);
|
|
13640
|
+
}
|
|
13729
13641
|
}
|
|
13730
|
-
return null;
|
|
13731
|
-
}
|
|
13732
|
-
/**
|
|
13733
|
-
* Retrieve the component `LView` from component/element.
|
|
13734
|
-
*
|
|
13735
|
-
* NOTE: `LView` is a private and should not be leaked outside.
|
|
13736
|
-
* Don't export this method to `ng.*` on window.
|
|
13737
|
-
*
|
|
13738
|
-
* @param target DOM element or component instance for which to retrieve the LView.
|
|
13739
|
-
*/
|
|
13740
|
-
function getComponentLView(target) {
|
|
13741
|
-
const lContext = getLContext(target);
|
|
13742
|
-
const nodeIndx = lContext.nodeIndex;
|
|
13743
|
-
const lView = lContext.lView;
|
|
13744
|
-
ngDevMode && assertLView(lView);
|
|
13745
|
-
const componentLView = lView[nodeIndx];
|
|
13746
|
-
ngDevMode && assertLView(componentLView);
|
|
13747
|
-
return componentLView;
|
|
13748
13642
|
}
|
|
13749
|
-
|
|
13750
|
-
function
|
|
13751
|
-
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
13752
|
-
throw new Error('Expecting instance of DOM Element');
|
|
13753
|
-
}
|
|
13643
|
+
function isJsObject(o) {
|
|
13644
|
+
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
13754
13645
|
}
|
|
13755
13646
|
|
|
13756
13647
|
/**
|
|
@@ -13760,18 +13651,22 @@ function assertDomElement(value) {
|
|
|
13760
13651
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13761
13652
|
* found in the LICENSE file at https://angular.io/license
|
|
13762
13653
|
*/
|
|
13763
|
-
|
|
13764
|
-
|
|
13765
|
-
|
|
13766
|
-
|
|
13767
|
-
|
|
13768
|
-
|
|
13769
|
-
|
|
13770
|
-
|
|
13771
|
-
|
|
13772
|
-
|
|
13773
|
-
|
|
13774
|
-
|
|
13654
|
+
function devModeEqual(a, b) {
|
|
13655
|
+
const isListLikeIterableA = isListLikeIterable(a);
|
|
13656
|
+
const isListLikeIterableB = isListLikeIterable(b);
|
|
13657
|
+
if (isListLikeIterableA && isListLikeIterableB) {
|
|
13658
|
+
return areIterablesEqual(a, b, devModeEqual);
|
|
13659
|
+
}
|
|
13660
|
+
else {
|
|
13661
|
+
const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
|
13662
|
+
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
13663
|
+
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
13664
|
+
return true;
|
|
13665
|
+
}
|
|
13666
|
+
else {
|
|
13667
|
+
return Object.is(a, b);
|
|
13668
|
+
}
|
|
13669
|
+
}
|
|
13775
13670
|
}
|
|
13776
13671
|
|
|
13777
13672
|
/**
|
|
@@ -13781,70 +13676,73 @@ function applyChanges(component) {
|
|
|
13781
13676
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13782
13677
|
* found in the LICENSE file at https://angular.io/license
|
|
13783
13678
|
*/
|
|
13679
|
+
// TODO(misko): consider inlining
|
|
13680
|
+
/** Updates binding and returns the value. */
|
|
13681
|
+
function updateBinding(lView, bindingIndex, value) {
|
|
13682
|
+
return lView[bindingIndex] = value;
|
|
13683
|
+
}
|
|
13684
|
+
/** Gets the current binding value. */
|
|
13685
|
+
function getBinding(lView, bindingIndex) {
|
|
13686
|
+
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
13687
|
+
ngDevMode &&
|
|
13688
|
+
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
13689
|
+
return lView[bindingIndex];
|
|
13690
|
+
}
|
|
13784
13691
|
/**
|
|
13785
|
-
*
|
|
13786
|
-
* to allow for the Angular debugging story to function.
|
|
13787
|
-
*
|
|
13788
|
-
* To see this in action run the following command:
|
|
13789
|
-
*
|
|
13790
|
-
* bazel run //packages/core/test/bundling/todo:devserver
|
|
13692
|
+
* Updates binding if changed, then returns whether it was updated.
|
|
13791
13693
|
*
|
|
13792
|
-
*
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
* This value reflects the property on the window where the dev
|
|
13796
|
-
* tools are patched (window.ng).
|
|
13797
|
-
* */
|
|
13798
|
-
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
13799
|
-
let _published = false;
|
|
13800
|
-
/**
|
|
13801
|
-
* Publishes a collection of default debug tools onto`window.ng`.
|
|
13694
|
+
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
13695
|
+
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
13696
|
+
* behavior.
|
|
13802
13697
|
*
|
|
13803
|
-
*
|
|
13804
|
-
*
|
|
13698
|
+
* @param lView current `LView`
|
|
13699
|
+
* @param bindingIndex The binding in the `LView` to check
|
|
13700
|
+
* @param value New value to check against `lView[bindingIndex]`
|
|
13701
|
+
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
13702
|
+
* `CheckNoChangesMode`)
|
|
13805
13703
|
*/
|
|
13806
|
-
function
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
*/
|
|
13814
|
-
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
13815
|
-
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
13816
|
-
publishGlobalUtil('getComponent', getComponent$1);
|
|
13817
|
-
publishGlobalUtil('getContext', getContext);
|
|
13818
|
-
publishGlobalUtil('getListeners', getListeners);
|
|
13819
|
-
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
13820
|
-
publishGlobalUtil('getHostElement', getHostElement);
|
|
13821
|
-
publishGlobalUtil('getInjector', getInjector);
|
|
13822
|
-
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
13823
|
-
publishGlobalUtil('getDirectives', getDirectives);
|
|
13824
|
-
publishGlobalUtil('applyChanges', applyChanges);
|
|
13704
|
+
function bindingUpdated(lView, bindingIndex, value) {
|
|
13705
|
+
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
13706
|
+
ngDevMode &&
|
|
13707
|
+
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
13708
|
+
const oldValue = lView[bindingIndex];
|
|
13709
|
+
if (Object.is(oldValue, value)) {
|
|
13710
|
+
return false;
|
|
13825
13711
|
}
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13829
|
-
|
|
13830
|
-
|
|
13831
|
-
|
|
13832
|
-
|
|
13833
|
-
|
|
13834
|
-
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
13835
|
-
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
13836
|
-
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
13837
|
-
const w = _global;
|
|
13838
|
-
ngDevMode && assertDefined(fn, 'function not defined');
|
|
13839
|
-
if (w) {
|
|
13840
|
-
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
13841
|
-
if (!container) {
|
|
13842
|
-
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
13712
|
+
else {
|
|
13713
|
+
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
13714
|
+
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
13715
|
+
// (before the change detection was run).
|
|
13716
|
+
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
13717
|
+
if (!devModeEqual(oldValueToCompare, value)) {
|
|
13718
|
+
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
13719
|
+
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
13843
13720
|
}
|
|
13844
|
-
|
|
13721
|
+
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
13722
|
+
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
13723
|
+
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
13724
|
+
// as change on next CD.)
|
|
13725
|
+
return false;
|
|
13845
13726
|
}
|
|
13727
|
+
lView[bindingIndex] = value;
|
|
13728
|
+
return true;
|
|
13846
13729
|
}
|
|
13847
13730
|
}
|
|
13731
|
+
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
13732
|
+
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
13733
|
+
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
13734
|
+
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
13735
|
+
}
|
|
13736
|
+
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
13737
|
+
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
13738
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13739
|
+
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
13740
|
+
}
|
|
13741
|
+
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
13742
|
+
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
13743
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13744
|
+
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
13745
|
+
}
|
|
13848
13746
|
|
|
13849
13747
|
/**
|
|
13850
13748
|
* @license
|
|
@@ -13853,980 +13751,377 @@ function publishGlobalUtil(name, fn) {
|
|
|
13853
13751
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13854
13752
|
* found in the LICENSE file at https://angular.io/license
|
|
13855
13753
|
*/
|
|
13856
|
-
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13857
|
-
const NULL_INJECTOR = {
|
|
13858
|
-
get: (token, notFoundValue) => {
|
|
13859
|
-
throwProviderNotFoundError(token, 'NullInjector');
|
|
13860
|
-
}
|
|
13861
|
-
};
|
|
13862
13754
|
/**
|
|
13863
|
-
*
|
|
13864
|
-
*
|
|
13755
|
+
* Updates the value of or removes a bound attribute on an Element.
|
|
13756
|
+
*
|
|
13757
|
+
* Used in the case of `[attr.title]="value"`
|
|
13865
13758
|
*
|
|
13866
|
-
*
|
|
13867
|
-
*
|
|
13868
|
-
*
|
|
13869
|
-
*
|
|
13870
|
-
*
|
|
13759
|
+
* @param name name The name of the attribute.
|
|
13760
|
+
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
13761
|
+
* Otherwise the attribute value is set to the stringified value.
|
|
13762
|
+
* @param sanitizer An optional function used to sanitize the value.
|
|
13763
|
+
* @param namespace Optional namespace to use when setting the attribute.
|
|
13871
13764
|
*
|
|
13872
|
-
* @
|
|
13873
|
-
* @param options Optional parameters which control bootstrapping
|
|
13765
|
+
* @codeGenApi
|
|
13874
13766
|
*/
|
|
13875
|
-
function
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
|
|
13879
|
-
|
|
13880
|
-
|
|
13881
|
-
|
|
13882
|
-
|
|
13883
|
-
// The first index of the first selector is the tag name.
|
|
13884
|
-
const componentTag = componentDef.selectors[0][0];
|
|
13885
|
-
const hostRenderer = rendererFactory.createRenderer(null, null);
|
|
13886
|
-
const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
|
|
13887
|
-
const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
13888
|
-
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
13889
|
-
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
13890
|
-
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
13891
|
-
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
13892
|
-
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
13893
|
-
enterView(rootView);
|
|
13894
|
-
let component;
|
|
13895
|
-
try {
|
|
13896
|
-
if (rendererFactory.begin)
|
|
13897
|
-
rendererFactory.begin();
|
|
13898
|
-
const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
|
|
13899
|
-
component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
|
|
13900
|
-
// create mode pass
|
|
13901
|
-
renderView(rootTView, rootView, null);
|
|
13902
|
-
// update mode pass
|
|
13903
|
-
refreshView(rootTView, rootView, null, null);
|
|
13904
|
-
}
|
|
13905
|
-
finally {
|
|
13906
|
-
leaveView();
|
|
13907
|
-
if (rendererFactory.end)
|
|
13908
|
-
rendererFactory.end();
|
|
13767
|
+
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
13768
|
+
const lView = getLView();
|
|
13769
|
+
const bindingIndex = nextBindingIndex();
|
|
13770
|
+
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
13771
|
+
const tView = getTView();
|
|
13772
|
+
const tNode = getSelectedTNode();
|
|
13773
|
+
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
13774
|
+
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
13909
13775
|
}
|
|
13910
|
-
return
|
|
13776
|
+
return ɵɵattribute;
|
|
13911
13777
|
}
|
|
13778
|
+
|
|
13912
13779
|
/**
|
|
13913
|
-
*
|
|
13914
|
-
*
|
|
13915
|
-
* @param rNode Render host element.
|
|
13916
|
-
* @param def ComponentDef
|
|
13917
|
-
* @param rootView The parent view where the host node is stored
|
|
13918
|
-
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13919
|
-
* @param hostRenderer The current renderer
|
|
13920
|
-
* @param sanitizer The sanitizer, if provided
|
|
13780
|
+
* @license
|
|
13781
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13921
13782
|
*
|
|
13922
|
-
*
|
|
13783
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13784
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13923
13785
|
*/
|
|
13924
|
-
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13925
|
-
const tView = rootView[TVIEW];
|
|
13926
|
-
const index = HEADER_OFFSET;
|
|
13927
|
-
ngDevMode && assertIndexInRange(rootView, index);
|
|
13928
|
-
rootView[index] = rNode;
|
|
13929
|
-
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13930
|
-
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13931
|
-
// representing a host element.
|
|
13932
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13933
|
-
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13934
|
-
if (mergedAttrs !== null) {
|
|
13935
|
-
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13936
|
-
if (rNode !== null) {
|
|
13937
|
-
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13938
|
-
if (tNode.classes !== null) {
|
|
13939
|
-
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13940
|
-
}
|
|
13941
|
-
if (tNode.styles !== null) {
|
|
13942
|
-
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13943
|
-
}
|
|
13944
|
-
}
|
|
13945
|
-
}
|
|
13946
|
-
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13947
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13948
|
-
if (tView.firstCreatePass) {
|
|
13949
|
-
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13950
|
-
markAsComponentHost(tView, tNode);
|
|
13951
|
-
initTNodeFlags(tNode, rootView.length, 1);
|
|
13952
|
-
}
|
|
13953
|
-
addToViewTree(rootView, componentView);
|
|
13954
|
-
// Store component view at node index, with node as the HOST
|
|
13955
|
-
return rootView[index] = componentView;
|
|
13956
|
-
}
|
|
13957
13786
|
/**
|
|
13958
|
-
*
|
|
13959
|
-
*
|
|
13787
|
+
* Create interpolation bindings with a variable number of expressions.
|
|
13788
|
+
*
|
|
13789
|
+
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
13790
|
+
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
13791
|
+
*
|
|
13792
|
+
* `values`:
|
|
13793
|
+
* - has static text at even indexes,
|
|
13794
|
+
* - has evaluated expressions at odd indexes.
|
|
13795
|
+
*
|
|
13796
|
+
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
13960
13797
|
*/
|
|
13961
|
-
function
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
feature(component, componentDef);
|
|
13970
|
-
}
|
|
13798
|
+
function interpolationV(lView, values) {
|
|
13799
|
+
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
13800
|
+
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
13801
|
+
let isBindingUpdated = false;
|
|
13802
|
+
let bindingIndex = getBindingIndex();
|
|
13803
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13804
|
+
// Check if bindings (odd indexes) have changed
|
|
13805
|
+
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
13971
13806
|
}
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
const tNode = getCurrentTNode();
|
|
13976
|
-
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13977
|
-
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13807
|
+
setBindingIndex(bindingIndex);
|
|
13808
|
+
if (!isBindingUpdated) {
|
|
13809
|
+
return NO_CHANGE;
|
|
13978
13810
|
}
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
setSelectedIndex(rootTNode.index);
|
|
13984
|
-
const rootTView = rootLView[TVIEW];
|
|
13985
|
-
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13986
|
-
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13811
|
+
// Build the updated content
|
|
13812
|
+
let content = values[0];
|
|
13813
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13814
|
+
content += renderStringify(values[i]) + values[i + 1];
|
|
13987
13815
|
}
|
|
13988
|
-
return
|
|
13989
|
-
}
|
|
13990
|
-
function createRootContext(scheduler, playerHandler) {
|
|
13991
|
-
return {
|
|
13992
|
-
components: [],
|
|
13993
|
-
scheduler: scheduler || defaultScheduler,
|
|
13994
|
-
clean: CLEAN_PROMISE,
|
|
13995
|
-
playerHandler: playerHandler || null,
|
|
13996
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
13997
|
-
};
|
|
13816
|
+
return content;
|
|
13998
13817
|
}
|
|
13999
13818
|
/**
|
|
14000
|
-
*
|
|
14001
|
-
*
|
|
14002
|
-
* Include this feature when calling `renderComponent` if the root component
|
|
14003
|
-
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
14004
|
-
* be called properly.
|
|
14005
|
-
*
|
|
14006
|
-
* Example:
|
|
13819
|
+
* Creates an interpolation binding with 1 expression.
|
|
14007
13820
|
*
|
|
14008
|
-
*
|
|
14009
|
-
*
|
|
14010
|
-
*
|
|
13821
|
+
* @param prefix static value used for concatenation only.
|
|
13822
|
+
* @param v0 value checked for change.
|
|
13823
|
+
* @param suffix static value used for concatenation only.
|
|
14011
13824
|
*/
|
|
14012
|
-
function
|
|
14013
|
-
const
|
|
14014
|
-
|
|
14015
|
-
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13825
|
+
function interpolation1(lView, prefix, v0, suffix) {
|
|
13826
|
+
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
13827
|
+
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14016
13828
|
}
|
|
14017
13829
|
/**
|
|
14018
|
-
*
|
|
14019
|
-
*
|
|
14020
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14021
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14022
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14023
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14024
|
-
*
|
|
14025
|
-
* Example:
|
|
14026
|
-
* ```
|
|
14027
|
-
* await whenRendered(myComponent);
|
|
14028
|
-
* ```
|
|
14029
|
-
*
|
|
14030
|
-
* @param component Component to wait upon
|
|
14031
|
-
* @returns Promise which resolves when the component is rendered.
|
|
13830
|
+
* Creates an interpolation binding with 2 expressions.
|
|
14032
13831
|
*/
|
|
14033
|
-
function
|
|
14034
|
-
|
|
13832
|
+
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
13833
|
+
const bindingIndex = getBindingIndex();
|
|
13834
|
+
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
13835
|
+
incrementBindingIndex(2);
|
|
13836
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14035
13837
|
}
|
|
14036
|
-
|
|
14037
13838
|
/**
|
|
14038
|
-
*
|
|
14039
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14040
|
-
*
|
|
14041
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14042
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13839
|
+
* Creates an interpolation binding with 3 expressions.
|
|
14043
13840
|
*/
|
|
14044
|
-
function
|
|
14045
|
-
|
|
13841
|
+
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
13842
|
+
const bindingIndex = getBindingIndex();
|
|
13843
|
+
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
13844
|
+
incrementBindingIndex(3);
|
|
13845
|
+
return different ?
|
|
13846
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
13847
|
+
NO_CHANGE;
|
|
14046
13848
|
}
|
|
14047
13849
|
/**
|
|
14048
|
-
*
|
|
14049
|
-
* @param definition The definition that is a SubClass of another directive of component
|
|
14050
|
-
*
|
|
14051
|
-
* @codeGenApi
|
|
13850
|
+
* Create an interpolation binding with 4 expressions.
|
|
14052
13851
|
*/
|
|
14053
|
-
function
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14061
|
-
superDef = superType.ɵcmp || superType.ɵdir;
|
|
14062
|
-
}
|
|
14063
|
-
else {
|
|
14064
|
-
if (superType.ɵcmp) {
|
|
14065
|
-
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
14066
|
-
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
14067
|
-
}
|
|
14068
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14069
|
-
superDef = superType.ɵdir;
|
|
14070
|
-
}
|
|
14071
|
-
if (superDef) {
|
|
14072
|
-
if (shouldInheritFields) {
|
|
14073
|
-
inheritanceChain.push(superDef);
|
|
14074
|
-
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
14075
|
-
// would've justified object creation. Unwrap them if necessary.
|
|
14076
|
-
const writeableDef = definition;
|
|
14077
|
-
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
14078
|
-
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
14079
|
-
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
14080
|
-
// Merge hostBindings
|
|
14081
|
-
const superHostBindings = superDef.hostBindings;
|
|
14082
|
-
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
14083
|
-
// Merge queries
|
|
14084
|
-
const superViewQuery = superDef.viewQuery;
|
|
14085
|
-
const superContentQueries = superDef.contentQueries;
|
|
14086
|
-
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
14087
|
-
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
14088
|
-
// Merge inputs and outputs
|
|
14089
|
-
fillProperties(definition.inputs, superDef.inputs);
|
|
14090
|
-
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
14091
|
-
fillProperties(definition.outputs, superDef.outputs);
|
|
14092
|
-
// Merge animations metadata.
|
|
14093
|
-
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
14094
|
-
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
14095
|
-
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
14096
|
-
// not inherit Components (we throw an error above and cannot reach this code).
|
|
14097
|
-
const defData = definition.data;
|
|
14098
|
-
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
14099
|
-
}
|
|
14100
|
-
}
|
|
14101
|
-
// Run parent features
|
|
14102
|
-
const features = superDef.features;
|
|
14103
|
-
if (features) {
|
|
14104
|
-
for (let i = 0; i < features.length; i++) {
|
|
14105
|
-
const feature = features[i];
|
|
14106
|
-
if (feature && feature.ngInherit) {
|
|
14107
|
-
feature(definition);
|
|
14108
|
-
}
|
|
14109
|
-
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
14110
|
-
// def already has all the necessary information inherited from its super class(es), so we
|
|
14111
|
-
// can stop merging fields from super classes. However we need to iterate through the
|
|
14112
|
-
// prototype chain to look for classes that might contain other "features" (like
|
|
14113
|
-
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
14114
|
-
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
14115
|
-
// logic and only invoking functions from the "features" list.
|
|
14116
|
-
if (feature === ɵɵInheritDefinitionFeature) {
|
|
14117
|
-
shouldInheritFields = false;
|
|
14118
|
-
}
|
|
14119
|
-
}
|
|
14120
|
-
}
|
|
14121
|
-
}
|
|
14122
|
-
superType = Object.getPrototypeOf(superType);
|
|
14123
|
-
}
|
|
14124
|
-
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13852
|
+
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
13853
|
+
const bindingIndex = getBindingIndex();
|
|
13854
|
+
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13855
|
+
incrementBindingIndex(4);
|
|
13856
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13857
|
+
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
13858
|
+
NO_CHANGE;
|
|
14125
13859
|
}
|
|
14126
13860
|
/**
|
|
14127
|
-
*
|
|
14128
|
-
*
|
|
14129
|
-
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
14130
|
-
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
14131
|
-
* type.
|
|
13861
|
+
* Creates an interpolation binding with 5 expressions.
|
|
14132
13862
|
*/
|
|
14133
|
-
function
|
|
14134
|
-
|
|
14135
|
-
let
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
// for each `hostAttrs` we need to merge it with superclass.
|
|
14142
|
-
def.hostAttrs =
|
|
14143
|
-
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
14144
|
-
}
|
|
14145
|
-
}
|
|
14146
|
-
function maybeUnwrapEmpty(value) {
|
|
14147
|
-
if (value === EMPTY_OBJ) {
|
|
14148
|
-
return {};
|
|
14149
|
-
}
|
|
14150
|
-
else if (value === EMPTY_ARRAY) {
|
|
14151
|
-
return [];
|
|
14152
|
-
}
|
|
14153
|
-
else {
|
|
14154
|
-
return value;
|
|
14155
|
-
}
|
|
14156
|
-
}
|
|
14157
|
-
function inheritViewQuery(definition, superViewQuery) {
|
|
14158
|
-
const prevViewQuery = definition.viewQuery;
|
|
14159
|
-
if (prevViewQuery) {
|
|
14160
|
-
definition.viewQuery = (rf, ctx) => {
|
|
14161
|
-
superViewQuery(rf, ctx);
|
|
14162
|
-
prevViewQuery(rf, ctx);
|
|
14163
|
-
};
|
|
14164
|
-
}
|
|
14165
|
-
else {
|
|
14166
|
-
definition.viewQuery = superViewQuery;
|
|
14167
|
-
}
|
|
14168
|
-
}
|
|
14169
|
-
function inheritContentQueries(definition, superContentQueries) {
|
|
14170
|
-
const prevContentQueries = definition.contentQueries;
|
|
14171
|
-
if (prevContentQueries) {
|
|
14172
|
-
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
14173
|
-
superContentQueries(rf, ctx, directiveIndex);
|
|
14174
|
-
prevContentQueries(rf, ctx, directiveIndex);
|
|
14175
|
-
};
|
|
14176
|
-
}
|
|
14177
|
-
else {
|
|
14178
|
-
definition.contentQueries = superContentQueries;
|
|
14179
|
-
}
|
|
14180
|
-
}
|
|
14181
|
-
function inheritHostBindings(definition, superHostBindings) {
|
|
14182
|
-
const prevHostBindings = definition.hostBindings;
|
|
14183
|
-
if (prevHostBindings) {
|
|
14184
|
-
definition.hostBindings = (rf, ctx) => {
|
|
14185
|
-
superHostBindings(rf, ctx);
|
|
14186
|
-
prevHostBindings(rf, ctx);
|
|
14187
|
-
};
|
|
14188
|
-
}
|
|
14189
|
-
else {
|
|
14190
|
-
definition.hostBindings = superHostBindings;
|
|
14191
|
-
}
|
|
13863
|
+
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
13864
|
+
const bindingIndex = getBindingIndex();
|
|
13865
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13866
|
+
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
13867
|
+
incrementBindingIndex(5);
|
|
13868
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13869
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
13870
|
+
NO_CHANGE;
|
|
14192
13871
|
}
|
|
14193
|
-
|
|
14194
13872
|
/**
|
|
14195
|
-
*
|
|
14196
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14197
|
-
*
|
|
14198
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14199
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13873
|
+
* Creates an interpolation binding with 6 expressions.
|
|
14200
13874
|
*/
|
|
13875
|
+
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
13876
|
+
const bindingIndex = getBindingIndex();
|
|
13877
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13878
|
+
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
13879
|
+
incrementBindingIndex(6);
|
|
13880
|
+
return different ?
|
|
13881
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
13882
|
+
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
13883
|
+
NO_CHANGE;
|
|
13884
|
+
}
|
|
14201
13885
|
/**
|
|
14202
|
-
*
|
|
14203
|
-
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13886
|
+
* Creates an interpolation binding with 7 expressions.
|
|
14204
13887
|
*/
|
|
14205
|
-
|
|
14206
|
-
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
13888
|
+
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
13889
|
+
const bindingIndex = getBindingIndex();
|
|
13890
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13891
|
+
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
13892
|
+
incrementBindingIndex(7);
|
|
13893
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13894
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
13895
|
+
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
13896
|
+
NO_CHANGE;
|
|
13897
|
+
}
|
|
14211
13898
|
/**
|
|
14212
|
-
*
|
|
14213
|
-
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
14214
|
-
*
|
|
14215
|
-
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
14216
|
-
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13899
|
+
* Creates an interpolation binding with 8 expressions.
|
|
14217
13900
|
*/
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
'encapsulation',
|
|
14230
|
-
// The child class should be checked by the runtime in the same way as its parent.
|
|
14231
|
-
'schemas',
|
|
14232
|
-
];
|
|
13901
|
+
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
13902
|
+
const bindingIndex = getBindingIndex();
|
|
13903
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13904
|
+
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
13905
|
+
incrementBindingIndex(8);
|
|
13906
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13907
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
13908
|
+
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
13909
|
+
NO_CHANGE;
|
|
13910
|
+
}
|
|
13911
|
+
|
|
14233
13912
|
/**
|
|
14234
|
-
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
14235
|
-
* definition.
|
|
14236
13913
|
*
|
|
14237
|
-
*
|
|
14238
|
-
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
14239
|
-
* generates a skeleton definition on the child class, and applies this feature.
|
|
13914
|
+
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14240
13915
|
*
|
|
14241
|
-
*
|
|
14242
|
-
* including things like the component template function.
|
|
13916
|
+
* Used when the value passed to a property has 1 interpolated value in it:
|
|
14243
13917
|
*
|
|
14244
|
-
*
|
|
14245
|
-
*
|
|
13918
|
+
* ```html
|
|
13919
|
+
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
13920
|
+
* ```
|
|
14246
13921
|
*
|
|
14247
|
-
*
|
|
13922
|
+
* Its compiled representation is::
|
|
13923
|
+
*
|
|
13924
|
+
* ```ts
|
|
13925
|
+
* ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
|
|
13926
|
+
* ```
|
|
13927
|
+
*
|
|
13928
|
+
* @param attrName The name of the attribute to update
|
|
13929
|
+
* @param prefix Static value used for concatenation only.
|
|
13930
|
+
* @param v0 Value checked for change.
|
|
13931
|
+
* @param suffix Static value used for concatenation only.
|
|
13932
|
+
* @param sanitizer An optional sanitizer function
|
|
13933
|
+
* @returns itself, so that it may be chained.
|
|
13934
|
+
* @codeGenApi
|
|
14248
13935
|
*/
|
|
14249
|
-
function
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
if (
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14258
|
-
superDef = superType.ɵdir;
|
|
14259
|
-
}
|
|
14260
|
-
// Needed because `definition` fields are readonly.
|
|
14261
|
-
const defAny = definition;
|
|
14262
|
-
// Copy over any fields that apply to either directives or components.
|
|
14263
|
-
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
14264
|
-
defAny[field] = superDef[field];
|
|
14265
|
-
}
|
|
14266
|
-
if (isComponentDef(superDef)) {
|
|
14267
|
-
// Copy over any component-specific fields.
|
|
14268
|
-
for (const field of COPY_COMPONENT_FIELDS) {
|
|
14269
|
-
defAny[field] = superDef[field];
|
|
14270
|
-
}
|
|
13936
|
+
function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
|
|
13937
|
+
const lView = getLView();
|
|
13938
|
+
const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
|
|
13939
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13940
|
+
const tNode = getSelectedTNode();
|
|
13941
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13942
|
+
ngDevMode &&
|
|
13943
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
|
|
14271
13944
|
}
|
|
13945
|
+
return ɵɵattributeInterpolate1;
|
|
14272
13946
|
}
|
|
14273
|
-
|
|
14274
13947
|
/**
|
|
14275
|
-
* @license
|
|
14276
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14277
13948
|
*
|
|
14278
|
-
*
|
|
14279
|
-
*
|
|
13949
|
+
* Update an interpolated attribute on an element with 2 bound values surrounded by text.
|
|
13950
|
+
*
|
|
13951
|
+
* Used when the value passed to a property has 2 interpolated values in it:
|
|
13952
|
+
*
|
|
13953
|
+
* ```html
|
|
13954
|
+
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
13955
|
+
* ```
|
|
13956
|
+
*
|
|
13957
|
+
* Its compiled representation is::
|
|
13958
|
+
*
|
|
13959
|
+
* ```ts
|
|
13960
|
+
* ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
|
|
13961
|
+
* ```
|
|
13962
|
+
*
|
|
13963
|
+
* @param attrName The name of the attribute to update
|
|
13964
|
+
* @param prefix Static value used for concatenation only.
|
|
13965
|
+
* @param v0 Value checked for change.
|
|
13966
|
+
* @param i0 Static value used for concatenation only.
|
|
13967
|
+
* @param v1 Value checked for change.
|
|
13968
|
+
* @param suffix Static value used for concatenation only.
|
|
13969
|
+
* @param sanitizer An optional sanitizer function
|
|
13970
|
+
* @returns itself, so that it may be chained.
|
|
13971
|
+
* @codeGenApi
|
|
14280
13972
|
*/
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
// es6-shim specific logic
|
|
14290
|
-
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
14291
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
14292
|
-
const key = keys[i];
|
|
14293
|
-
if (key !== 'entries' && key !== 'size' &&
|
|
14294
|
-
Map.prototype[key] === Map.prototype['entries']) {
|
|
14295
|
-
_symbolIterator = key;
|
|
14296
|
-
}
|
|
14297
|
-
}
|
|
14298
|
-
}
|
|
13973
|
+
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
13974
|
+
const lView = getLView();
|
|
13975
|
+
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
13976
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13977
|
+
const tNode = getSelectedTNode();
|
|
13978
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13979
|
+
ngDevMode &&
|
|
13980
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14299
13981
|
}
|
|
14300
|
-
return
|
|
13982
|
+
return ɵɵattributeInterpolate2;
|
|
14301
13983
|
}
|
|
14302
|
-
|
|
14303
13984
|
/**
|
|
14304
|
-
* @license
|
|
14305
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14306
13985
|
*
|
|
14307
|
-
*
|
|
14308
|
-
*
|
|
13986
|
+
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
13987
|
+
*
|
|
13988
|
+
* Used when the value passed to a property has 3 interpolated values in it:
|
|
13989
|
+
*
|
|
13990
|
+
* ```html
|
|
13991
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
13992
|
+
* ```
|
|
13993
|
+
*
|
|
13994
|
+
* Its compiled representation is::
|
|
13995
|
+
*
|
|
13996
|
+
* ```ts
|
|
13997
|
+
* ɵɵattributeInterpolate3(
|
|
13998
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
13999
|
+
* ```
|
|
14000
|
+
*
|
|
14001
|
+
* @param attrName The name of the attribute to update
|
|
14002
|
+
* @param prefix Static value used for concatenation only.
|
|
14003
|
+
* @param v0 Value checked for change.
|
|
14004
|
+
* @param i0 Static value used for concatenation only.
|
|
14005
|
+
* @param v1 Value checked for change.
|
|
14006
|
+
* @param i1 Static value used for concatenation only.
|
|
14007
|
+
* @param v2 Value checked for change.
|
|
14008
|
+
* @param suffix Static value used for concatenation only.
|
|
14009
|
+
* @param sanitizer An optional sanitizer function
|
|
14010
|
+
* @returns itself, so that it may be chained.
|
|
14011
|
+
* @codeGenApi
|
|
14309
14012
|
*/
|
|
14310
|
-
function
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
14319
|
-
}
|
|
14320
|
-
function areIterablesEqual(a, b, comparator) {
|
|
14321
|
-
const iterator1 = a[getSymbolIterator()]();
|
|
14322
|
-
const iterator2 = b[getSymbolIterator()]();
|
|
14323
|
-
while (true) {
|
|
14324
|
-
const item1 = iterator1.next();
|
|
14325
|
-
const item2 = iterator2.next();
|
|
14326
|
-
if (item1.done && item2.done)
|
|
14327
|
-
return true;
|
|
14328
|
-
if (item1.done || item2.done)
|
|
14329
|
-
return false;
|
|
14330
|
-
if (!comparator(item1.value, item2.value))
|
|
14331
|
-
return false;
|
|
14332
|
-
}
|
|
14333
|
-
}
|
|
14334
|
-
function iterateListLike(obj, fn) {
|
|
14335
|
-
if (Array.isArray(obj)) {
|
|
14336
|
-
for (let i = 0; i < obj.length; i++) {
|
|
14337
|
-
fn(obj[i]);
|
|
14338
|
-
}
|
|
14339
|
-
}
|
|
14340
|
-
else {
|
|
14341
|
-
const iterator = obj[getSymbolIterator()]();
|
|
14342
|
-
let item;
|
|
14343
|
-
while (!((item = iterator.next()).done)) {
|
|
14344
|
-
fn(item.value);
|
|
14345
|
-
}
|
|
14013
|
+
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14014
|
+
const lView = getLView();
|
|
14015
|
+
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14016
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
14017
|
+
const tNode = getSelectedTNode();
|
|
14018
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14019
|
+
ngDevMode &&
|
|
14020
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14346
14021
|
}
|
|
14022
|
+
return ɵɵattributeInterpolate3;
|
|
14347
14023
|
}
|
|
14348
|
-
function isJsObject(o) {
|
|
14349
|
-
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
14350
|
-
}
|
|
14351
|
-
|
|
14352
14024
|
/**
|
|
14353
|
-
* @license
|
|
14354
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14355
14025
|
*
|
|
14356
|
-
*
|
|
14357
|
-
*
|
|
14026
|
+
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14027
|
+
*
|
|
14028
|
+
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14029
|
+
*
|
|
14030
|
+
* ```html
|
|
14031
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14032
|
+
* ```
|
|
14033
|
+
*
|
|
14034
|
+
* Its compiled representation is::
|
|
14035
|
+
*
|
|
14036
|
+
* ```ts
|
|
14037
|
+
* ɵɵattributeInterpolate4(
|
|
14038
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14039
|
+
* ```
|
|
14040
|
+
*
|
|
14041
|
+
* @param attrName The name of the attribute to update
|
|
14042
|
+
* @param prefix Static value used for concatenation only.
|
|
14043
|
+
* @param v0 Value checked for change.
|
|
14044
|
+
* @param i0 Static value used for concatenation only.
|
|
14045
|
+
* @param v1 Value checked for change.
|
|
14046
|
+
* @param i1 Static value used for concatenation only.
|
|
14047
|
+
* @param v2 Value checked for change.
|
|
14048
|
+
* @param i2 Static value used for concatenation only.
|
|
14049
|
+
* @param v3 Value checked for change.
|
|
14050
|
+
* @param suffix Static value used for concatenation only.
|
|
14051
|
+
* @param sanitizer An optional sanitizer function
|
|
14052
|
+
* @returns itself, so that it may be chained.
|
|
14053
|
+
* @codeGenApi
|
|
14358
14054
|
*/
|
|
14359
|
-
function
|
|
14360
|
-
const
|
|
14361
|
-
const
|
|
14362
|
-
if (
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
14368
|
-
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
14369
|
-
return true;
|
|
14370
|
-
}
|
|
14371
|
-
else {
|
|
14372
|
-
return Object.is(a, b);
|
|
14373
|
-
}
|
|
14055
|
+
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14056
|
+
const lView = getLView();
|
|
14057
|
+
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14058
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
14059
|
+
const tNode = getSelectedTNode();
|
|
14060
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14061
|
+
ngDevMode &&
|
|
14062
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14374
14063
|
}
|
|
14064
|
+
return ɵɵattributeInterpolate4;
|
|
14375
14065
|
}
|
|
14376
|
-
|
|
14377
14066
|
/**
|
|
14378
|
-
* @license
|
|
14379
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14380
14067
|
*
|
|
14381
|
-
*
|
|
14382
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14383
|
-
*/
|
|
14384
|
-
// TODO(misko): consider inlining
|
|
14385
|
-
/** Updates binding and returns the value. */
|
|
14386
|
-
function updateBinding(lView, bindingIndex, value) {
|
|
14387
|
-
return lView[bindingIndex] = value;
|
|
14388
|
-
}
|
|
14389
|
-
/** Gets the current binding value. */
|
|
14390
|
-
function getBinding(lView, bindingIndex) {
|
|
14391
|
-
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
14392
|
-
ngDevMode &&
|
|
14393
|
-
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
14394
|
-
return lView[bindingIndex];
|
|
14395
|
-
}
|
|
14396
|
-
/**
|
|
14397
|
-
* Updates binding if changed, then returns whether it was updated.
|
|
14398
|
-
*
|
|
14399
|
-
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
14400
|
-
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
14401
|
-
* behavior.
|
|
14402
|
-
*
|
|
14403
|
-
* @param lView current `LView`
|
|
14404
|
-
* @param bindingIndex The binding in the `LView` to check
|
|
14405
|
-
* @param value New value to check against `lView[bindingIndex]`
|
|
14406
|
-
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
14407
|
-
* `CheckNoChangesMode`)
|
|
14408
|
-
*/
|
|
14409
|
-
function bindingUpdated(lView, bindingIndex, value) {
|
|
14410
|
-
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
14411
|
-
ngDevMode &&
|
|
14412
|
-
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
14413
|
-
const oldValue = lView[bindingIndex];
|
|
14414
|
-
if (Object.is(oldValue, value)) {
|
|
14415
|
-
return false;
|
|
14416
|
-
}
|
|
14417
|
-
else {
|
|
14418
|
-
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
14419
|
-
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
14420
|
-
// (before the change detection was run).
|
|
14421
|
-
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
14422
|
-
if (!devModeEqual(oldValueToCompare, value)) {
|
|
14423
|
-
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
14424
|
-
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
14425
|
-
}
|
|
14426
|
-
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
14427
|
-
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
14428
|
-
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
14429
|
-
// as change on next CD.)
|
|
14430
|
-
return false;
|
|
14431
|
-
}
|
|
14432
|
-
lView[bindingIndex] = value;
|
|
14433
|
-
return true;
|
|
14434
|
-
}
|
|
14435
|
-
}
|
|
14436
|
-
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
14437
|
-
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
14438
|
-
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
14439
|
-
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
14440
|
-
}
|
|
14441
|
-
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
14442
|
-
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
14443
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14444
|
-
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
14445
|
-
}
|
|
14446
|
-
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
14447
|
-
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
14448
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14449
|
-
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
14450
|
-
}
|
|
14451
|
-
|
|
14452
|
-
/**
|
|
14453
|
-
* @license
|
|
14454
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14455
|
-
*
|
|
14456
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14457
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14458
|
-
*/
|
|
14459
|
-
/**
|
|
14460
|
-
* Updates the value of or removes a bound attribute on an Element.
|
|
14461
|
-
*
|
|
14462
|
-
* Used in the case of `[attr.title]="value"`
|
|
14463
|
-
*
|
|
14464
|
-
* @param name name The name of the attribute.
|
|
14465
|
-
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
14466
|
-
* Otherwise the attribute value is set to the stringified value.
|
|
14467
|
-
* @param sanitizer An optional function used to sanitize the value.
|
|
14468
|
-
* @param namespace Optional namespace to use when setting the attribute.
|
|
14469
|
-
*
|
|
14470
|
-
* @codeGenApi
|
|
14471
|
-
*/
|
|
14472
|
-
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
14473
|
-
const lView = getLView();
|
|
14474
|
-
const bindingIndex = nextBindingIndex();
|
|
14475
|
-
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
14476
|
-
const tView = getTView();
|
|
14477
|
-
const tNode = getSelectedTNode();
|
|
14478
|
-
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
14479
|
-
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
14480
|
-
}
|
|
14481
|
-
return ɵɵattribute;
|
|
14482
|
-
}
|
|
14483
|
-
|
|
14484
|
-
/**
|
|
14485
|
-
* @license
|
|
14486
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14487
|
-
*
|
|
14488
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14489
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14490
|
-
*/
|
|
14491
|
-
/**
|
|
14492
|
-
* Create interpolation bindings with a variable number of expressions.
|
|
14493
|
-
*
|
|
14494
|
-
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
14495
|
-
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
14496
|
-
*
|
|
14497
|
-
* `values`:
|
|
14498
|
-
* - has static text at even indexes,
|
|
14499
|
-
* - has evaluated expressions at odd indexes.
|
|
14500
|
-
*
|
|
14501
|
-
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
14502
|
-
*/
|
|
14503
|
-
function interpolationV(lView, values) {
|
|
14504
|
-
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
14505
|
-
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
14506
|
-
let isBindingUpdated = false;
|
|
14507
|
-
let bindingIndex = getBindingIndex();
|
|
14508
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14509
|
-
// Check if bindings (odd indexes) have changed
|
|
14510
|
-
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
14511
|
-
}
|
|
14512
|
-
setBindingIndex(bindingIndex);
|
|
14513
|
-
if (!isBindingUpdated) {
|
|
14514
|
-
return NO_CHANGE;
|
|
14515
|
-
}
|
|
14516
|
-
// Build the updated content
|
|
14517
|
-
let content = values[0];
|
|
14518
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14519
|
-
content += renderStringify(values[i]) + values[i + 1];
|
|
14520
|
-
}
|
|
14521
|
-
return content;
|
|
14522
|
-
}
|
|
14523
|
-
/**
|
|
14524
|
-
* Creates an interpolation binding with 1 expression.
|
|
14525
|
-
*
|
|
14526
|
-
* @param prefix static value used for concatenation only.
|
|
14527
|
-
* @param v0 value checked for change.
|
|
14528
|
-
* @param suffix static value used for concatenation only.
|
|
14529
|
-
*/
|
|
14530
|
-
function interpolation1(lView, prefix, v0, suffix) {
|
|
14531
|
-
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
14532
|
-
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14533
|
-
}
|
|
14534
|
-
/**
|
|
14535
|
-
* Creates an interpolation binding with 2 expressions.
|
|
14536
|
-
*/
|
|
14537
|
-
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
14538
|
-
const bindingIndex = getBindingIndex();
|
|
14539
|
-
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
14540
|
-
incrementBindingIndex(2);
|
|
14541
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14542
|
-
}
|
|
14543
|
-
/**
|
|
14544
|
-
* Creates an interpolation binding with 3 expressions.
|
|
14545
|
-
*/
|
|
14546
|
-
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
14547
|
-
const bindingIndex = getBindingIndex();
|
|
14548
|
-
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
14549
|
-
incrementBindingIndex(3);
|
|
14550
|
-
return different ?
|
|
14551
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
14552
|
-
NO_CHANGE;
|
|
14553
|
-
}
|
|
14554
|
-
/**
|
|
14555
|
-
* Create an interpolation binding with 4 expressions.
|
|
14556
|
-
*/
|
|
14557
|
-
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
14558
|
-
const bindingIndex = getBindingIndex();
|
|
14559
|
-
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14560
|
-
incrementBindingIndex(4);
|
|
14561
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14562
|
-
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
14563
|
-
NO_CHANGE;
|
|
14564
|
-
}
|
|
14565
|
-
/**
|
|
14566
|
-
* Creates an interpolation binding with 5 expressions.
|
|
14567
|
-
*/
|
|
14568
|
-
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
14569
|
-
const bindingIndex = getBindingIndex();
|
|
14570
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14571
|
-
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
14572
|
-
incrementBindingIndex(5);
|
|
14573
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14574
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
14575
|
-
NO_CHANGE;
|
|
14576
|
-
}
|
|
14577
|
-
/**
|
|
14578
|
-
* Creates an interpolation binding with 6 expressions.
|
|
14579
|
-
*/
|
|
14580
|
-
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
14581
|
-
const bindingIndex = getBindingIndex();
|
|
14582
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14583
|
-
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
14584
|
-
incrementBindingIndex(6);
|
|
14585
|
-
return different ?
|
|
14586
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
14587
|
-
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
14588
|
-
NO_CHANGE;
|
|
14589
|
-
}
|
|
14590
|
-
/**
|
|
14591
|
-
* Creates an interpolation binding with 7 expressions.
|
|
14592
|
-
*/
|
|
14593
|
-
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
14594
|
-
const bindingIndex = getBindingIndex();
|
|
14595
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14596
|
-
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
14597
|
-
incrementBindingIndex(7);
|
|
14598
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14599
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14600
|
-
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
14601
|
-
NO_CHANGE;
|
|
14602
|
-
}
|
|
14603
|
-
/**
|
|
14604
|
-
* Creates an interpolation binding with 8 expressions.
|
|
14605
|
-
*/
|
|
14606
|
-
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
14607
|
-
const bindingIndex = getBindingIndex();
|
|
14608
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14609
|
-
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
14610
|
-
incrementBindingIndex(8);
|
|
14611
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14612
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14613
|
-
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
14614
|
-
NO_CHANGE;
|
|
14615
|
-
}
|
|
14616
|
-
|
|
14617
|
-
/**
|
|
14618
|
-
*
|
|
14619
|
-
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14068
|
+
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14620
14069
|
*
|
|
14621
|
-
* Used when the value passed to a property has
|
|
14070
|
+
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14622
14071
|
*
|
|
14623
14072
|
* ```html
|
|
14624
|
-
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
14073
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14625
14074
|
* ```
|
|
14626
14075
|
*
|
|
14627
14076
|
* Its compiled representation is::
|
|
14628
14077
|
*
|
|
14629
14078
|
* ```ts
|
|
14630
|
-
* ɵɵ
|
|
14079
|
+
* ɵɵattributeInterpolate5(
|
|
14080
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14631
14081
|
* ```
|
|
14632
14082
|
*
|
|
14633
14083
|
* @param attrName The name of the attribute to update
|
|
14634
14084
|
* @param prefix Static value used for concatenation only.
|
|
14635
14085
|
* @param v0 Value checked for change.
|
|
14086
|
+
* @param i0 Static value used for concatenation only.
|
|
14087
|
+
* @param v1 Value checked for change.
|
|
14088
|
+
* @param i1 Static value used for concatenation only.
|
|
14089
|
+
* @param v2 Value checked for change.
|
|
14090
|
+
* @param i2 Static value used for concatenation only.
|
|
14091
|
+
* @param v3 Value checked for change.
|
|
14092
|
+
* @param i3 Static value used for concatenation only.
|
|
14093
|
+
* @param v4 Value checked for change.
|
|
14636
14094
|
* @param suffix Static value used for concatenation only.
|
|
14637
14095
|
* @param sanitizer An optional sanitizer function
|
|
14638
14096
|
* @returns itself, so that it may be chained.
|
|
14639
14097
|
* @codeGenApi
|
|
14640
14098
|
*/
|
|
14641
|
-
function ɵɵ
|
|
14099
|
+
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14642
14100
|
const lView = getLView();
|
|
14643
|
-
const interpolatedValue =
|
|
14101
|
+
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14644
14102
|
if (interpolatedValue !== NO_CHANGE) {
|
|
14645
14103
|
const tNode = getSelectedTNode();
|
|
14646
14104
|
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14647
14105
|
ngDevMode &&
|
|
14648
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() -
|
|
14106
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14649
14107
|
}
|
|
14650
|
-
return ɵɵ
|
|
14108
|
+
return ɵɵattributeInterpolate5;
|
|
14651
14109
|
}
|
|
14652
14110
|
/**
|
|
14653
14111
|
*
|
|
14654
|
-
* Update an interpolated attribute on an element with
|
|
14112
|
+
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14655
14113
|
*
|
|
14656
|
-
* Used when the value passed to a property has
|
|
14114
|
+
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14657
14115
|
*
|
|
14658
14116
|
* ```html
|
|
14659
|
-
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
14117
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14660
14118
|
* ```
|
|
14661
14119
|
*
|
|
14662
14120
|
* Its compiled representation is::
|
|
14663
14121
|
*
|
|
14664
14122
|
* ```ts
|
|
14665
|
-
* ɵɵ
|
|
14666
|
-
*
|
|
14667
|
-
*
|
|
14668
|
-
* @param attrName The name of the attribute to update
|
|
14669
|
-
* @param prefix Static value used for concatenation only.
|
|
14670
|
-
* @param v0 Value checked for change.
|
|
14671
|
-
* @param i0 Static value used for concatenation only.
|
|
14672
|
-
* @param v1 Value checked for change.
|
|
14673
|
-
* @param suffix Static value used for concatenation only.
|
|
14674
|
-
* @param sanitizer An optional sanitizer function
|
|
14675
|
-
* @returns itself, so that it may be chained.
|
|
14676
|
-
* @codeGenApi
|
|
14677
|
-
*/
|
|
14678
|
-
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
14679
|
-
const lView = getLView();
|
|
14680
|
-
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
14681
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14682
|
-
const tNode = getSelectedTNode();
|
|
14683
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14684
|
-
ngDevMode &&
|
|
14685
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14686
|
-
}
|
|
14687
|
-
return ɵɵattributeInterpolate2;
|
|
14688
|
-
}
|
|
14689
|
-
/**
|
|
14690
|
-
*
|
|
14691
|
-
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
14692
|
-
*
|
|
14693
|
-
* Used when the value passed to a property has 3 interpolated values in it:
|
|
14694
|
-
*
|
|
14695
|
-
* ```html
|
|
14696
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
14697
|
-
* ```
|
|
14698
|
-
*
|
|
14699
|
-
* Its compiled representation is::
|
|
14700
|
-
*
|
|
14701
|
-
* ```ts
|
|
14702
|
-
* ɵɵattributeInterpolate3(
|
|
14703
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
14704
|
-
* ```
|
|
14705
|
-
*
|
|
14706
|
-
* @param attrName The name of the attribute to update
|
|
14707
|
-
* @param prefix Static value used for concatenation only.
|
|
14708
|
-
* @param v0 Value checked for change.
|
|
14709
|
-
* @param i0 Static value used for concatenation only.
|
|
14710
|
-
* @param v1 Value checked for change.
|
|
14711
|
-
* @param i1 Static value used for concatenation only.
|
|
14712
|
-
* @param v2 Value checked for change.
|
|
14713
|
-
* @param suffix Static value used for concatenation only.
|
|
14714
|
-
* @param sanitizer An optional sanitizer function
|
|
14715
|
-
* @returns itself, so that it may be chained.
|
|
14716
|
-
* @codeGenApi
|
|
14717
|
-
*/
|
|
14718
|
-
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14719
|
-
const lView = getLView();
|
|
14720
|
-
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14721
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14722
|
-
const tNode = getSelectedTNode();
|
|
14723
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14724
|
-
ngDevMode &&
|
|
14725
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14726
|
-
}
|
|
14727
|
-
return ɵɵattributeInterpolate3;
|
|
14728
|
-
}
|
|
14729
|
-
/**
|
|
14730
|
-
*
|
|
14731
|
-
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14732
|
-
*
|
|
14733
|
-
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14734
|
-
*
|
|
14735
|
-
* ```html
|
|
14736
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14737
|
-
* ```
|
|
14738
|
-
*
|
|
14739
|
-
* Its compiled representation is::
|
|
14740
|
-
*
|
|
14741
|
-
* ```ts
|
|
14742
|
-
* ɵɵattributeInterpolate4(
|
|
14743
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14744
|
-
* ```
|
|
14745
|
-
*
|
|
14746
|
-
* @param attrName The name of the attribute to update
|
|
14747
|
-
* @param prefix Static value used for concatenation only.
|
|
14748
|
-
* @param v0 Value checked for change.
|
|
14749
|
-
* @param i0 Static value used for concatenation only.
|
|
14750
|
-
* @param v1 Value checked for change.
|
|
14751
|
-
* @param i1 Static value used for concatenation only.
|
|
14752
|
-
* @param v2 Value checked for change.
|
|
14753
|
-
* @param i2 Static value used for concatenation only.
|
|
14754
|
-
* @param v3 Value checked for change.
|
|
14755
|
-
* @param suffix Static value used for concatenation only.
|
|
14756
|
-
* @param sanitizer An optional sanitizer function
|
|
14757
|
-
* @returns itself, so that it may be chained.
|
|
14758
|
-
* @codeGenApi
|
|
14759
|
-
*/
|
|
14760
|
-
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14761
|
-
const lView = getLView();
|
|
14762
|
-
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14763
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14764
|
-
const tNode = getSelectedTNode();
|
|
14765
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14766
|
-
ngDevMode &&
|
|
14767
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14768
|
-
}
|
|
14769
|
-
return ɵɵattributeInterpolate4;
|
|
14770
|
-
}
|
|
14771
|
-
/**
|
|
14772
|
-
*
|
|
14773
|
-
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14774
|
-
*
|
|
14775
|
-
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14776
|
-
*
|
|
14777
|
-
* ```html
|
|
14778
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14779
|
-
* ```
|
|
14780
|
-
*
|
|
14781
|
-
* Its compiled representation is::
|
|
14782
|
-
*
|
|
14783
|
-
* ```ts
|
|
14784
|
-
* ɵɵattributeInterpolate5(
|
|
14785
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14786
|
-
* ```
|
|
14787
|
-
*
|
|
14788
|
-
* @param attrName The name of the attribute to update
|
|
14789
|
-
* @param prefix Static value used for concatenation only.
|
|
14790
|
-
* @param v0 Value checked for change.
|
|
14791
|
-
* @param i0 Static value used for concatenation only.
|
|
14792
|
-
* @param v1 Value checked for change.
|
|
14793
|
-
* @param i1 Static value used for concatenation only.
|
|
14794
|
-
* @param v2 Value checked for change.
|
|
14795
|
-
* @param i2 Static value used for concatenation only.
|
|
14796
|
-
* @param v3 Value checked for change.
|
|
14797
|
-
* @param i3 Static value used for concatenation only.
|
|
14798
|
-
* @param v4 Value checked for change.
|
|
14799
|
-
* @param suffix Static value used for concatenation only.
|
|
14800
|
-
* @param sanitizer An optional sanitizer function
|
|
14801
|
-
* @returns itself, so that it may be chained.
|
|
14802
|
-
* @codeGenApi
|
|
14803
|
-
*/
|
|
14804
|
-
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14805
|
-
const lView = getLView();
|
|
14806
|
-
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14807
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14808
|
-
const tNode = getSelectedTNode();
|
|
14809
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14810
|
-
ngDevMode &&
|
|
14811
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14812
|
-
}
|
|
14813
|
-
return ɵɵattributeInterpolate5;
|
|
14814
|
-
}
|
|
14815
|
-
/**
|
|
14816
|
-
*
|
|
14817
|
-
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14818
|
-
*
|
|
14819
|
-
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14820
|
-
*
|
|
14821
|
-
* ```html
|
|
14822
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14823
|
-
* ```
|
|
14824
|
-
*
|
|
14825
|
-
* Its compiled representation is::
|
|
14826
|
-
*
|
|
14827
|
-
* ```ts
|
|
14828
|
-
* ɵɵattributeInterpolate6(
|
|
14829
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14123
|
+
* ɵɵattributeInterpolate6(
|
|
14124
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14830
14125
|
* ```
|
|
14831
14126
|
*
|
|
14832
14127
|
* @param attrName The name of the attribute to update
|
|
@@ -14999,6 +14294,40 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
|
|
|
14999
14294
|
return ɵɵattributeInterpolateV;
|
|
15000
14295
|
}
|
|
15001
14296
|
|
|
14297
|
+
/**
|
|
14298
|
+
* @license
|
|
14299
|
+
* Copyright Google LLC All Rights Reserved.
|
|
14300
|
+
*
|
|
14301
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
14302
|
+
* found in the LICENSE file at https://angular.io/license
|
|
14303
|
+
*/
|
|
14304
|
+
/**
|
|
14305
|
+
* Synchronously perform change detection on a component (and possibly its sub-components).
|
|
14306
|
+
*
|
|
14307
|
+
* This function triggers change detection in a synchronous way on a component.
|
|
14308
|
+
*
|
|
14309
|
+
* @param component The component which the change detection should be performed on.
|
|
14310
|
+
*/
|
|
14311
|
+
function detectChanges(component) {
|
|
14312
|
+
const view = getComponentViewByInstance(component);
|
|
14313
|
+
detectChangesInternal(view[TVIEW], view, component);
|
|
14314
|
+
}
|
|
14315
|
+
/**
|
|
14316
|
+
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
14317
|
+
* schedule a change detection on it at some point in the future.
|
|
14318
|
+
*
|
|
14319
|
+
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
14320
|
+
* detection can be scheduled per component tree.
|
|
14321
|
+
*
|
|
14322
|
+
* @param component Component to mark as dirty.
|
|
14323
|
+
*/
|
|
14324
|
+
function markDirty(component) {
|
|
14325
|
+
ngDevMode && assertDefined(component, 'component');
|
|
14326
|
+
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
14327
|
+
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
14328
|
+
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
14329
|
+
}
|
|
14330
|
+
|
|
15002
14331
|
/**
|
|
15003
14332
|
* @license
|
|
15004
14333
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -15543,51 +14872,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15543
14872
|
tNode.index;
|
|
15544
14873
|
// In order to match current behavior, native DOM event listeners must be added for all
|
|
15545
14874
|
// events (including outputs).
|
|
15546
|
-
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
|
|
15550
|
-
|
|
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
|
-
processOutputs = false;
|
|
15576
|
-
}
|
|
15577
|
-
else {
|
|
15578
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
15579
|
-
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15580
|
-
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15581
|
-
lCleanup.push(listenerFn, cleanupFn);
|
|
15582
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15583
|
-
}
|
|
14875
|
+
// There might be cases where multiple directives on the same element try to register an event
|
|
14876
|
+
// handler function for the same event. In this situation we want to avoid registration of
|
|
14877
|
+
// several native listeners as each registration would be intercepted by NgZone and
|
|
14878
|
+
// trigger change detection. This would mean that a single user action would result in several
|
|
14879
|
+
// change detections being invoked. To avoid this situation we want to have only one call to
|
|
14880
|
+
// native handler registration (for the same element and same type of event).
|
|
14881
|
+
//
|
|
14882
|
+
// In order to have just one native event handler in presence of multiple handler functions,
|
|
14883
|
+
// we just register a first handler function as a native event listener and then chain
|
|
14884
|
+
// (coalesce) other handler functions on top of the first native handler function.
|
|
14885
|
+
let existingListener = null;
|
|
14886
|
+
// Please note that the coalescing described here doesn't happen for events specifying an
|
|
14887
|
+
// alternative target (ex. (document:click)) - this is to keep backward compatibility with the
|
|
14888
|
+
// view engine.
|
|
14889
|
+
// Also, we don't have to search for existing listeners is there are no directives
|
|
14890
|
+
// matching on a given node as we can't register multiple event handlers for the same event in
|
|
14891
|
+
// a template (this would mean having duplicate attributes).
|
|
14892
|
+
if (!eventTargetResolver && isTNodeDirectiveHost) {
|
|
14893
|
+
existingListener = findExistingListener(tView, lView, eventName, tNode.index);
|
|
14894
|
+
}
|
|
14895
|
+
if (existingListener !== null) {
|
|
14896
|
+
// Attach a new listener to coalesced listeners list, maintaining the order in which
|
|
14897
|
+
// listeners are registered. For performance reasons, we keep a reference to the last
|
|
14898
|
+
// listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
|
|
14899
|
+
// the entire set each time we need to add a new listener.
|
|
14900
|
+
const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
|
|
14901
|
+
lastListenerFn.__ngNextListenerFn__ = listenerFn;
|
|
14902
|
+
existingListener.__ngLastListenerFn__ = listenerFn;
|
|
14903
|
+
processOutputs = false;
|
|
15584
14904
|
}
|
|
15585
14905
|
else {
|
|
15586
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn,
|
|
15587
|
-
|
|
14906
|
+
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
14907
|
+
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15588
14908
|
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15589
|
-
lCleanup.push(listenerFn);
|
|
15590
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex,
|
|
14909
|
+
lCleanup.push(listenerFn, cleanupFn);
|
|
14910
|
+
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15591
14911
|
}
|
|
15592
14912
|
}
|
|
15593
14913
|
else {
|
|
@@ -16256,7 +15576,7 @@ function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
|
|
|
16256
15576
|
* be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
|
|
16257
15577
|
*
|
|
16258
15578
|
* @param propName The name of the property to update.
|
|
16259
|
-
* @param values The collection of values and the strings
|
|
15579
|
+
* @param values The collection of values and the strings in between those values, beginning with a
|
|
16260
15580
|
* string prefix and ending with a string suffix.
|
|
16261
15581
|
* (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
|
|
16262
15582
|
* @param sanitizer An optional sanitizer function
|
|
@@ -17661,7 +16981,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
|
|
|
17661
16981
|
valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
|
|
17662
16982
|
}
|
|
17663
16983
|
let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
|
|
17664
|
-
key === prop ? valueAtLViewIndex : undefined;
|
|
16984
|
+
(key === prop ? valueAtLViewIndex : undefined);
|
|
17665
16985
|
if (containsStatics && !isStylingValuePresent(currentValue)) {
|
|
17666
16986
|
currentValue = keyValueArrayGet(rawKey, prop);
|
|
17667
16987
|
}
|
|
@@ -19184,7 +18504,7 @@ function findLocaleData(locale) {
|
|
|
19184
18504
|
if (parentLocale === 'en') {
|
|
19185
18505
|
return localeEn;
|
|
19186
18506
|
}
|
|
19187
|
-
throw new
|
|
18507
|
+
throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
|
|
19188
18508
|
}
|
|
19189
18509
|
/**
|
|
19190
18510
|
* Retrieves the default currency code for the given locale.
|
|
@@ -19323,7 +18643,7 @@ var I18nCreateOpCode;
|
|
|
19323
18643
|
*/
|
|
19324
18644
|
I18nCreateOpCode[I18nCreateOpCode["SHIFT"] = 2] = "SHIFT";
|
|
19325
18645
|
/**
|
|
19326
|
-
* Should the node be appended to parent
|
|
18646
|
+
* Should the node be appended to parent immediately after creation.
|
|
19327
18647
|
*/
|
|
19328
18648
|
I18nCreateOpCode[I18nCreateOpCode["APPEND_EAGERLY"] = 1] = "APPEND_EAGERLY";
|
|
19329
18649
|
/**
|
|
@@ -21514,7 +20834,7 @@ function noComponentFactoryError(component) {
|
|
|
21514
20834
|
return error;
|
|
21515
20835
|
}
|
|
21516
20836
|
const ERROR_COMPONENT = 'ngComponent';
|
|
21517
|
-
function getComponent(error) {
|
|
20837
|
+
function getComponent$1(error) {
|
|
21518
20838
|
return error[ERROR_COMPONENT];
|
|
21519
20839
|
}
|
|
21520
20840
|
class _NullComponentFactoryResolver {
|
|
@@ -21564,7 +20884,7 @@ class NgModuleRef$1 {
|
|
|
21564
20884
|
* JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
|
|
21565
20885
|
* for additional context. Angular provides APIs that accept NgModule classes directly (such as
|
|
21566
20886
|
* [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
|
|
21567
|
-
* [
|
|
20887
|
+
* [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of
|
|
21568
20888
|
* using factory-based ones.
|
|
21569
20889
|
*/
|
|
21570
20890
|
class NgModuleFactory$1 {
|
|
@@ -21698,14 +21018,6 @@ class Renderer2 {
|
|
|
21698
21018
|
* @nocollapse
|
|
21699
21019
|
*/
|
|
21700
21020
|
Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
|
|
21701
|
-
/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
|
|
21702
|
-
function getOrCreateRenderer2(lView) {
|
|
21703
|
-
const renderer = lView[RENDERER];
|
|
21704
|
-
if (ngDevMode && !isProceduralRenderer(renderer)) {
|
|
21705
|
-
throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
|
|
21706
|
-
}
|
|
21707
|
-
return renderer;
|
|
21708
|
-
}
|
|
21709
21021
|
/** Injects a Renderer2 for the current component. */
|
|
21710
21022
|
function injectRenderer2() {
|
|
21711
21023
|
// We need the Renderer to be based on the component that it's being injected into, however since
|
|
@@ -21713,7 +21025,7 @@ function injectRenderer2() {
|
|
|
21713
21025
|
const lView = getLView();
|
|
21714
21026
|
const tNode = getCurrentTNode();
|
|
21715
21027
|
const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
|
|
21716
|
-
return
|
|
21028
|
+
return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
|
|
21717
21029
|
}
|
|
21718
21030
|
|
|
21719
21031
|
/**
|
|
@@ -21760,7 +21072,7 @@ class Version {
|
|
|
21760
21072
|
/**
|
|
21761
21073
|
* @publicApi
|
|
21762
21074
|
*/
|
|
21763
|
-
const VERSION = new Version('14.1.0-
|
|
21075
|
+
const VERSION = new Version('14.1.0-rc.0');
|
|
21764
21076
|
|
|
21765
21077
|
/**
|
|
21766
21078
|
* @license
|
|
@@ -22224,7 +21536,13 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
22224
21536
|
realEnvironmentInjector;
|
|
22225
21537
|
}
|
|
22226
21538
|
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
|
|
22227
|
-
const rendererFactory = rootViewInjector.get(RendererFactory2,
|
|
21539
|
+
const rendererFactory = rootViewInjector.get(RendererFactory2, null);
|
|
21540
|
+
if (rendererFactory === null) {
|
|
21541
|
+
throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
|
|
21542
|
+
'Angular was not able to inject a renderer (RendererFactory2). ' +
|
|
21543
|
+
'Likely this is due to a broken DI hierarchy. ' +
|
|
21544
|
+
'Make sure that any injector used to create this component has a correct parent.');
|
|
21545
|
+
}
|
|
22228
21546
|
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
22229
21547
|
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
22230
21548
|
// Determine a tag name used for creating host elements when this component is created
|
|
@@ -22291,223 +21609,663 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
22291
21609
|
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
22292
21610
|
}
|
|
22293
21611
|
}
|
|
22294
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21612
|
+
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21613
|
+
/**
|
|
21614
|
+
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
21615
|
+
* ComponentFactoryResolver
|
|
21616
|
+
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21617
|
+
*
|
|
21618
|
+
* @returns The ComponentFactoryResolver instance to use
|
|
21619
|
+
*/
|
|
21620
|
+
function injectComponentFactoryResolver() {
|
|
21621
|
+
return componentFactoryResolver;
|
|
21622
|
+
}
|
|
21623
|
+
/**
|
|
21624
|
+
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
21625
|
+
*
|
|
21626
|
+
* `ComponentRef` provides access to the Component Instance as well other objects related to this
|
|
21627
|
+
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
|
|
21628
|
+
* method.
|
|
21629
|
+
*
|
|
21630
|
+
*/
|
|
21631
|
+
class ComponentRef extends ComponentRef$1 {
|
|
21632
|
+
constructor(componentType, instance, location, _rootLView, _tNode) {
|
|
21633
|
+
super();
|
|
21634
|
+
this.location = location;
|
|
21635
|
+
this._rootLView = _rootLView;
|
|
21636
|
+
this._tNode = _tNode;
|
|
21637
|
+
this.instance = instance;
|
|
21638
|
+
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
21639
|
+
this.componentType = componentType;
|
|
21640
|
+
}
|
|
21641
|
+
setInput(name, value) {
|
|
21642
|
+
const inputData = this._tNode.inputs;
|
|
21643
|
+
let dataValue;
|
|
21644
|
+
if (inputData !== null && (dataValue = inputData[name])) {
|
|
21645
|
+
const lView = this._rootLView;
|
|
21646
|
+
setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
|
|
21647
|
+
markDirtyIfOnPush(lView, this._tNode.index);
|
|
21648
|
+
}
|
|
21649
|
+
else {
|
|
21650
|
+
if (ngDevMode) {
|
|
21651
|
+
const cmpNameForError = stringifyForError(this.componentType);
|
|
21652
|
+
let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
|
|
21653
|
+
message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
|
|
21654
|
+
reportUnknownPropertyError(message);
|
|
21655
|
+
}
|
|
21656
|
+
}
|
|
21657
|
+
}
|
|
21658
|
+
get injector() {
|
|
21659
|
+
return new NodeInjector(this._tNode, this._rootLView);
|
|
21660
|
+
}
|
|
21661
|
+
destroy() {
|
|
21662
|
+
this.hostView.destroy();
|
|
21663
|
+
}
|
|
21664
|
+
onDestroy(callback) {
|
|
21665
|
+
this.hostView.onDestroy(callback);
|
|
21666
|
+
}
|
|
21667
|
+
}
|
|
21668
|
+
|
|
21669
|
+
/**
|
|
21670
|
+
* @license
|
|
21671
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21672
|
+
*
|
|
21673
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21674
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21675
|
+
*/
|
|
21676
|
+
/**
|
|
21677
|
+
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
21678
|
+
*
|
|
21679
|
+
* @param ngModule NgModule class.
|
|
21680
|
+
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
21681
|
+
* not provided, `NullInjector` will be used instead.
|
|
21682
|
+
* @returns NgModuleRef that represents an NgModule instance.
|
|
21683
|
+
*
|
|
21684
|
+
* @publicApi
|
|
21685
|
+
*/
|
|
21686
|
+
function createNgModule(ngModule, parentInjector) {
|
|
21687
|
+
return new NgModuleRef(ngModule, parentInjector !== null && parentInjector !== void 0 ? parentInjector : null);
|
|
21688
|
+
}
|
|
21689
|
+
/**
|
|
21690
|
+
* The `createNgModule` function alias for backwards-compatibility.
|
|
21691
|
+
* Please avoid using it directly and use `createNgModule` instead.
|
|
21692
|
+
*
|
|
21693
|
+
* @deprecated Use `createNgModule` instead.
|
|
21694
|
+
*/
|
|
21695
|
+
const createNgModuleRef = createNgModule;
|
|
21696
|
+
class NgModuleRef extends NgModuleRef$1 {
|
|
21697
|
+
constructor(ngModuleType, _parent) {
|
|
21698
|
+
super();
|
|
21699
|
+
this._parent = _parent;
|
|
21700
|
+
// tslint:disable-next-line:require-internal-with-underscore
|
|
21701
|
+
this._bootstrapComponents = [];
|
|
21702
|
+
this.injector = this;
|
|
21703
|
+
this.destroyCbs = [];
|
|
21704
|
+
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
21705
|
+
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
21706
|
+
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
21707
|
+
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
21708
|
+
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
21709
|
+
// and providing it, rather than letting the injector resolve it.
|
|
21710
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21711
|
+
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
21712
|
+
ngDevMode &&
|
|
21713
|
+
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
21714
|
+
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
21715
|
+
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
21716
|
+
{ provide: NgModuleRef$1, useValue: this }, {
|
|
21717
|
+
provide: ComponentFactoryResolver$1,
|
|
21718
|
+
useValue: this.componentFactoryResolver
|
|
21719
|
+
}
|
|
21720
|
+
], stringify(ngModuleType), new Set(['environment']));
|
|
21721
|
+
// We need to resolve the injector types separately from the injector creation, because
|
|
21722
|
+
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21723
|
+
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21724
|
+
this._r3Injector.resolveInjectorInitializers();
|
|
21725
|
+
this.instance = this.get(ngModuleType);
|
|
21726
|
+
}
|
|
21727
|
+
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
21728
|
+
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
21729
|
+
return this;
|
|
21730
|
+
}
|
|
21731
|
+
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
21732
|
+
}
|
|
21733
|
+
runInContext(fn) {
|
|
21734
|
+
return this.injector.runInContext(fn);
|
|
21735
|
+
}
|
|
21736
|
+
destroy() {
|
|
21737
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21738
|
+
const injector = this._r3Injector;
|
|
21739
|
+
!injector.destroyed && injector.destroy();
|
|
21740
|
+
this.destroyCbs.forEach(fn => fn());
|
|
21741
|
+
this.destroyCbs = null;
|
|
21742
|
+
}
|
|
21743
|
+
onDestroy(callback) {
|
|
21744
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21745
|
+
this.destroyCbs.push(callback);
|
|
21746
|
+
}
|
|
21747
|
+
}
|
|
21748
|
+
class NgModuleFactory extends NgModuleFactory$1 {
|
|
21749
|
+
constructor(moduleType) {
|
|
21750
|
+
super();
|
|
21751
|
+
this.moduleType = moduleType;
|
|
21752
|
+
}
|
|
21753
|
+
create(parentInjector) {
|
|
21754
|
+
return new NgModuleRef(this.moduleType, parentInjector);
|
|
21755
|
+
}
|
|
21756
|
+
}
|
|
21757
|
+
class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
21758
|
+
constructor(providers, parent, source) {
|
|
21759
|
+
super();
|
|
21760
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21761
|
+
this.instance = null;
|
|
21762
|
+
const injector = new R3Injector([
|
|
21763
|
+
...providers,
|
|
21764
|
+
{ provide: NgModuleRef$1, useValue: this },
|
|
21765
|
+
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
21766
|
+
], parent || getNullInjector(), source, new Set(['environment']));
|
|
21767
|
+
this.injector = injector;
|
|
21768
|
+
injector.resolveInjectorInitializers();
|
|
21769
|
+
}
|
|
21770
|
+
destroy() {
|
|
21771
|
+
this.injector.destroy();
|
|
21772
|
+
}
|
|
21773
|
+
onDestroy(callback) {
|
|
21774
|
+
this.injector.onDestroy(callback);
|
|
21775
|
+
}
|
|
21776
|
+
}
|
|
21777
|
+
/**
|
|
21778
|
+
* Create a new environment injector.
|
|
21779
|
+
*
|
|
21780
|
+
* Learn more about environment injectors in
|
|
21781
|
+
* [this guide](guide/standalone-components#environment-injectors).
|
|
21782
|
+
*
|
|
21783
|
+
* @param providers An array of providers.
|
|
21784
|
+
* @param parent A parent environment injector.
|
|
21785
|
+
* @param debugName An optional name for this injector instance, which will be used in error
|
|
21786
|
+
* messages.
|
|
21787
|
+
*
|
|
21788
|
+
* @publicApi
|
|
21789
|
+
* @developerPreview
|
|
21790
|
+
*/
|
|
21791
|
+
function createEnvironmentInjector(providers, parent, debugName = null) {
|
|
21792
|
+
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
21793
|
+
return adapter.injector;
|
|
21794
|
+
}
|
|
21795
|
+
|
|
21796
|
+
/**
|
|
21797
|
+
* @license
|
|
21798
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21799
|
+
*
|
|
21800
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21801
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21802
|
+
*/
|
|
21803
|
+
/**
|
|
21804
|
+
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
21805
|
+
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
21806
|
+
* collected from the imports graph rooted at a given standalone component.
|
|
21807
|
+
*/
|
|
21808
|
+
class StandaloneService {
|
|
21809
|
+
constructor(_injector) {
|
|
21810
|
+
this._injector = _injector;
|
|
21811
|
+
this.cachedInjectors = new Map();
|
|
21812
|
+
}
|
|
21813
|
+
getOrCreateStandaloneInjector(componentDef) {
|
|
21814
|
+
if (!componentDef.standalone) {
|
|
21815
|
+
return null;
|
|
21816
|
+
}
|
|
21817
|
+
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
21818
|
+
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
21819
|
+
const standaloneInjector = providers.length > 0 ?
|
|
21820
|
+
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
21821
|
+
null;
|
|
21822
|
+
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
21823
|
+
}
|
|
21824
|
+
return this.cachedInjectors.get(componentDef.id);
|
|
21825
|
+
}
|
|
21826
|
+
ngOnDestroy() {
|
|
21827
|
+
try {
|
|
21828
|
+
for (const injector of this.cachedInjectors.values()) {
|
|
21829
|
+
if (injector !== null) {
|
|
21830
|
+
injector.destroy();
|
|
21831
|
+
}
|
|
21832
|
+
}
|
|
21833
|
+
}
|
|
21834
|
+
finally {
|
|
21835
|
+
this.cachedInjectors.clear();
|
|
21836
|
+
}
|
|
21837
|
+
}
|
|
21838
|
+
}
|
|
21839
|
+
/** @nocollapse */
|
|
21840
|
+
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
21841
|
+
token: StandaloneService,
|
|
21842
|
+
providedIn: 'environment',
|
|
21843
|
+
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
21844
|
+
});
|
|
21845
|
+
/**
|
|
21846
|
+
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
21847
|
+
*
|
|
21848
|
+
* The most important responsibility of this feature is to expose the "getStandaloneInjector"
|
|
21849
|
+
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
21850
|
+
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
21851
|
+
* is tree-shakable and not included in applications that don't use standalone components.
|
|
21852
|
+
*
|
|
21853
|
+
* @codeGenApi
|
|
21854
|
+
*/
|
|
21855
|
+
function ɵɵStandaloneFeature(definition) {
|
|
21856
|
+
definition.getStandaloneInjector = (parentInjector) => {
|
|
21857
|
+
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
|
|
21858
|
+
};
|
|
21859
|
+
}
|
|
21860
|
+
|
|
21861
|
+
/**
|
|
21862
|
+
* @license
|
|
21863
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21864
|
+
*
|
|
21865
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21866
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21867
|
+
*/
|
|
21868
|
+
/**
|
|
21869
|
+
* Retrieves the component instance associated with a given DOM element.
|
|
21870
|
+
*
|
|
21871
|
+
* @usageNotes
|
|
21872
|
+
* Given the following DOM structure:
|
|
21873
|
+
*
|
|
21874
|
+
* ```html
|
|
21875
|
+
* <app-root>
|
|
21876
|
+
* <div>
|
|
21877
|
+
* <child-comp></child-comp>
|
|
21878
|
+
* </div>
|
|
21879
|
+
* </app-root>
|
|
21880
|
+
* ```
|
|
21881
|
+
*
|
|
21882
|
+
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
21883
|
+
* associated with this DOM element.
|
|
21884
|
+
*
|
|
21885
|
+
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
21886
|
+
*
|
|
21887
|
+
*
|
|
21888
|
+
* @param element DOM element from which the component should be retrieved.
|
|
21889
|
+
* @returns Component instance associated with the element or `null` if there
|
|
21890
|
+
* is no component associated with it.
|
|
21891
|
+
*
|
|
21892
|
+
* @publicApi
|
|
21893
|
+
* @globalApi ng
|
|
21894
|
+
*/
|
|
21895
|
+
function getComponent(element) {
|
|
21896
|
+
ngDevMode && assertDomElement(element);
|
|
21897
|
+
const context = getLContext(element);
|
|
21898
|
+
if (context === null)
|
|
21899
|
+
return null;
|
|
21900
|
+
if (context.component === undefined) {
|
|
21901
|
+
const lView = context.lView;
|
|
21902
|
+
if (lView === null) {
|
|
21903
|
+
return null;
|
|
21904
|
+
}
|
|
21905
|
+
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
21906
|
+
}
|
|
21907
|
+
return context.component;
|
|
21908
|
+
}
|
|
21909
|
+
/**
|
|
21910
|
+
* If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
|
|
21911
|
+
* view that the element is part of. Otherwise retrieves the instance of the component whose view
|
|
21912
|
+
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
21913
|
+
*
|
|
21914
|
+
* @param element Element for which to get the surrounding component instance.
|
|
21915
|
+
* @returns Instance of the component that is around the element or null if the element isn't
|
|
21916
|
+
* inside any component.
|
|
21917
|
+
*
|
|
21918
|
+
* @publicApi
|
|
21919
|
+
* @globalApi ng
|
|
21920
|
+
*/
|
|
21921
|
+
function getContext(element) {
|
|
21922
|
+
assertDomElement(element);
|
|
21923
|
+
const context = getLContext(element);
|
|
21924
|
+
const lView = context ? context.lView : null;
|
|
21925
|
+
return lView === null ? null : lView[CONTEXT];
|
|
21926
|
+
}
|
|
21927
|
+
/**
|
|
21928
|
+
* Retrieves the component instance whose view contains the DOM element.
|
|
21929
|
+
*
|
|
21930
|
+
* For example, if `<child-comp>` is used in the template of `<app-comp>`
|
|
21931
|
+
* (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
|
|
21932
|
+
* would return `<app-comp>`.
|
|
21933
|
+
*
|
|
21934
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21935
|
+
* for which to retrieve the root components.
|
|
21936
|
+
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
21937
|
+
* part of a component view.
|
|
21938
|
+
*
|
|
21939
|
+
* @publicApi
|
|
21940
|
+
* @globalApi ng
|
|
21941
|
+
*/
|
|
21942
|
+
function getOwningComponent(elementOrDir) {
|
|
21943
|
+
const context = getLContext(elementOrDir);
|
|
21944
|
+
let lView = context ? context.lView : null;
|
|
21945
|
+
if (lView === null)
|
|
21946
|
+
return null;
|
|
21947
|
+
let parent;
|
|
21948
|
+
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
21949
|
+
lView = parent;
|
|
21950
|
+
}
|
|
21951
|
+
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
21952
|
+
}
|
|
21953
|
+
/**
|
|
21954
|
+
* Retrieves all root components associated with a DOM element, directive or component instance.
|
|
21955
|
+
* Root components are those which have been bootstrapped by Angular.
|
|
21956
|
+
*
|
|
21957
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21958
|
+
* for which to retrieve the root components.
|
|
21959
|
+
* @returns Root components associated with the target object.
|
|
21960
|
+
*
|
|
21961
|
+
* @publicApi
|
|
21962
|
+
* @globalApi ng
|
|
21963
|
+
*/
|
|
21964
|
+
function getRootComponents(elementOrDir) {
|
|
21965
|
+
const lView = readPatchedLView(elementOrDir);
|
|
21966
|
+
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
21967
|
+
}
|
|
21968
|
+
/**
|
|
21969
|
+
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
21970
|
+
*
|
|
21971
|
+
* @param elementOrDir DOM element, component or directive instance for which to
|
|
21972
|
+
* retrieve the injector.
|
|
21973
|
+
* @returns Injector associated with the element, component or directive instance.
|
|
21974
|
+
*
|
|
21975
|
+
* @publicApi
|
|
21976
|
+
* @globalApi ng
|
|
21977
|
+
*/
|
|
21978
|
+
function getInjector(elementOrDir) {
|
|
21979
|
+
const context = getLContext(elementOrDir);
|
|
21980
|
+
const lView = context ? context.lView : null;
|
|
21981
|
+
if (lView === null)
|
|
21982
|
+
return Injector.NULL;
|
|
21983
|
+
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
21984
|
+
return new NodeInjector(tNode, lView);
|
|
21985
|
+
}
|
|
22295
21986
|
/**
|
|
22296
|
-
*
|
|
22297
|
-
* ComponentFactoryResolver
|
|
22298
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21987
|
+
* Retrieve a set of injection tokens at a given DOM node.
|
|
22299
21988
|
*
|
|
22300
|
-
* @
|
|
21989
|
+
* @param element Element for which the injection tokens should be retrieved.
|
|
22301
21990
|
*/
|
|
22302
|
-
function
|
|
22303
|
-
|
|
21991
|
+
function getInjectionTokens(element) {
|
|
21992
|
+
const context = getLContext(element);
|
|
21993
|
+
const lView = context ? context.lView : null;
|
|
21994
|
+
if (lView === null)
|
|
21995
|
+
return [];
|
|
21996
|
+
const tView = lView[TVIEW];
|
|
21997
|
+
const tNode = tView.data[context.nodeIndex];
|
|
21998
|
+
const providerTokens = [];
|
|
21999
|
+
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
22000
|
+
const endIndex = tNode.directiveEnd;
|
|
22001
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
22002
|
+
let value = tView.data[i];
|
|
22003
|
+
if (isDirectiveDefHack(value)) {
|
|
22004
|
+
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
22005
|
+
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
22006
|
+
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
22007
|
+
// is that we should always be storing injectable type in this location.
|
|
22008
|
+
value = value.type;
|
|
22009
|
+
}
|
|
22010
|
+
providerTokens.push(value);
|
|
22011
|
+
}
|
|
22012
|
+
return providerTokens;
|
|
22304
22013
|
}
|
|
22305
22014
|
/**
|
|
22306
|
-
*
|
|
22015
|
+
* Retrieves directive instances associated with a given DOM node. Does not include
|
|
22016
|
+
* component instances.
|
|
22307
22017
|
*
|
|
22308
|
-
*
|
|
22309
|
-
*
|
|
22310
|
-
*
|
|
22018
|
+
* @usageNotes
|
|
22019
|
+
* Given the following DOM structure:
|
|
22020
|
+
*
|
|
22021
|
+
* ```html
|
|
22022
|
+
* <app-root>
|
|
22023
|
+
* <button my-button></button>
|
|
22024
|
+
* <my-comp></my-comp>
|
|
22025
|
+
* </app-root>
|
|
22026
|
+
* ```
|
|
22027
|
+
*
|
|
22028
|
+
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
22029
|
+
* directive that is associated with the DOM node.
|
|
22030
|
+
*
|
|
22031
|
+
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
22032
|
+
*
|
|
22033
|
+
* @param node DOM node for which to get the directives.
|
|
22034
|
+
* @returns Array of directives associated with the node.
|
|
22311
22035
|
*
|
|
22036
|
+
* @publicApi
|
|
22037
|
+
* @globalApi ng
|
|
22312
22038
|
*/
|
|
22313
|
-
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
|
|
22317
|
-
this._rootLView = _rootLView;
|
|
22318
|
-
this._tNode = _tNode;
|
|
22319
|
-
this.instance = instance;
|
|
22320
|
-
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
22321
|
-
this.componentType = componentType;
|
|
22039
|
+
function getDirectives(node) {
|
|
22040
|
+
// Skip text nodes because we can't have directives associated with them.
|
|
22041
|
+
if (node instanceof Text) {
|
|
22042
|
+
return [];
|
|
22322
22043
|
}
|
|
22323
|
-
|
|
22324
|
-
|
|
22044
|
+
const context = getLContext(node);
|
|
22045
|
+
const lView = context ? context.lView : null;
|
|
22046
|
+
if (lView === null) {
|
|
22047
|
+
return [];
|
|
22325
22048
|
}
|
|
22326
|
-
|
|
22327
|
-
|
|
22049
|
+
const tView = lView[TVIEW];
|
|
22050
|
+
const nodeIndex = context.nodeIndex;
|
|
22051
|
+
if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
|
|
22052
|
+
return [];
|
|
22328
22053
|
}
|
|
22329
|
-
|
|
22330
|
-
|
|
22054
|
+
if (context.directives === undefined) {
|
|
22055
|
+
context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
|
|
22331
22056
|
}
|
|
22057
|
+
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
22058
|
+
// result so we don't expose an internal data structure in the user's console.
|
|
22059
|
+
return context.directives === null ? [] : [...context.directives];
|
|
22332
22060
|
}
|
|
22333
|
-
|
|
22334
22061
|
/**
|
|
22335
|
-
*
|
|
22336
|
-
*
|
|
22062
|
+
* Returns the debug (partial) metadata for a particular directive or component instance.
|
|
22063
|
+
* The function accepts an instance of a directive or component and returns the corresponding
|
|
22064
|
+
* metadata.
|
|
22065
|
+
*
|
|
22066
|
+
* @param directiveOrComponentInstance Instance of a directive or component
|
|
22067
|
+
* @returns metadata of the passed directive or component
|
|
22337
22068
|
*
|
|
22338
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
22339
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22340
|
-
*/
|
|
22341
|
-
/**
|
|
22342
|
-
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
22343
|
-
* @param ngModule NgModule class.
|
|
22344
|
-
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
22345
|
-
* not provided, `NullInjector` will be used instead.
|
|
22346
22069
|
* @publicApi
|
|
22070
|
+
* @globalApi ng
|
|
22347
22071
|
*/
|
|
22348
|
-
function
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
22352
|
-
constructor(ngModuleType, _parent) {
|
|
22353
|
-
super();
|
|
22354
|
-
this._parent = _parent;
|
|
22355
|
-
// tslint:disable-next-line:require-internal-with-underscore
|
|
22356
|
-
this._bootstrapComponents = [];
|
|
22357
|
-
this.injector = this;
|
|
22358
|
-
this.destroyCbs = [];
|
|
22359
|
-
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
22360
|
-
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
22361
|
-
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
22362
|
-
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
22363
|
-
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
22364
|
-
// and providing it, rather than letting the injector resolve it.
|
|
22365
|
-
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
22366
|
-
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
22367
|
-
ngDevMode &&
|
|
22368
|
-
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
22369
|
-
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
22370
|
-
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
22371
|
-
{ provide: NgModuleRef$1, useValue: this }, {
|
|
22372
|
-
provide: ComponentFactoryResolver$1,
|
|
22373
|
-
useValue: this.componentFactoryResolver
|
|
22374
|
-
}
|
|
22375
|
-
], stringify(ngModuleType), new Set(['environment']));
|
|
22376
|
-
// We need to resolve the injector types separately from the injector creation, because
|
|
22377
|
-
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
22378
|
-
// circular error that will eventually error out, because the injector isn't created yet.
|
|
22379
|
-
this._r3Injector.resolveInjectorInitializers();
|
|
22380
|
-
this.instance = this.get(ngModuleType);
|
|
22381
|
-
}
|
|
22382
|
-
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
22383
|
-
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
22384
|
-
return this;
|
|
22385
|
-
}
|
|
22386
|
-
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
22072
|
+
function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
22073
|
+
const { constructor } = directiveOrComponentInstance;
|
|
22074
|
+
if (!constructor) {
|
|
22075
|
+
throw new Error('Unable to find the instance constructor');
|
|
22387
22076
|
}
|
|
22388
|
-
|
|
22389
|
-
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
|
|
22077
|
+
// In case a component inherits from a directive, we may have component and directive metadata
|
|
22078
|
+
// To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
|
|
22079
|
+
const componentDef = getComponentDef(constructor);
|
|
22080
|
+
if (componentDef) {
|
|
22081
|
+
return {
|
|
22082
|
+
inputs: componentDef.inputs,
|
|
22083
|
+
outputs: componentDef.outputs,
|
|
22084
|
+
encapsulation: componentDef.encapsulation,
|
|
22085
|
+
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
|
|
22086
|
+
ChangeDetectionStrategy.Default
|
|
22087
|
+
};
|
|
22394
22088
|
}
|
|
22395
|
-
|
|
22396
|
-
|
|
22397
|
-
|
|
22089
|
+
const directiveDef = getDirectiveDef(constructor);
|
|
22090
|
+
if (directiveDef) {
|
|
22091
|
+
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
22398
22092
|
}
|
|
22093
|
+
return null;
|
|
22399
22094
|
}
|
|
22400
|
-
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22095
|
+
/**
|
|
22096
|
+
* Retrieve map of local references.
|
|
22097
|
+
*
|
|
22098
|
+
* The references are retrieved as a map of local reference name to element or directive instance.
|
|
22099
|
+
*
|
|
22100
|
+
* @param target DOM element, component or directive instance for which to retrieve
|
|
22101
|
+
* the local references.
|
|
22102
|
+
*/
|
|
22103
|
+
function getLocalRefs(target) {
|
|
22104
|
+
const context = getLContext(target);
|
|
22105
|
+
if (context === null)
|
|
22106
|
+
return {};
|
|
22107
|
+
if (context.localRefs === undefined) {
|
|
22108
|
+
const lView = context.lView;
|
|
22109
|
+
if (lView === null) {
|
|
22110
|
+
return {};
|
|
22111
|
+
}
|
|
22112
|
+
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
22407
22113
|
}
|
|
22114
|
+
return context.localRefs || {};
|
|
22408
22115
|
}
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22412
|
-
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
|
|
22420
|
-
|
|
22421
|
-
|
|
22422
|
-
destroy() {
|
|
22423
|
-
this.injector.destroy();
|
|
22424
|
-
}
|
|
22425
|
-
onDestroy(callback) {
|
|
22426
|
-
this.injector.onDestroy(callback);
|
|
22427
|
-
}
|
|
22116
|
+
/**
|
|
22117
|
+
* Retrieves the host element of a component or directive instance.
|
|
22118
|
+
* The host element is the DOM element that matched the selector of the directive.
|
|
22119
|
+
*
|
|
22120
|
+
* @param componentOrDirective Component or directive instance for which the host
|
|
22121
|
+
* element should be retrieved.
|
|
22122
|
+
* @returns Host element of the target.
|
|
22123
|
+
*
|
|
22124
|
+
* @publicApi
|
|
22125
|
+
* @globalApi ng
|
|
22126
|
+
*/
|
|
22127
|
+
function getHostElement(componentOrDirective) {
|
|
22128
|
+
return getLContext(componentOrDirective).native;
|
|
22428
22129
|
}
|
|
22429
22130
|
/**
|
|
22430
|
-
*
|
|
22131
|
+
* Retrieves the rendered text for a given component.
|
|
22132
|
+
*
|
|
22133
|
+
* This function retrieves the host element of a component and
|
|
22134
|
+
* and then returns the `textContent` for that element. This implies
|
|
22135
|
+
* that the text returned will include re-projected content of
|
|
22136
|
+
* the component as well.
|
|
22137
|
+
*
|
|
22138
|
+
* @param component The component to return the content text for.
|
|
22139
|
+
*/
|
|
22140
|
+
function getRenderedText(component) {
|
|
22141
|
+
const hostElement = getHostElement(component);
|
|
22142
|
+
return hostElement.textContent || '';
|
|
22143
|
+
}
|
|
22144
|
+
/**
|
|
22145
|
+
* Retrieves a list of event listeners associated with a DOM element. The list does include host
|
|
22146
|
+
* listeners, but it does not include event listeners defined outside of the Angular context
|
|
22147
|
+
* (e.g. through `addEventListener`).
|
|
22148
|
+
*
|
|
22149
|
+
* @usageNotes
|
|
22150
|
+
* Given the following DOM structure:
|
|
22151
|
+
*
|
|
22152
|
+
* ```html
|
|
22153
|
+
* <app-root>
|
|
22154
|
+
* <div (click)="doSomething()"></div>
|
|
22155
|
+
* </app-root>
|
|
22156
|
+
* ```
|
|
22431
22157
|
*
|
|
22432
|
-
*
|
|
22433
|
-
* [this guide](guide/standalone-components#environment-injectors).
|
|
22158
|
+
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
22434
22159
|
*
|
|
22435
|
-
*
|
|
22436
|
-
*
|
|
22437
|
-
*
|
|
22438
|
-
*
|
|
22160
|
+
* ```ts
|
|
22161
|
+
* {
|
|
22162
|
+
* name: 'click',
|
|
22163
|
+
* element: <div>,
|
|
22164
|
+
* callback: () => doSomething(),
|
|
22165
|
+
* useCapture: false
|
|
22166
|
+
* }
|
|
22167
|
+
* ```
|
|
22168
|
+
*
|
|
22169
|
+
* @param element Element for which the DOM listeners should be retrieved.
|
|
22170
|
+
* @returns Array of event listeners on the DOM element.
|
|
22439
22171
|
*
|
|
22440
22172
|
* @publicApi
|
|
22441
|
-
* @
|
|
22173
|
+
* @globalApi ng
|
|
22442
22174
|
*/
|
|
22443
|
-
function
|
|
22444
|
-
|
|
22445
|
-
|
|
22175
|
+
function getListeners(element) {
|
|
22176
|
+
ngDevMode && assertDomElement(element);
|
|
22177
|
+
const lContext = getLContext(element);
|
|
22178
|
+
const lView = lContext === null ? null : lContext.lView;
|
|
22179
|
+
if (lView === null)
|
|
22180
|
+
return [];
|
|
22181
|
+
const tView = lView[TVIEW];
|
|
22182
|
+
const lCleanup = lView[CLEANUP];
|
|
22183
|
+
const tCleanup = tView.cleanup;
|
|
22184
|
+
const listeners = [];
|
|
22185
|
+
if (tCleanup && lCleanup) {
|
|
22186
|
+
for (let i = 0; i < tCleanup.length;) {
|
|
22187
|
+
const firstParam = tCleanup[i++];
|
|
22188
|
+
const secondParam = tCleanup[i++];
|
|
22189
|
+
if (typeof firstParam === 'string') {
|
|
22190
|
+
const name = firstParam;
|
|
22191
|
+
const listenerElement = unwrapRNode(lView[secondParam]);
|
|
22192
|
+
const callback = lCleanup[tCleanup[i++]];
|
|
22193
|
+
const useCaptureOrIndx = tCleanup[i++];
|
|
22194
|
+
// if useCaptureOrIndx is boolean then report it as is.
|
|
22195
|
+
// if useCaptureOrIndx is positive number then it in unsubscribe method
|
|
22196
|
+
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
22197
|
+
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
22198
|
+
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
22199
|
+
if (element == listenerElement) {
|
|
22200
|
+
listeners.push({ element, name, callback, useCapture, type });
|
|
22201
|
+
}
|
|
22202
|
+
}
|
|
22203
|
+
}
|
|
22204
|
+
}
|
|
22205
|
+
listeners.sort(sortListeners);
|
|
22206
|
+
return listeners;
|
|
22207
|
+
}
|
|
22208
|
+
function sortListeners(a, b) {
|
|
22209
|
+
if (a.name == b.name)
|
|
22210
|
+
return 0;
|
|
22211
|
+
return a.name < b.name ? -1 : 1;
|
|
22446
22212
|
}
|
|
22447
|
-
|
|
22448
22213
|
/**
|
|
22449
|
-
*
|
|
22450
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22214
|
+
* This function should not exist because it is megamorphic and only mostly correct.
|
|
22451
22215
|
*
|
|
22452
|
-
*
|
|
22453
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22216
|
+
* See call site for more info.
|
|
22454
22217
|
*/
|
|
22218
|
+
function isDirectiveDefHack(obj) {
|
|
22219
|
+
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22220
|
+
}
|
|
22455
22221
|
/**
|
|
22456
|
-
*
|
|
22457
|
-
*
|
|
22458
|
-
*
|
|
22222
|
+
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22223
|
+
*
|
|
22224
|
+
* @param element DOM element which is owned by an existing component's view.
|
|
22459
22225
|
*/
|
|
22460
|
-
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
this.cachedInjectors = new Map();
|
|
22226
|
+
function getDebugNode$1(element) {
|
|
22227
|
+
if (ngDevMode && !(element instanceof Node)) {
|
|
22228
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22464
22229
|
}
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
22470
|
-
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
22471
|
-
const standaloneInjector = providers.length > 0 ?
|
|
22472
|
-
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22473
|
-
null;
|
|
22474
|
-
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
22475
|
-
}
|
|
22476
|
-
return this.cachedInjectors.get(componentDef.id);
|
|
22230
|
+
const lContext = getLContext(element);
|
|
22231
|
+
const lView = lContext ? lContext.lView : null;
|
|
22232
|
+
if (lView === null) {
|
|
22233
|
+
return null;
|
|
22477
22234
|
}
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
this.cachedInjectors.clear();
|
|
22488
|
-
}
|
|
22235
|
+
const nodeIndex = lContext.nodeIndex;
|
|
22236
|
+
if (nodeIndex !== -1) {
|
|
22237
|
+
const valueInLView = lView[nodeIndex];
|
|
22238
|
+
// this means that value in the lView is a component with its own
|
|
22239
|
+
// data. In this situation the TNode is not accessed at the same spot.
|
|
22240
|
+
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22241
|
+
ngDevMode &&
|
|
22242
|
+
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22243
|
+
return buildDebugNode(tNode, lView);
|
|
22489
22244
|
}
|
|
22245
|
+
return null;
|
|
22490
22246
|
}
|
|
22491
|
-
/** @nocollapse */
|
|
22492
|
-
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22493
|
-
token: StandaloneService,
|
|
22494
|
-
providedIn: 'environment',
|
|
22495
|
-
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22496
|
-
});
|
|
22497
22247
|
/**
|
|
22498
|
-
*
|
|
22248
|
+
* Retrieve the component `LView` from component/element.
|
|
22499
22249
|
*
|
|
22500
|
-
*
|
|
22501
|
-
*
|
|
22502
|
-
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
22503
|
-
* is tree-shakable and not included in applications that don't use standalone components.
|
|
22250
|
+
* NOTE: `LView` is a private and should not be leaked outside.
|
|
22251
|
+
* Don't export this method to `ng.*` on window.
|
|
22504
22252
|
*
|
|
22505
|
-
* @
|
|
22253
|
+
* @param target DOM element or component instance for which to retrieve the LView.
|
|
22506
22254
|
*/
|
|
22507
|
-
function
|
|
22508
|
-
|
|
22509
|
-
|
|
22510
|
-
|
|
22255
|
+
function getComponentLView(target) {
|
|
22256
|
+
const lContext = getLContext(target);
|
|
22257
|
+
const nodeIndx = lContext.nodeIndex;
|
|
22258
|
+
const lView = lContext.lView;
|
|
22259
|
+
ngDevMode && assertLView(lView);
|
|
22260
|
+
const componentLView = lView[nodeIndx];
|
|
22261
|
+
ngDevMode && assertLView(componentLView);
|
|
22262
|
+
return componentLView;
|
|
22263
|
+
}
|
|
22264
|
+
/** Asserts that a value is a DOM Element. */
|
|
22265
|
+
function assertDomElement(value) {
|
|
22266
|
+
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
22267
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22268
|
+
}
|
|
22511
22269
|
}
|
|
22512
22270
|
|
|
22513
22271
|
/**
|
|
@@ -23549,7 +23307,7 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
23549
23307
|
// so that a component can use DI tokens provided in MgModules. For this reason, we can not
|
|
23550
23308
|
// rely on the provided injector, since it might be detached from the DI tree (for example, if
|
|
23551
23309
|
// it was created via `Injector.create` without specifying a parent injector, or if an
|
|
23552
|
-
// injector is retrieved from an `NgModuleRef` created via `
|
|
23310
|
+
// injector is retrieved from an `NgModuleRef` created via `createNgModule` using an
|
|
23553
23311
|
// NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent
|
|
23554
23312
|
// injector, which is normally connected to the DI tree, which includes module injector
|
|
23555
23313
|
// subtree.
|
|
@@ -23728,7 +23486,7 @@ const unusedValueExportToPlacateAjd = 1;
|
|
|
23728
23486
|
* Use of this source code is governed by an MIT-style license that can be
|
|
23729
23487
|
* found in the LICENSE file at https://angular.io/license
|
|
23730
23488
|
*/
|
|
23731
|
-
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$
|
|
23489
|
+
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
|
|
23732
23490
|
class LQuery_ {
|
|
23733
23491
|
constructor(queryList) {
|
|
23734
23492
|
this.queryList = queryList;
|
|
@@ -26150,6 +25908,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
|
26150
25908
|
class CompilerFactory {
|
|
26151
25909
|
}
|
|
26152
25910
|
|
|
25911
|
+
/**
|
|
25912
|
+
* @license
|
|
25913
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25914
|
+
*
|
|
25915
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25916
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25917
|
+
*/
|
|
25918
|
+
/**
|
|
25919
|
+
* Marks a component for check (in case of OnPush components) and synchronously
|
|
25920
|
+
* performs change detection on the application this component belongs to.
|
|
25921
|
+
*
|
|
25922
|
+
* @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
|
|
25923
|
+
*
|
|
25924
|
+
* @publicApi
|
|
25925
|
+
* @globalApi ng
|
|
25926
|
+
*/
|
|
25927
|
+
function applyChanges(component) {
|
|
25928
|
+
markDirty(component);
|
|
25929
|
+
getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
|
|
25930
|
+
}
|
|
25931
|
+
|
|
25932
|
+
/**
|
|
25933
|
+
* @license
|
|
25934
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25935
|
+
*
|
|
25936
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25937
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25938
|
+
*/
|
|
25939
|
+
/**
|
|
25940
|
+
* This file introduces series of globally accessible debug tools
|
|
25941
|
+
* to allow for the Angular debugging story to function.
|
|
25942
|
+
*
|
|
25943
|
+
* To see this in action run the following command:
|
|
25944
|
+
*
|
|
25945
|
+
* bazel run //packages/core/test/bundling/todo:devserver
|
|
25946
|
+
*
|
|
25947
|
+
* Then load `localhost:5432` and start using the console tools.
|
|
25948
|
+
*/
|
|
25949
|
+
/**
|
|
25950
|
+
* This value reflects the property on the window where the dev
|
|
25951
|
+
* tools are patched (window.ng).
|
|
25952
|
+
* */
|
|
25953
|
+
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
25954
|
+
let _published = false;
|
|
25955
|
+
/**
|
|
25956
|
+
* Publishes a collection of default debug tools onto`window.ng`.
|
|
25957
|
+
*
|
|
25958
|
+
* These functions are available globally when Angular is in development
|
|
25959
|
+
* mode and are automatically stripped away from prod mode is on.
|
|
25960
|
+
*/
|
|
25961
|
+
function publishDefaultGlobalUtils$1() {
|
|
25962
|
+
if (!_published) {
|
|
25963
|
+
_published = true;
|
|
25964
|
+
/**
|
|
25965
|
+
* Warning: this function is *INTERNAL* and should not be relied upon in application's code.
|
|
25966
|
+
* The contract of the function might be changed in any release and/or the function can be
|
|
25967
|
+
* removed completely.
|
|
25968
|
+
*/
|
|
25969
|
+
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
25970
|
+
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
25971
|
+
publishGlobalUtil('getComponent', getComponent);
|
|
25972
|
+
publishGlobalUtil('getContext', getContext);
|
|
25973
|
+
publishGlobalUtil('getListeners', getListeners);
|
|
25974
|
+
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
25975
|
+
publishGlobalUtil('getHostElement', getHostElement);
|
|
25976
|
+
publishGlobalUtil('getInjector', getInjector);
|
|
25977
|
+
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
25978
|
+
publishGlobalUtil('getDirectives', getDirectives);
|
|
25979
|
+
publishGlobalUtil('applyChanges', applyChanges);
|
|
25980
|
+
}
|
|
25981
|
+
}
|
|
25982
|
+
/**
|
|
25983
|
+
* Publishes the given function to `window.ng` so that it can be
|
|
25984
|
+
* used from the browser console when an application is not in production.
|
|
25985
|
+
*/
|
|
25986
|
+
function publishGlobalUtil(name, fn) {
|
|
25987
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
|
25988
|
+
// Note: we can't export `ng` when using closure enhanced optimization as:
|
|
25989
|
+
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
25990
|
+
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
25991
|
+
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
25992
|
+
const w = _global;
|
|
25993
|
+
ngDevMode && assertDefined(fn, 'function not defined');
|
|
25994
|
+
if (w) {
|
|
25995
|
+
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
25996
|
+
if (!container) {
|
|
25997
|
+
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
25998
|
+
}
|
|
25999
|
+
container[name] = fn;
|
|
26000
|
+
}
|
|
26001
|
+
}
|
|
26002
|
+
}
|
|
26003
|
+
|
|
26153
26004
|
/**
|
|
26154
26005
|
* @license
|
|
26155
26006
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -26305,12 +26156,16 @@ class NgZone {
|
|
|
26305
26156
|
*/
|
|
26306
26157
|
this.onError = new EventEmitter(false);
|
|
26307
26158
|
if (typeof Zone == 'undefined') {
|
|
26308
|
-
throw new
|
|
26159
|
+
throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
|
|
26309
26160
|
}
|
|
26310
26161
|
Zone.assertZonePatched();
|
|
26311
26162
|
const self = this;
|
|
26312
26163
|
self._nesting = 0;
|
|
26313
26164
|
self._outer = self._inner = Zone.current;
|
|
26165
|
+
if (Zone['AsyncStackTaggingZoneSpec']) {
|
|
26166
|
+
const AsyncStackTaggingZoneSpec = Zone['AsyncStackTaggingZoneSpec'];
|
|
26167
|
+
self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));
|
|
26168
|
+
}
|
|
26314
26169
|
if (Zone['TaskTrackingZoneSpec']) {
|
|
26315
26170
|
self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']);
|
|
26316
26171
|
}
|
|
@@ -26332,12 +26187,12 @@ class NgZone {
|
|
|
26332
26187
|
}
|
|
26333
26188
|
static assertInAngularZone() {
|
|
26334
26189
|
if (!NgZone.isInAngularZone()) {
|
|
26335
|
-
throw new
|
|
26190
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
|
|
26336
26191
|
}
|
|
26337
26192
|
}
|
|
26338
26193
|
static assertNotInAngularZone() {
|
|
26339
26194
|
if (NgZone.isInAngularZone()) {
|
|
26340
|
-
throw new
|
|
26195
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
|
|
26341
26196
|
}
|
|
26342
26197
|
}
|
|
26343
26198
|
/**
|
|
@@ -26908,7 +26763,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
|
26908
26763
|
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26909
26764
|
* entire class tree-shakeable.
|
|
26910
26765
|
*/
|
|
26911
|
-
const
|
|
26766
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
26912
26767
|
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26913
26768
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26914
26769
|
ngDevMode && assertNgModuleType(moduleType);
|
|
@@ -27047,7 +26902,15 @@ function internalBootstrapApplication(config) {
|
|
|
27047
26902
|
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
27048
26903
|
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
27049
26904
|
const appRef = appInjector.get(ApplicationRef);
|
|
27050
|
-
|
|
26905
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
26906
|
+
// for all bootstrapped applications as well.
|
|
26907
|
+
const destroyListener = () => appRef.destroy();
|
|
26908
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
26909
|
+
onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.add(destroyListener);
|
|
26910
|
+
appRef.onDestroy(() => {
|
|
26911
|
+
onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.delete(destroyListener);
|
|
26912
|
+
onErrorSubscription.unsubscribe();
|
|
26913
|
+
});
|
|
27051
26914
|
appRef.bootstrap(rootComponent);
|
|
27052
26915
|
return appRef;
|
|
27053
26916
|
});
|
|
@@ -27111,7 +26974,7 @@ function createPlatformInjector(providers = [], name) {
|
|
|
27111
26974
|
name,
|
|
27112
26975
|
providers: [
|
|
27113
26976
|
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
27114
|
-
{ provide:
|
|
26977
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
27115
26978
|
...providers
|
|
27116
26979
|
],
|
|
27117
26980
|
});
|
|
@@ -27260,8 +27123,11 @@ class PlatformRef {
|
|
|
27260
27123
|
}
|
|
27261
27124
|
this._modules.slice().forEach(module => module.destroy());
|
|
27262
27125
|
this._destroyListeners.forEach(listener => listener());
|
|
27263
|
-
const
|
|
27264
|
-
|
|
27126
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27127
|
+
if (destroyListeners) {
|
|
27128
|
+
destroyListeners.forEach(listener => listener());
|
|
27129
|
+
destroyListeners.clear();
|
|
27130
|
+
}
|
|
27265
27131
|
this._destroyed = true;
|
|
27266
27132
|
}
|
|
27267
27133
|
/**
|
|
@@ -27421,11 +27287,10 @@ function optionsReducer(dst, objs) {
|
|
|
27421
27287
|
*/
|
|
27422
27288
|
class ApplicationRef {
|
|
27423
27289
|
/** @internal */
|
|
27424
|
-
constructor(_zone, _injector, _exceptionHandler
|
|
27290
|
+
constructor(_zone, _injector, _exceptionHandler) {
|
|
27425
27291
|
this._zone = _zone;
|
|
27426
27292
|
this._injector = _injector;
|
|
27427
27293
|
this._exceptionHandler = _exceptionHandler;
|
|
27428
|
-
this._initStatus = _initStatus;
|
|
27429
27294
|
/** @internal */
|
|
27430
27295
|
this._bootstrapListeners = [];
|
|
27431
27296
|
this._views = [];
|
|
@@ -27498,7 +27363,9 @@ class ApplicationRef {
|
|
|
27498
27363
|
get destroyed() {
|
|
27499
27364
|
return this._destroyed;
|
|
27500
27365
|
}
|
|
27501
|
-
/**
|
|
27366
|
+
/**
|
|
27367
|
+
* The `EnvironmentInjector` used to create this application.
|
|
27368
|
+
*/
|
|
27502
27369
|
get injector() {
|
|
27503
27370
|
return this._injector;
|
|
27504
27371
|
}
|
|
@@ -27542,7 +27409,8 @@ class ApplicationRef {
|
|
|
27542
27409
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27543
27410
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27544
27411
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
27545
|
-
|
|
27412
|
+
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
27413
|
+
if (!initStatus.done) {
|
|
27546
27414
|
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27547
27415
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27548
27416
|
(standalone ? '' :
|
|
@@ -27674,7 +27542,7 @@ class ApplicationRef {
|
|
|
27674
27542
|
}
|
|
27675
27543
|
/**
|
|
27676
27544
|
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
27677
|
-
* will destroy the associated
|
|
27545
|
+
* will destroy the associated environment injectors as well as all the bootstrapped components
|
|
27678
27546
|
* with their views.
|
|
27679
27547
|
*/
|
|
27680
27548
|
destroy() {
|
|
@@ -27701,13 +27569,13 @@ class ApplicationRef {
|
|
|
27701
27569
|
}
|
|
27702
27570
|
}
|
|
27703
27571
|
}
|
|
27704
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(
|
|
27572
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(EnvironmentInjector), ɵɵinject(ErrorHandler)); };
|
|
27705
27573
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
27706
27574
|
(function () {
|
|
27707
27575
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
27708
27576
|
type: Injectable,
|
|
27709
27577
|
args: [{ providedIn: 'root' }]
|
|
27710
|
-
}], function () { return [{ type: NgZone }, { type:
|
|
27578
|
+
}], function () { return [{ type: NgZone }, { type: EnvironmentInjector }, { type: ErrorHandler }]; }, null);
|
|
27711
27579
|
})();
|
|
27712
27580
|
function remove(list, el) {
|
|
27713
27581
|
const index = list.indexOf(el);
|
|
@@ -28055,7 +27923,7 @@ class DebugNode {
|
|
|
28055
27923
|
get componentInstance() {
|
|
28056
27924
|
const nativeElement = this.nativeNode;
|
|
28057
27925
|
return nativeElement &&
|
|
28058
|
-
(getComponent
|
|
27926
|
+
(getComponent(nativeElement) || getOwningComponent(nativeElement));
|
|
28059
27927
|
}
|
|
28060
27928
|
/**
|
|
28061
27929
|
* An object that provides parent context for this element. Often an ancestor component instance
|
|
@@ -28066,7 +27934,7 @@ class DebugNode {
|
|
|
28066
27934
|
* of heroes"`.
|
|
28067
27935
|
*/
|
|
28068
27936
|
get context() {
|
|
28069
|
-
return getComponent
|
|
27937
|
+
return getComponent(this.nativeNode) || getContext(this.nativeNode);
|
|
28070
27938
|
}
|
|
28071
27939
|
/**
|
|
28072
27940
|
* The callbacks attached to the component's @Output properties and/or the element's event
|
|
@@ -28404,10 +28272,9 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28404
28272
|
// Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple
|
|
28405
28273
|
// times. ViewEngine could do it more efficiently, because all the insertions go through
|
|
28406
28274
|
// Renderer2, however that's not the case in Ivy. This approach is being used because:
|
|
28407
|
-
// 1. Matching the ViewEngine behavior would mean potentially introducing a
|
|
28275
|
+
// 1. Matching the ViewEngine behavior would mean potentially introducing a dependency
|
|
28408
28276
|
// from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
|
|
28409
|
-
// 2.
|
|
28410
|
-
// 3. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28277
|
+
// 2. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28411
28278
|
nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
|
|
28412
28279
|
}
|
|
28413
28280
|
// In all cases, if a dynamic container exists for this node, each view inside it has to be
|
|
@@ -29879,5 +29746,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
29879
29746
|
* Generated bundle index. Do not edit.
|
|
29880
29747
|
*/
|
|
29881
29748
|
|
|
29882
|
-
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,
|
|
29749
|
+
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, createNgModule, 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 };
|
|
29883
29750
|
//# sourceMappingURL=core.mjs.map
|