@angular/core 14.1.0-next.1 → 14.1.0-next.4
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 +31 -35
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +3 -5
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +3 -5
- package/esm2020/src/change_detection/differs/iterable_differs.mjs +3 -5
- package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -5
- package/esm2020/src/core.mjs +1 -1
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +2 -3
- package/esm2020/src/di/index.mjs +1 -1
- package/esm2020/src/di/injector_compatibility.mjs +16 -16
- 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/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/inherit_definition_feature.mjs +3 -5
- package/esm2020/src/render3/index.mjs +3 -3
- 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/shared.mjs +22 -59
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -17
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/jit/directive.mjs +20 -3
- package/esm2020/src/render3/ng_module_ref.mjs +13 -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/render3/view_ref.mjs +3 -5
- package/esm2020/src/sanitization/sanitization.mjs +4 -9
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +5 -4
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/r3_test_bed_compiler.mjs +30 -25
- package/fesm2015/core.mjs +1871 -2015
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1601 -1837
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1871 -2015
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +1601 -1837
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +152 -134
- package/package.json +1 -1
- 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-next.
|
|
2
|
+
* @license Angular v14.1.0-next.4
|
|
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
|
}
|
|
@@ -4837,10 +4748,8 @@ function setCurrentInjector(injector) {
|
|
|
4837
4748
|
}
|
|
4838
4749
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4839
4750
|
if (_currentInjector === undefined) {
|
|
4840
|
-
|
|
4841
|
-
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`
|
|
4842
|
-
'';
|
|
4843
|
-
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4751
|
+
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
|
|
4752
|
+
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
|
|
4844
4753
|
}
|
|
4845
4754
|
else if (_currentInjector === null) {
|
|
4846
4755
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4856,22 +4765,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
|
|
|
4856
4765
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
4857
4766
|
* particular class.
|
|
4858
4767
|
*
|
|
4859
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
4860
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
4861
|
-
*
|
|
4862
4768
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
4863
4769
|
* and thus in the stack trace.
|
|
4864
4770
|
*
|
|
4865
4771
|
* @codeGenApi
|
|
4866
4772
|
*/
|
|
4867
4773
|
function ɵɵinvalidFactoryDep(index) {
|
|
4868
|
-
|
|
4774
|
+
throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
|
|
4869
4775
|
`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
|
|
4870
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.
|
|
4871
4777
|
|
|
4872
|
-
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
|
-
'invalid';
|
|
4874
|
-
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.`);
|
|
4875
4779
|
}
|
|
4876
4780
|
/**
|
|
4877
4781
|
* Injects a token from the currently active injector.
|
|
@@ -4938,6 +4842,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
4938
4842
|
* @publicApi
|
|
4939
4843
|
*/
|
|
4940
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
|
+
}
|
|
4941
4855
|
return ɵɵinject(token, flags);
|
|
4942
4856
|
}
|
|
4943
4857
|
function injectArgs(types) {
|
|
@@ -4946,10 +4860,7 @@ function injectArgs(types) {
|
|
|
4946
4860
|
const arg = resolveForwardRef(types[i]);
|
|
4947
4861
|
if (Array.isArray(arg)) {
|
|
4948
4862
|
if (arg.length === 0) {
|
|
4949
|
-
|
|
4950
|
-
'Arguments array must have arguments.' :
|
|
4951
|
-
'';
|
|
4952
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
4863
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
|
|
4953
4864
|
}
|
|
4954
4865
|
let type = undefined;
|
|
4955
4866
|
let flags = InjectFlags.Default;
|
|
@@ -5138,7 +5049,7 @@ function reflectDependency(dep) {
|
|
|
5138
5049
|
}
|
|
5139
5050
|
else if (param instanceof Attribute) {
|
|
5140
5051
|
if (param.attributeName === undefined) {
|
|
5141
|
-
throw new
|
|
5052
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
|
|
5142
5053
|
}
|
|
5143
5054
|
meta.attribute = param.attributeName;
|
|
5144
5055
|
}
|
|
@@ -5324,6 +5235,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5324
5235
|
checkForDuplicateNgModules = !allowDuplicates;
|
|
5325
5236
|
}
|
|
5326
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
|
+
|
|
5327
5293
|
/**
|
|
5328
5294
|
* @license
|
|
5329
5295
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6200,10 +6166,8 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
6200
6166
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
6201
6167
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6202
6168
|
}
|
|
6203
|
-
|
|
6204
|
-
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)'
|
|
6205
|
-
'';
|
|
6206
|
-
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
6169
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
|
|
6170
|
+
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
|
6207
6171
|
}
|
|
6208
6172
|
/**
|
|
6209
6173
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6225,10 +6189,7 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6225
6189
|
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
6226
6190
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6227
6191
|
}
|
|
6228
|
-
|
|
6229
|
-
'unsafe value used in a script context' :
|
|
6230
|
-
'';
|
|
6231
|
-
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6192
|
+
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
|
|
6232
6193
|
}
|
|
6233
6194
|
/**
|
|
6234
6195
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -7064,6 +7025,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
7064
7025
|
}
|
|
7065
7026
|
}
|
|
7066
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
|
+
|
|
7067
7039
|
/**
|
|
7068
7040
|
* @license
|
|
7069
7041
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7146,7 +7118,7 @@ function getNearestLContainer(viewOrContainer) {
|
|
|
7146
7118
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7147
7119
|
* found in the LICENSE file at https://angular.io/license
|
|
7148
7120
|
*/
|
|
7149
|
-
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$
|
|
7121
|
+
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
|
|
7150
7122
|
/**
|
|
7151
7123
|
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
7152
7124
|
* being passed as an argument.
|
|
@@ -7171,7 +7143,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7171
7143
|
lNodeToHandle = lNodeToHandle[HOST];
|
|
7172
7144
|
}
|
|
7173
7145
|
const rNode = unwrapRNode(lNodeToHandle);
|
|
7174
|
-
ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
|
|
7175
7146
|
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7176
7147
|
if (beforeNode == null) {
|
|
7177
7148
|
nativeAppendChild(renderer, parent, rNode);
|
|
@@ -7198,17 +7169,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7198
7169
|
function createTextNode(renderer, value) {
|
|
7199
7170
|
ngDevMode && ngDevMode.rendererCreateTextNode++;
|
|
7200
7171
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7201
|
-
return
|
|
7202
|
-
renderer.createTextNode(value);
|
|
7172
|
+
return renderer.createText(value);
|
|
7203
7173
|
}
|
|
7204
7174
|
function updateTextNode(renderer, rNode, value) {
|
|
7205
7175
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7206
|
-
|
|
7176
|
+
renderer.setValue(rNode, value);
|
|
7207
7177
|
}
|
|
7208
7178
|
function createCommentNode(renderer, value) {
|
|
7209
7179
|
ngDevMode && ngDevMode.rendererCreateComment++;
|
|
7210
|
-
// isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
|
|
7211
|
-
// method name.
|
|
7212
7180
|
return renderer.createComment(escapeCommentText(value));
|
|
7213
7181
|
}
|
|
7214
7182
|
/**
|
|
@@ -7220,14 +7188,7 @@ function createCommentNode(renderer, value) {
|
|
|
7220
7188
|
*/
|
|
7221
7189
|
function createElementNode(renderer, name, namespace) {
|
|
7222
7190
|
ngDevMode && ngDevMode.rendererCreateElement++;
|
|
7223
|
-
|
|
7224
|
-
return renderer.createElement(name, namespace);
|
|
7225
|
-
}
|
|
7226
|
-
else {
|
|
7227
|
-
const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
|
|
7228
|
-
return namespaceUri === null ? renderer.createElement(name) :
|
|
7229
|
-
renderer.createElementNS(namespaceUri, name);
|
|
7230
|
-
}
|
|
7191
|
+
return renderer.createElement(name, namespace);
|
|
7231
7192
|
}
|
|
7232
7193
|
/**
|
|
7233
7194
|
* Removes all DOM elements associated with a view.
|
|
@@ -7459,7 +7420,7 @@ function detachView(lContainer, removeIndex) {
|
|
|
7459
7420
|
function destroyLView(tView, lView) {
|
|
7460
7421
|
if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
|
|
7461
7422
|
const renderer = lView[RENDERER];
|
|
7462
|
-
if (
|
|
7423
|
+
if (renderer.destroyNode) {
|
|
7463
7424
|
applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
|
|
7464
7425
|
}
|
|
7465
7426
|
destroyViewTree(lView);
|
|
@@ -7487,7 +7448,7 @@ function cleanUpView(tView, lView) {
|
|
|
7487
7448
|
executeOnDestroys(tView, lView);
|
|
7488
7449
|
processCleanups(tView, lView);
|
|
7489
7450
|
// For component views only, the local renderer is destroyed at clean up time.
|
|
7490
|
-
if (lView[TVIEW].type === 1 /* TViewType.Component */
|
|
7451
|
+
if (lView[TVIEW].type === 1 /* TViewType.Component */) {
|
|
7491
7452
|
ngDevMode && ngDevMode.rendererDestroy++;
|
|
7492
7453
|
lView[RENDERER].destroy();
|
|
7493
7454
|
}
|
|
@@ -7663,30 +7624,17 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7663
7624
|
}
|
|
7664
7625
|
}
|
|
7665
7626
|
/**
|
|
7666
|
-
* Inserts a native node before another native node for a given parent
|
|
7667
|
-
* This is a utility function that can be used when native nodes were determined
|
|
7668
|
-
* 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.
|
|
7669
7629
|
*/
|
|
7670
7630
|
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7671
7631
|
ngDevMode && ngDevMode.rendererInsertBefore++;
|
|
7672
|
-
|
|
7673
|
-
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7674
|
-
}
|
|
7675
|
-
else {
|
|
7676
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7677
|
-
targetParent.insertBefore(child, beforeNode, isMove);
|
|
7678
|
-
}
|
|
7632
|
+
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7679
7633
|
}
|
|
7680
7634
|
function nativeAppendChild(renderer, parent, child) {
|
|
7681
7635
|
ngDevMode && ngDevMode.rendererAppendChild++;
|
|
7682
7636
|
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
7683
|
-
|
|
7684
|
-
renderer.appendChild(parent, child);
|
|
7685
|
-
}
|
|
7686
|
-
else {
|
|
7687
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7688
|
-
targetParent.appendChild(child);
|
|
7689
|
-
}
|
|
7637
|
+
renderer.appendChild(parent, child);
|
|
7690
7638
|
}
|
|
7691
7639
|
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7692
7640
|
if (beforeNode !== null) {
|
|
@@ -7698,12 +7646,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
|
|
|
7698
7646
|
}
|
|
7699
7647
|
/** Removes a node from the DOM given its native parent. */
|
|
7700
7648
|
function nativeRemoveChild(renderer, parent, child, isHostElement) {
|
|
7701
|
-
|
|
7702
|
-
renderer.removeChild(parent, child, isHostElement);
|
|
7703
|
-
}
|
|
7704
|
-
else {
|
|
7705
|
-
parent.removeChild(child);
|
|
7706
|
-
}
|
|
7649
|
+
renderer.removeChild(parent, child, isHostElement);
|
|
7707
7650
|
}
|
|
7708
7651
|
/** Checks if an element is a `<template>` node. */
|
|
7709
7652
|
function isTemplateNode(node) {
|
|
@@ -7713,13 +7656,13 @@ function isTemplateNode(node) {
|
|
|
7713
7656
|
* Returns a native parent of a given native node.
|
|
7714
7657
|
*/
|
|
7715
7658
|
function nativeParentNode(renderer, node) {
|
|
7716
|
-
return
|
|
7659
|
+
return renderer.parentNode(node);
|
|
7717
7660
|
}
|
|
7718
7661
|
/**
|
|
7719
7662
|
* Returns a native sibling of a given native node.
|
|
7720
7663
|
*/
|
|
7721
7664
|
function nativeNextSibling(renderer, node) {
|
|
7722
|
-
return
|
|
7665
|
+
return renderer.nextSibling(node);
|
|
7723
7666
|
}
|
|
7724
7667
|
/**
|
|
7725
7668
|
* Find a node in front of which `currentTNode` should be inserted.
|
|
@@ -8028,39 +7971,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
|
|
|
8028
7971
|
* otherwise).
|
|
8029
7972
|
*/
|
|
8030
7973
|
function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
8031
|
-
const isProcedural = isProceduralRenderer(renderer);
|
|
8032
7974
|
if (isClassBased) {
|
|
8033
7975
|
// We actually want JS true/false here because any truthy value should add the class
|
|
8034
7976
|
if (!value) {
|
|
8035
7977
|
ngDevMode && ngDevMode.rendererRemoveClass++;
|
|
8036
|
-
|
|
8037
|
-
renderer.removeClass(rNode, prop);
|
|
8038
|
-
}
|
|
8039
|
-
else {
|
|
8040
|
-
rNode.classList.remove(prop);
|
|
8041
|
-
}
|
|
7978
|
+
renderer.removeClass(rNode, prop);
|
|
8042
7979
|
}
|
|
8043
7980
|
else {
|
|
8044
7981
|
ngDevMode && ngDevMode.rendererAddClass++;
|
|
8045
|
-
|
|
8046
|
-
renderer.addClass(rNode, prop);
|
|
8047
|
-
}
|
|
8048
|
-
else {
|
|
8049
|
-
ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
|
|
8050
|
-
rNode.classList.add(prop);
|
|
8051
|
-
}
|
|
7982
|
+
renderer.addClass(rNode, prop);
|
|
8052
7983
|
}
|
|
8053
7984
|
}
|
|
8054
7985
|
else {
|
|
8055
7986
|
let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
|
|
8056
7987
|
if (value == null /** || value === undefined */) {
|
|
8057
7988
|
ngDevMode && ngDevMode.rendererRemoveStyle++;
|
|
8058
|
-
|
|
8059
|
-
renderer.removeStyle(rNode, prop, flags);
|
|
8060
|
-
}
|
|
8061
|
-
else {
|
|
8062
|
-
rNode.style.removeProperty(prop);
|
|
8063
|
-
}
|
|
7989
|
+
renderer.removeStyle(rNode, prop, flags);
|
|
8064
7990
|
}
|
|
8065
7991
|
else {
|
|
8066
7992
|
// A value is important if it ends with `!important`. The style
|
|
@@ -8072,13 +7998,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8072
7998
|
flags |= RendererStyleFlags2.Important;
|
|
8073
7999
|
}
|
|
8074
8000
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8075
|
-
|
|
8076
|
-
renderer.setStyle(rNode, prop, value, flags);
|
|
8077
|
-
}
|
|
8078
|
-
else {
|
|
8079
|
-
ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
|
|
8080
|
-
rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
|
|
8081
|
-
}
|
|
8001
|
+
renderer.setStyle(rNode, prop, value, flags);
|
|
8082
8002
|
}
|
|
8083
8003
|
}
|
|
8084
8004
|
}
|
|
@@ -8094,12 +8014,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8094
8014
|
*/
|
|
8095
8015
|
function writeDirectStyle(renderer, element, newValue) {
|
|
8096
8016
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8097
|
-
|
|
8098
|
-
renderer.setAttribute(element, 'style', newValue);
|
|
8099
|
-
}
|
|
8100
|
-
else {
|
|
8101
|
-
element.style.cssText = newValue;
|
|
8102
|
-
}
|
|
8017
|
+
renderer.setAttribute(element, 'style', newValue);
|
|
8103
8018
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8104
8019
|
}
|
|
8105
8020
|
/**
|
|
@@ -8114,17 +8029,12 @@ function writeDirectStyle(renderer, element, newValue) {
|
|
|
8114
8029
|
*/
|
|
8115
8030
|
function writeDirectClass(renderer, element, newValue) {
|
|
8116
8031
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8117
|
-
if (
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
renderer.removeAttribute(element, 'class');
|
|
8121
|
-
}
|
|
8122
|
-
else {
|
|
8123
|
-
renderer.setAttribute(element, 'class', newValue);
|
|
8124
|
-
}
|
|
8032
|
+
if (newValue === '') {
|
|
8033
|
+
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
8034
|
+
renderer.removeAttribute(element, 'class');
|
|
8125
8035
|
}
|
|
8126
8036
|
else {
|
|
8127
|
-
element
|
|
8037
|
+
renderer.setAttribute(element, 'class', newValue);
|
|
8128
8038
|
}
|
|
8129
8039
|
ngDevMode && ngDevMode.rendererSetClassName++;
|
|
8130
8040
|
}
|
|
@@ -8174,7 +8084,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
8174
8084
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8175
8085
|
* found in the LICENSE file at https://angular.io/license
|
|
8176
8086
|
*/
|
|
8177
|
-
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$
|
|
8087
|
+
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
|
|
8178
8088
|
const NG_TEMPLATE_SELECTOR = 'ng-template';
|
|
8179
8089
|
/**
|
|
8180
8090
|
* Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
|
|
@@ -9203,6 +9113,18 @@ class R3Injector extends EnvironmentInjector {
|
|
|
9203
9113
|
onDestroy(callback) {
|
|
9204
9114
|
this._onDestroyHooks.push(callback);
|
|
9205
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
|
+
}
|
|
9206
9128
|
get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
|
|
9207
9129
|
this.assertNotDestroyed();
|
|
9208
9130
|
// Set the injection context.
|
|
@@ -9814,7 +9736,7 @@ class ReflectiveKey {
|
|
|
9814
9736
|
this.token = token;
|
|
9815
9737
|
this.id = id;
|
|
9816
9738
|
if (!token) {
|
|
9817
|
-
throw new
|
|
9739
|
+
throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
|
|
9818
9740
|
}
|
|
9819
9741
|
this.displayName = stringify(this.token);
|
|
9820
9742
|
}
|
|
@@ -10618,6 +10540,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
|
|
|
10618
10540
|
`the ${schemas} of this component.`;
|
|
10619
10541
|
}
|
|
10620
10542
|
}
|
|
10543
|
+
reportUnknownPropertyError(message);
|
|
10544
|
+
}
|
|
10545
|
+
function reportUnknownPropertyError(message) {
|
|
10621
10546
|
if (shouldThrowErrorOnUnknownProperty) {
|
|
10622
10547
|
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
10623
10548
|
}
|
|
@@ -11505,6 +11430,13 @@ class LContainerDebug {
|
|
|
11505
11430
|
}
|
|
11506
11431
|
}
|
|
11507
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
|
+
*/
|
|
11508
11440
|
/**
|
|
11509
11441
|
* A permanent marker promise which signifies that the current CD tree is
|
|
11510
11442
|
* clean.
|
|
@@ -11572,7 +11504,7 @@ function refreshChildComponents(hostLView, components) {
|
|
|
11572
11504
|
/** Renders child components in the current view (creation mode). */
|
|
11573
11505
|
function renderChildComponents(hostLView, components) {
|
|
11574
11506
|
for (let i = 0; i < components.length; i++) {
|
|
11575
|
-
renderComponent
|
|
11507
|
+
renderComponent(hostLView, components[i]);
|
|
11576
11508
|
}
|
|
11577
11509
|
}
|
|
11578
11510
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
@@ -12090,16 +12022,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
|
12090
12022
|
function createError(text, token) {
|
|
12091
12023
|
return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
|
|
12092
12024
|
}
|
|
12093
|
-
function assertHostNodeExists(rElement, elementOrSelector) {
|
|
12094
|
-
if (!rElement) {
|
|
12095
|
-
if (typeof elementOrSelector === 'string') {
|
|
12096
|
-
throw createError('Host node with selector not found:', elementOrSelector);
|
|
12097
|
-
}
|
|
12098
|
-
else {
|
|
12099
|
-
throw createError('Host node is required:', elementOrSelector);
|
|
12100
|
-
}
|
|
12101
|
-
}
|
|
12102
|
-
}
|
|
12103
12025
|
/**
|
|
12104
12026
|
* Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
|
|
12105
12027
|
*
|
|
@@ -12108,21 +12030,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
|
|
|
12108
12030
|
* @param encapsulation View Encapsulation defined for component that requests host element.
|
|
12109
12031
|
*/
|
|
12110
12032
|
function locateHostElement(renderer, elementOrSelector, encapsulation) {
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12115
|
-
}
|
|
12116
|
-
let rElement = typeof elementOrSelector === 'string' ?
|
|
12117
|
-
renderer.querySelector(elementOrSelector) :
|
|
12118
|
-
elementOrSelector;
|
|
12119
|
-
ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
|
|
12120
|
-
// Always clear host element's content when Renderer3 is in use. For procedural renderer case we
|
|
12121
|
-
// make it depend on whether ShadowDom encapsulation is used (in which case the content should be
|
|
12122
|
-
// preserved to allow native slot projection). ShadowDom encapsulation requires procedural
|
|
12123
|
-
// renderer, and procedural renderer case is handled above.
|
|
12124
|
-
rElement.textContent = '';
|
|
12125
|
-
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);
|
|
12126
12036
|
}
|
|
12127
12037
|
/**
|
|
12128
12038
|
* Saves context for this cleanup function in LView.cleanupInstances.
|
|
@@ -12337,13 +12247,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12337
12247
|
// It is assumed that the sanitizer is only added when the compiler determines that the
|
|
12338
12248
|
// property is risky, so sanitization can be done without further checks.
|
|
12339
12249
|
value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
|
|
12340
|
-
|
|
12341
|
-
renderer.setProperty(element, propName, value);
|
|
12342
|
-
}
|
|
12343
|
-
else if (!isAnimationProp(propName)) {
|
|
12344
|
-
element.setProperty ? element.setProperty(propName, value) :
|
|
12345
|
-
element[propName] = value;
|
|
12346
|
-
}
|
|
12250
|
+
renderer.setProperty(element, propName, value);
|
|
12347
12251
|
}
|
|
12348
12252
|
else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
|
|
12349
12253
|
// If the node is a container and the property didn't
|
|
@@ -12367,23 +12271,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
|
12367
12271
|
const debugValue = normalizeDebugBindingValue(value);
|
|
12368
12272
|
if (type & 3 /* TNodeType.AnyRNode */) {
|
|
12369
12273
|
if (value == null) {
|
|
12370
|
-
|
|
12371
|
-
element.removeAttribute(attrName);
|
|
12274
|
+
renderer.removeAttribute(element, attrName);
|
|
12372
12275
|
}
|
|
12373
12276
|
else {
|
|
12374
|
-
|
|
12375
|
-
renderer.setAttribute(element, attrName, debugValue) :
|
|
12376
|
-
element.setAttribute(attrName, debugValue);
|
|
12277
|
+
renderer.setAttribute(element, attrName, debugValue);
|
|
12377
12278
|
}
|
|
12378
12279
|
}
|
|
12379
12280
|
else {
|
|
12380
12281
|
const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
|
|
12381
|
-
|
|
12382
|
-
renderer.setValue(element, textContent);
|
|
12383
|
-
}
|
|
12384
|
-
else {
|
|
12385
|
-
element.textContent = textContent;
|
|
12386
|
-
}
|
|
12282
|
+
renderer.setValue(element, textContent);
|
|
12387
12283
|
}
|
|
12388
12284
|
}
|
|
12389
12285
|
function setNgReflectProperties(lView, element, type, dataValue, value) {
|
|
@@ -12413,6 +12309,7 @@ function instantiateRootComponent(tView, lView, def) {
|
|
|
12413
12309
|
ngDevMode &&
|
|
12414
12310
|
assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
|
|
12415
12311
|
configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
|
|
12312
|
+
initializeInputAndOutputAliases(tView, rootTNode);
|
|
12416
12313
|
}
|
|
12417
12314
|
const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
|
|
12418
12315
|
attachPatchData(directive, lView);
|
|
@@ -12737,19 +12634,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
|
|
|
12737
12634
|
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
|
|
12738
12635
|
if (value == null) {
|
|
12739
12636
|
ngDevMode && ngDevMode.rendererRemoveAttribute++;
|
|
12740
|
-
|
|
12741
|
-
element.removeAttribute(name);
|
|
12637
|
+
renderer.removeAttribute(element, name, namespace);
|
|
12742
12638
|
}
|
|
12743
12639
|
else {
|
|
12744
12640
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
12745
12641
|
const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
|
|
12746
|
-
|
|
12747
|
-
renderer.setAttribute(element, name, strValue, namespace);
|
|
12748
|
-
}
|
|
12749
|
-
else {
|
|
12750
|
-
namespace ? element.setAttributeNS(namespace, name, strValue) :
|
|
12751
|
-
element.setAttribute(name, strValue);
|
|
12752
|
-
}
|
|
12642
|
+
renderer.setAttribute(element, name, strValue, namespace);
|
|
12753
12643
|
}
|
|
12754
12644
|
}
|
|
12755
12645
|
/**
|
|
@@ -12841,7 +12731,6 @@ const LContainerArray = class LContainer extends Array {
|
|
|
12841
12731
|
*/
|
|
12842
12732
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
12843
12733
|
ngDevMode && assertLView(currentView);
|
|
12844
|
-
ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
|
|
12845
12734
|
// https://jsperf.com/array-literal-vs-new-array-really
|
|
12846
12735
|
const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
|
|
12847
12736
|
true, // Boolean `true` in this position signifies that this is an `LContainer`
|
|
@@ -12957,7 +12846,7 @@ function refreshContainsDirtyView(lView) {
|
|
|
12957
12846
|
}
|
|
12958
12847
|
}
|
|
12959
12848
|
}
|
|
12960
|
-
function renderComponent
|
|
12849
|
+
function renderComponent(hostLView, componentHostIdx) {
|
|
12961
12850
|
ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
|
|
12962
12851
|
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
|
|
12963
12852
|
const componentTView = componentView[TVIEW];
|
|
@@ -13309,458 +13198,450 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
|
|
|
13309
13198
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13310
13199
|
* found in the LICENSE file at https://angular.io/license
|
|
13311
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
|
+
};
|
|
13312
13207
|
/**
|
|
13313
|
-
*
|
|
13314
|
-
*
|
|
13315
|
-
* This function triggers change detection in a synchronous way on a component.
|
|
13316
|
-
*
|
|
13317
|
-
* @param component The component which the change detection should be performed on.
|
|
13318
|
-
*/
|
|
13319
|
-
function detectChanges(component) {
|
|
13320
|
-
const view = getComponentViewByInstance(component);
|
|
13321
|
-
detectChangesInternal(view[TVIEW], view, component);
|
|
13322
|
-
}
|
|
13323
|
-
/**
|
|
13324
|
-
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
13325
|
-
* schedule a change detection on it at some point in the future.
|
|
13326
|
-
*
|
|
13327
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
13328
|
-
* detection can be scheduled per component tree.
|
|
13329
|
-
*
|
|
13330
|
-
* @param component Component to mark as dirty.
|
|
13331
|
-
*/
|
|
13332
|
-
function markDirty(component) {
|
|
13333
|
-
ngDevMode && assertDefined(component, 'component');
|
|
13334
|
-
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
13335
|
-
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
13336
|
-
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
13337
|
-
}
|
|
13338
|
-
/**
|
|
13339
|
-
* Used to perform change detection on the whole application.
|
|
13208
|
+
* Creates the root component view and the root component node.
|
|
13340
13209
|
*
|
|
13341
|
-
*
|
|
13342
|
-
*
|
|
13343
|
-
*
|
|
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
|
|
13344
13216
|
*
|
|
13345
|
-
*
|
|
13346
|
-
* schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
|
|
13347
|
-
* single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
|
|
13348
|
-
* be changed when calling `renderComponent` and providing the `scheduler` option.
|
|
13217
|
+
* @returns Component view created
|
|
13349
13218
|
*/
|
|
13350
|
-
function
|
|
13351
|
-
const
|
|
13352
|
-
const
|
|
13353
|
-
|
|
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
|
+
}
|
|
13239
|
+
}
|
|
13240
|
+
}
|
|
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;
|
|
13354
13251
|
}
|
|
13355
|
-
|
|
13356
|
-
/**
|
|
13357
|
-
* @license
|
|
13358
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13359
|
-
*
|
|
13360
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
13361
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13362
|
-
*/
|
|
13363
13252
|
/**
|
|
13364
|
-
*
|
|
13365
|
-
*
|
|
13366
|
-
* @usageNotes
|
|
13367
|
-
* Given the following DOM structure:
|
|
13368
|
-
*
|
|
13369
|
-
* ```html
|
|
13370
|
-
* <app-root>
|
|
13371
|
-
* <div>
|
|
13372
|
-
* <child-comp></child-comp>
|
|
13373
|
-
* </div>
|
|
13374
|
-
* </app-root>
|
|
13375
|
-
* ```
|
|
13376
|
-
*
|
|
13377
|
-
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
13378
|
-
* associated with this DOM element.
|
|
13379
|
-
*
|
|
13380
|
-
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
13381
|
-
*
|
|
13382
|
-
*
|
|
13383
|
-
* @param element DOM element from which the component should be retrieved.
|
|
13384
|
-
* @returns Component instance associated with the element or `null` if there
|
|
13385
|
-
* is no component associated with it.
|
|
13386
|
-
*
|
|
13387
|
-
* @publicApi
|
|
13388
|
-
* @globalApi ng
|
|
13253
|
+
* Creates a root component and sets it up with features and host bindings. Shared by
|
|
13254
|
+
* renderComponent() and ViewContainerRef.createComponent().
|
|
13389
13255
|
*/
|
|
13390
|
-
function
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
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);
|
|
13399
13265
|
}
|
|
13400
|
-
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
13401
13266
|
}
|
|
13402
|
-
|
|
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;
|
|
13403
13284
|
}
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13411
|
-
|
|
13412
|
-
*
|
|
13413
|
-
* @publicApi
|
|
13414
|
-
* @globalApi ng
|
|
13415
|
-
*/
|
|
13416
|
-
function getContext(element) {
|
|
13417
|
-
assertDomElement(element);
|
|
13418
|
-
const context = getLContext(element);
|
|
13419
|
-
const lView = context ? context.lView : null;
|
|
13420
|
-
return lView === null ? null : lView[CONTEXT];
|
|
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
|
+
};
|
|
13421
13293
|
}
|
|
13422
13294
|
/**
|
|
13423
|
-
*
|
|
13295
|
+
* Used to enable lifecycle hooks on the root component.
|
|
13424
13296
|
*
|
|
13425
|
-
*
|
|
13426
|
-
*
|
|
13427
|
-
*
|
|
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.
|
|
13428
13300
|
*
|
|
13429
|
-
*
|
|
13430
|
-
* for which to retrieve the root components.
|
|
13431
|
-
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
13432
|
-
* part of a component view.
|
|
13301
|
+
* Example:
|
|
13433
13302
|
*
|
|
13434
|
-
*
|
|
13435
|
-
*
|
|
13303
|
+
* ```
|
|
13304
|
+
* renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
|
|
13305
|
+
* ```
|
|
13436
13306
|
*/
|
|
13437
|
-
function
|
|
13438
|
-
const
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
return null;
|
|
13442
|
-
let parent;
|
|
13443
|
-
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
13444
|
-
lView = parent;
|
|
13445
|
-
}
|
|
13446
|
-
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);
|
|
13447
13311
|
}
|
|
13448
13312
|
/**
|
|
13449
|
-
*
|
|
13450
|
-
* Root components are those which have been bootstrapped by Angular.
|
|
13313
|
+
* Wait on component until it is rendered.
|
|
13451
13314
|
*
|
|
13452
|
-
*
|
|
13453
|
-
*
|
|
13454
|
-
*
|
|
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
|
-
*
|
|
13320
|
+
* Example:
|
|
13321
|
+
* ```
|
|
13322
|
+
* await whenRendered(myComponent);
|
|
13323
|
+
* ```
|
|
13324
|
+
*
|
|
13325
|
+
* @param component Component to wait upon
|
|
13326
|
+
* @returns Promise which resolves when the component is rendered.
|
|
13458
13327
|
*/
|
|
13459
|
-
function
|
|
13460
|
-
|
|
13461
|
-
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
13328
|
+
function whenRendered(component) {
|
|
13329
|
+
return getRootContext(component).clean;
|
|
13462
13330
|
}
|
|
13331
|
+
|
|
13463
13332
|
/**
|
|
13464
|
-
*
|
|
13465
|
-
*
|
|
13466
|
-
* @param elementOrDir DOM element, component or directive instance for which to
|
|
13467
|
-
* retrieve the injector.
|
|
13468
|
-
* @returns Injector associated with the element, component or directive instance.
|
|
13333
|
+
* @license
|
|
13334
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13469
13335
|
*
|
|
13470
|
-
*
|
|
13471
|
-
*
|
|
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
|
|
13472
13338
|
*/
|
|
13473
|
-
function
|
|
13474
|
-
|
|
13475
|
-
const lView = context ? context.lView : null;
|
|
13476
|
-
if (lView === null)
|
|
13477
|
-
return Injector.NULL;
|
|
13478
|
-
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
13479
|
-
return new NodeInjector(tNode, lView);
|
|
13339
|
+
function getSuperType(type) {
|
|
13340
|
+
return Object.getPrototypeOf(type.prototype).constructor;
|
|
13480
13341
|
}
|
|
13481
13342
|
/**
|
|
13482
|
-
*
|
|
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
|
|
13483
13345
|
*
|
|
13484
|
-
* @
|
|
13346
|
+
* @codeGenApi
|
|
13485
13347
|
*/
|
|
13486
|
-
function
|
|
13487
|
-
|
|
13488
|
-
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
const endIndex = tNode.directiveEnd;
|
|
13496
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
13497
|
-
let value = tView.data[i];
|
|
13498
|
-
if (isDirectiveDefHack(value)) {
|
|
13499
|
-
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
13500
|
-
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
13501
|
-
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
13502
|
-
// is that we should always be storing injectable type in this location.
|
|
13503
|
-
value = value.type;
|
|
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;
|
|
13504
13357
|
}
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
}
|
|
13509
|
-
|
|
13510
|
-
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
|
|
13529
|
-
|
|
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);
|
|
13418
|
+
}
|
|
13419
|
+
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13420
|
+
}
|
|
13421
|
+
/**
|
|
13422
|
+
* Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
|
|
13530
13423
|
*
|
|
13531
|
-
* @
|
|
13532
|
-
*
|
|
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.
|
|
13533
13427
|
*/
|
|
13534
|
-
function
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
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));
|
|
13538
13439
|
}
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
if (
|
|
13542
|
-
return
|
|
13440
|
+
}
|
|
13441
|
+
function maybeUnwrapEmpty(value) {
|
|
13442
|
+
if (value === EMPTY_OBJ) {
|
|
13443
|
+
return {};
|
|
13543
13444
|
}
|
|
13544
|
-
|
|
13545
|
-
const nodeIndex = context.nodeIndex;
|
|
13546
|
-
if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
|
|
13445
|
+
else if (value === EMPTY_ARRAY) {
|
|
13547
13446
|
return [];
|
|
13548
13447
|
}
|
|
13549
|
-
|
|
13550
|
-
|
|
13448
|
+
else {
|
|
13449
|
+
return value;
|
|
13551
13450
|
}
|
|
13552
|
-
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
13553
|
-
// result so we don't expose an internal data structure in the user's console.
|
|
13554
|
-
return context.directives === null ? [] : [...context.directives];
|
|
13555
13451
|
}
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
*
|
|
13564
|
-
* @publicApi
|
|
13565
|
-
* @globalApi ng
|
|
13566
|
-
*/
|
|
13567
|
-
function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
13568
|
-
const { constructor } = directiveOrComponentInstance;
|
|
13569
|
-
if (!constructor) {
|
|
13570
|
-
throw new Error('Unable to find the instance constructor');
|
|
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);
|
|
13458
|
+
};
|
|
13571
13459
|
}
|
|
13572
|
-
|
|
13573
|
-
|
|
13574
|
-
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13460
|
+
else {
|
|
13461
|
+
definition.viewQuery = superViewQuery;
|
|
13462
|
+
}
|
|
13463
|
+
}
|
|
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);
|
|
13582
13470
|
};
|
|
13583
13471
|
}
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
13472
|
+
else {
|
|
13473
|
+
definition.contentQueries = superContentQueries;
|
|
13587
13474
|
}
|
|
13588
|
-
return null;
|
|
13589
13475
|
}
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
if (context === null)
|
|
13601
|
-
return {};
|
|
13602
|
-
if (context.localRefs === undefined) {
|
|
13603
|
-
const lView = context.lView;
|
|
13604
|
-
if (lView === null) {
|
|
13605
|
-
return {};
|
|
13606
|
-
}
|
|
13607
|
-
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
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;
|
|
13608
13486
|
}
|
|
13609
|
-
return context.localRefs || {};
|
|
13610
13487
|
}
|
|
13488
|
+
|
|
13611
13489
|
/**
|
|
13612
|
-
*
|
|
13613
|
-
*
|
|
13614
|
-
*
|
|
13615
|
-
* @param componentOrDirective Component or directive instance for which the host
|
|
13616
|
-
* element should be retrieved.
|
|
13617
|
-
* @returns Host element of the target.
|
|
13490
|
+
* @license
|
|
13491
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13618
13492
|
*
|
|
13619
|
-
*
|
|
13620
|
-
*
|
|
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
|
|
13621
13495
|
*/
|
|
13622
|
-
function getHostElement(componentOrDirective) {
|
|
13623
|
-
return getLContext(componentOrDirective).native;
|
|
13624
|
-
}
|
|
13625
13496
|
/**
|
|
13626
|
-
*
|
|
13627
|
-
*
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
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`.
|
|
13632
13509
|
*
|
|
13633
|
-
*
|
|
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.
|
|
13634
13512
|
*/
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
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
|
+
];
|
|
13639
13528
|
/**
|
|
13640
|
-
*
|
|
13641
|
-
*
|
|
13642
|
-
* (e.g. through `addEventListener`).
|
|
13529
|
+
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
13530
|
+
* definition.
|
|
13643
13531
|
*
|
|
13644
|
-
*
|
|
13645
|
-
*
|
|
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.
|
|
13646
13535
|
*
|
|
13647
|
-
*
|
|
13648
|
-
*
|
|
13649
|
-
* <div (click)="doSomething()"></div>
|
|
13650
|
-
* </app-root>
|
|
13651
|
-
* ```
|
|
13652
|
-
*
|
|
13653
|
-
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
13654
|
-
*
|
|
13655
|
-
* ```ts
|
|
13656
|
-
* {
|
|
13657
|
-
* name: 'click',
|
|
13658
|
-
* element: <div>,
|
|
13659
|
-
* callback: () => doSomething(),
|
|
13660
|
-
* useCapture: false
|
|
13661
|
-
* }
|
|
13662
|
-
* ```
|
|
13536
|
+
* The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
|
|
13537
|
+
* including things like the component template function.
|
|
13663
13538
|
*
|
|
13664
|
-
* @param
|
|
13665
|
-
*
|
|
13539
|
+
* @param definition The definition of a child class which inherits from a parent class with its
|
|
13540
|
+
* own definition.
|
|
13666
13541
|
*
|
|
13667
|
-
* @
|
|
13668
|
-
* @globalApi ng
|
|
13542
|
+
* @codeGenApi
|
|
13669
13543
|
*/
|
|
13670
|
-
function
|
|
13671
|
-
|
|
13672
|
-
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
13692
|
-
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
13693
|
-
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
13694
|
-
if (element == listenerElement) {
|
|
13695
|
-
listeners.push({ element, name, callback, useCapture, type });
|
|
13696
|
-
}
|
|
13697
|
-
}
|
|
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];
|
|
13698
13565
|
}
|
|
13699
13566
|
}
|
|
13700
|
-
listeners.sort(sortListeners);
|
|
13701
|
-
return listeners;
|
|
13702
|
-
}
|
|
13703
|
-
function sortListeners(a, b) {
|
|
13704
|
-
if (a.name == b.name)
|
|
13705
|
-
return 0;
|
|
13706
|
-
return a.name < b.name ? -1 : 1;
|
|
13707
13567
|
}
|
|
13568
|
+
|
|
13708
13569
|
/**
|
|
13709
|
-
*
|
|
13570
|
+
* @license
|
|
13571
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13710
13572
|
*
|
|
13711
|
-
*
|
|
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
|
|
13712
13575
|
*/
|
|
13713
|
-
|
|
13714
|
-
|
|
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;
|
|
13715
13596
|
}
|
|
13597
|
+
|
|
13716
13598
|
/**
|
|
13717
|
-
*
|
|
13599
|
+
* @license
|
|
13600
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13718
13601
|
*
|
|
13719
|
-
*
|
|
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
|
|
13720
13604
|
*/
|
|
13721
|
-
function
|
|
13722
|
-
|
|
13723
|
-
|
|
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;
|
|
13724
13627
|
}
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
if (
|
|
13728
|
-
|
|
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
|
+
}
|
|
13729
13634
|
}
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
ngDevMode &&
|
|
13737
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
13738
|
-
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
|
+
}
|
|
13739
13641
|
}
|
|
13740
|
-
return null;
|
|
13741
|
-
}
|
|
13742
|
-
/**
|
|
13743
|
-
* Retrieve the component `LView` from component/element.
|
|
13744
|
-
*
|
|
13745
|
-
* NOTE: `LView` is a private and should not be leaked outside.
|
|
13746
|
-
* Don't export this method to `ng.*` on window.
|
|
13747
|
-
*
|
|
13748
|
-
* @param target DOM element or component instance for which to retrieve the LView.
|
|
13749
|
-
*/
|
|
13750
|
-
function getComponentLView(target) {
|
|
13751
|
-
const lContext = getLContext(target);
|
|
13752
|
-
const nodeIndx = lContext.nodeIndex;
|
|
13753
|
-
const lView = lContext.lView;
|
|
13754
|
-
ngDevMode && assertLView(lView);
|
|
13755
|
-
const componentLView = lView[nodeIndx];
|
|
13756
|
-
ngDevMode && assertLView(componentLView);
|
|
13757
|
-
return componentLView;
|
|
13758
13642
|
}
|
|
13759
|
-
|
|
13760
|
-
function
|
|
13761
|
-
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
13762
|
-
throw new Error('Expecting instance of DOM Element');
|
|
13763
|
-
}
|
|
13643
|
+
function isJsObject(o) {
|
|
13644
|
+
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
13764
13645
|
}
|
|
13765
13646
|
|
|
13766
13647
|
/**
|
|
@@ -13770,18 +13651,22 @@ function assertDomElement(value) {
|
|
|
13770
13651
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13771
13652
|
* found in the LICENSE file at https://angular.io/license
|
|
13772
13653
|
*/
|
|
13773
|
-
|
|
13774
|
-
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
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
|
+
}
|
|
13785
13670
|
}
|
|
13786
13671
|
|
|
13787
13672
|
/**
|
|
@@ -13791,70 +13676,73 @@ function applyChanges(component) {
|
|
|
13791
13676
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13792
13677
|
* found in the LICENSE file at https://angular.io/license
|
|
13793
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
|
+
}
|
|
13794
13691
|
/**
|
|
13795
|
-
*
|
|
13796
|
-
* to allow for the Angular debugging story to function.
|
|
13797
|
-
*
|
|
13798
|
-
* To see this in action run the following command:
|
|
13799
|
-
*
|
|
13800
|
-
* bazel run //packages/core/test/bundling/todo:devserver
|
|
13692
|
+
* Updates binding if changed, then returns whether it was updated.
|
|
13801
13693
|
*
|
|
13802
|
-
*
|
|
13803
|
-
|
|
13804
|
-
|
|
13805
|
-
* This value reflects the property on the window where the dev
|
|
13806
|
-
* tools are patched (window.ng).
|
|
13807
|
-
* */
|
|
13808
|
-
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
13809
|
-
let _published = false;
|
|
13810
|
-
/**
|
|
13811
|
-
* 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.
|
|
13812
13697
|
*
|
|
13813
|
-
*
|
|
13814
|
-
*
|
|
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`)
|
|
13815
13703
|
*/
|
|
13816
|
-
function
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
*/
|
|
13824
|
-
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
13825
|
-
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
13826
|
-
publishGlobalUtil('getComponent', getComponent$1);
|
|
13827
|
-
publishGlobalUtil('getContext', getContext);
|
|
13828
|
-
publishGlobalUtil('getListeners', getListeners);
|
|
13829
|
-
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
13830
|
-
publishGlobalUtil('getHostElement', getHostElement);
|
|
13831
|
-
publishGlobalUtil('getInjector', getInjector);
|
|
13832
|
-
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
13833
|
-
publishGlobalUtil('getDirectives', getDirectives);
|
|
13834
|
-
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;
|
|
13835
13711
|
}
|
|
13836
|
-
|
|
13837
|
-
|
|
13838
|
-
|
|
13839
|
-
|
|
13840
|
-
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
13845
|
-
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
13846
|
-
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
13847
|
-
const w = _global;
|
|
13848
|
-
ngDevMode && assertDefined(fn, 'function not defined');
|
|
13849
|
-
if (w) {
|
|
13850
|
-
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
13851
|
-
if (!container) {
|
|
13852
|
-
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);
|
|
13853
13720
|
}
|
|
13854
|
-
|
|
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;
|
|
13855
13726
|
}
|
|
13727
|
+
lView[bindingIndex] = value;
|
|
13728
|
+
return true;
|
|
13856
13729
|
}
|
|
13857
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
|
+
}
|
|
13858
13746
|
|
|
13859
13747
|
/**
|
|
13860
13748
|
* @license
|
|
@@ -13863,975 +13751,370 @@ function publishGlobalUtil(name, fn) {
|
|
|
13863
13751
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13864
13752
|
* found in the LICENSE file at https://angular.io/license
|
|
13865
13753
|
*/
|
|
13866
|
-
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13867
|
-
const NULL_INJECTOR = {
|
|
13868
|
-
get: (token, notFoundValue) => {
|
|
13869
|
-
throwProviderNotFoundError(token, 'NullInjector');
|
|
13870
|
-
}
|
|
13871
|
-
};
|
|
13872
13754
|
/**
|
|
13873
|
-
*
|
|
13874
|
-
* of the component.
|
|
13755
|
+
* Updates the value of or removes a bound attribute on an Element.
|
|
13875
13756
|
*
|
|
13876
|
-
*
|
|
13877
|
-
*
|
|
13878
|
-
*
|
|
13879
|
-
*
|
|
13880
|
-
*
|
|
13757
|
+
* Used in the case of `[attr.title]="value"`
|
|
13758
|
+
*
|
|
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.
|
|
13881
13764
|
*
|
|
13882
|
-
* @
|
|
13883
|
-
* @param options Optional parameters which control bootstrapping
|
|
13765
|
+
* @codeGenApi
|
|
13884
13766
|
*/
|
|
13885
|
-
function
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
13893
|
-
// The first index of the first selector is the tag name.
|
|
13894
|
-
const componentTag = componentDef.selectors[0][0];
|
|
13895
|
-
const hostRenderer = rendererFactory.createRenderer(null, null);
|
|
13896
|
-
const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
|
|
13897
|
-
const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
13898
|
-
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
13899
|
-
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
13900
|
-
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
13901
|
-
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
13902
|
-
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
13903
|
-
enterView(rootView);
|
|
13904
|
-
let component;
|
|
13905
|
-
try {
|
|
13906
|
-
if (rendererFactory.begin)
|
|
13907
|
-
rendererFactory.begin();
|
|
13908
|
-
const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
|
|
13909
|
-
component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
|
|
13910
|
-
// create mode pass
|
|
13911
|
-
renderView(rootTView, rootView, null);
|
|
13912
|
-
// update mode pass
|
|
13913
|
-
refreshView(rootTView, rootView, null, null);
|
|
13914
|
-
}
|
|
13915
|
-
finally {
|
|
13916
|
-
leaveView();
|
|
13917
|
-
if (rendererFactory.end)
|
|
13918
|
-
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);
|
|
13919
13775
|
}
|
|
13920
|
-
return
|
|
13776
|
+
return ɵɵattribute;
|
|
13921
13777
|
}
|
|
13778
|
+
|
|
13922
13779
|
/**
|
|
13923
|
-
*
|
|
13924
|
-
*
|
|
13925
|
-
* @param rNode Render host element.
|
|
13926
|
-
* @param def ComponentDef
|
|
13927
|
-
* @param rootView The parent view where the host node is stored
|
|
13928
|
-
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13929
|
-
* @param hostRenderer The current renderer
|
|
13930
|
-
* @param sanitizer The sanitizer, if provided
|
|
13780
|
+
* @license
|
|
13781
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13931
13782
|
*
|
|
13932
|
-
*
|
|
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
|
|
13933
13785
|
*/
|
|
13934
|
-
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13935
|
-
const tView = rootView[TVIEW];
|
|
13936
|
-
const index = HEADER_OFFSET;
|
|
13937
|
-
ngDevMode && assertIndexInRange(rootView, index);
|
|
13938
|
-
rootView[index] = rNode;
|
|
13939
|
-
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13940
|
-
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13941
|
-
// representing a host element.
|
|
13942
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13943
|
-
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13944
|
-
if (mergedAttrs !== null) {
|
|
13945
|
-
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13946
|
-
if (rNode !== null) {
|
|
13947
|
-
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13948
|
-
if (tNode.classes !== null) {
|
|
13949
|
-
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13950
|
-
}
|
|
13951
|
-
if (tNode.styles !== null) {
|
|
13952
|
-
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13953
|
-
}
|
|
13954
|
-
}
|
|
13955
|
-
}
|
|
13956
|
-
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13957
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13958
|
-
if (tView.firstCreatePass) {
|
|
13959
|
-
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13960
|
-
markAsComponentHost(tView, tNode);
|
|
13961
|
-
initTNodeFlags(tNode, rootView.length, 1);
|
|
13962
|
-
}
|
|
13963
|
-
addToViewTree(rootView, componentView);
|
|
13964
|
-
// Store component view at node index, with node as the HOST
|
|
13965
|
-
return rootView[index] = componentView;
|
|
13966
|
-
}
|
|
13967
13786
|
/**
|
|
13968
|
-
*
|
|
13969
|
-
*
|
|
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.
|
|
13970
13797
|
*/
|
|
13971
|
-
function
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
feature(component, componentDef);
|
|
13980
|
-
}
|
|
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;
|
|
13981
13806
|
}
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
const tNode = getCurrentTNode();
|
|
13986
|
-
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13987
|
-
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13807
|
+
setBindingIndex(bindingIndex);
|
|
13808
|
+
if (!isBindingUpdated) {
|
|
13809
|
+
return NO_CHANGE;
|
|
13988
13810
|
}
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
setSelectedIndex(rootTNode.index);
|
|
13994
|
-
const rootTView = rootLView[TVIEW];
|
|
13995
|
-
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13996
|
-
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];
|
|
13997
13815
|
}
|
|
13998
|
-
return
|
|
13999
|
-
}
|
|
14000
|
-
function createRootContext(scheduler, playerHandler) {
|
|
14001
|
-
return {
|
|
14002
|
-
components: [],
|
|
14003
|
-
scheduler: scheduler || defaultScheduler,
|
|
14004
|
-
clean: CLEAN_PROMISE,
|
|
14005
|
-
playerHandler: playerHandler || null,
|
|
14006
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
14007
|
-
};
|
|
13816
|
+
return content;
|
|
14008
13817
|
}
|
|
14009
13818
|
/**
|
|
14010
|
-
*
|
|
14011
|
-
*
|
|
14012
|
-
* Include this feature when calling `renderComponent` if the root component
|
|
14013
|
-
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
14014
|
-
* be called properly.
|
|
14015
|
-
*
|
|
14016
|
-
* Example:
|
|
13819
|
+
* Creates an interpolation binding with 1 expression.
|
|
14017
13820
|
*
|
|
14018
|
-
*
|
|
14019
|
-
*
|
|
14020
|
-
*
|
|
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.
|
|
14021
13824
|
*/
|
|
14022
|
-
function
|
|
14023
|
-
const
|
|
14024
|
-
|
|
14025
|
-
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;
|
|
14026
13828
|
}
|
|
14027
13829
|
/**
|
|
14028
|
-
*
|
|
14029
|
-
*
|
|
14030
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14031
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14032
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14033
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14034
|
-
*
|
|
14035
|
-
* Example:
|
|
14036
|
-
* ```
|
|
14037
|
-
* await whenRendered(myComponent);
|
|
14038
|
-
* ```
|
|
14039
|
-
*
|
|
14040
|
-
* @param component Component to wait upon
|
|
14041
|
-
* @returns Promise which resolves when the component is rendered.
|
|
13830
|
+
* Creates an interpolation binding with 2 expressions.
|
|
14042
13831
|
*/
|
|
14043
|
-
function
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
* @license
|
|
14049
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14050
|
-
*
|
|
14051
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14052
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14053
|
-
*/
|
|
14054
|
-
function getSuperType(type) {
|
|
14055
|
-
return Object.getPrototypeOf(type.prototype).constructor;
|
|
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;
|
|
14056
13837
|
}
|
|
14057
13838
|
/**
|
|
14058
|
-
*
|
|
14059
|
-
* @param definition The definition that is a SubClass of another directive of component
|
|
14060
|
-
*
|
|
14061
|
-
* @codeGenApi
|
|
13839
|
+
* Creates an interpolation binding with 3 expressions.
|
|
14062
13840
|
*/
|
|
14063
|
-
function
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14071
|
-
superDef = superType.ɵcmp || superType.ɵdir;
|
|
14072
|
-
}
|
|
14073
|
-
else {
|
|
14074
|
-
if (superType.ɵcmp) {
|
|
14075
|
-
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
14076
|
-
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
|
|
14077
|
-
'';
|
|
14078
|
-
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, errorMessage);
|
|
14079
|
-
}
|
|
14080
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14081
|
-
superDef = superType.ɵdir;
|
|
14082
|
-
}
|
|
14083
|
-
if (superDef) {
|
|
14084
|
-
if (shouldInheritFields) {
|
|
14085
|
-
inheritanceChain.push(superDef);
|
|
14086
|
-
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
14087
|
-
// would've justified object creation. Unwrap them if necessary.
|
|
14088
|
-
const writeableDef = definition;
|
|
14089
|
-
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
14090
|
-
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
14091
|
-
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
14092
|
-
// Merge hostBindings
|
|
14093
|
-
const superHostBindings = superDef.hostBindings;
|
|
14094
|
-
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
14095
|
-
// Merge queries
|
|
14096
|
-
const superViewQuery = superDef.viewQuery;
|
|
14097
|
-
const superContentQueries = superDef.contentQueries;
|
|
14098
|
-
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
14099
|
-
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
14100
|
-
// Merge inputs and outputs
|
|
14101
|
-
fillProperties(definition.inputs, superDef.inputs);
|
|
14102
|
-
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
14103
|
-
fillProperties(definition.outputs, superDef.outputs);
|
|
14104
|
-
// Merge animations metadata.
|
|
14105
|
-
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
14106
|
-
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
14107
|
-
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
14108
|
-
// not inherit Components (we throw an error above and cannot reach this code).
|
|
14109
|
-
const defData = definition.data;
|
|
14110
|
-
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
14111
|
-
}
|
|
14112
|
-
}
|
|
14113
|
-
// Run parent features
|
|
14114
|
-
const features = superDef.features;
|
|
14115
|
-
if (features) {
|
|
14116
|
-
for (let i = 0; i < features.length; i++) {
|
|
14117
|
-
const feature = features[i];
|
|
14118
|
-
if (feature && feature.ngInherit) {
|
|
14119
|
-
feature(definition);
|
|
14120
|
-
}
|
|
14121
|
-
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
14122
|
-
// def already has all the necessary information inherited from its super class(es), so we
|
|
14123
|
-
// can stop merging fields from super classes. However we need to iterate through the
|
|
14124
|
-
// prototype chain to look for classes that might contain other "features" (like
|
|
14125
|
-
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
14126
|
-
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
14127
|
-
// logic and only invoking functions from the "features" list.
|
|
14128
|
-
if (feature === ɵɵInheritDefinitionFeature) {
|
|
14129
|
-
shouldInheritFields = false;
|
|
14130
|
-
}
|
|
14131
|
-
}
|
|
14132
|
-
}
|
|
14133
|
-
}
|
|
14134
|
-
superType = Object.getPrototypeOf(superType);
|
|
14135
|
-
}
|
|
14136
|
-
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
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;
|
|
14137
13848
|
}
|
|
14138
13849
|
/**
|
|
14139
|
-
*
|
|
14140
|
-
*
|
|
14141
|
-
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
14142
|
-
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
14143
|
-
* type.
|
|
13850
|
+
* Create an interpolation binding with 4 expressions.
|
|
14144
13851
|
*/
|
|
14145
|
-
function
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
def.hostVars = (hostVars += def.hostVars);
|
|
14153
|
-
// for each `hostAttrs` we need to merge it with superclass.
|
|
14154
|
-
def.hostAttrs =
|
|
14155
|
-
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
14156
|
-
}
|
|
14157
|
-
}
|
|
14158
|
-
function maybeUnwrapEmpty(value) {
|
|
14159
|
-
if (value === EMPTY_OBJ) {
|
|
14160
|
-
return {};
|
|
14161
|
-
}
|
|
14162
|
-
else if (value === EMPTY_ARRAY) {
|
|
14163
|
-
return [];
|
|
14164
|
-
}
|
|
14165
|
-
else {
|
|
14166
|
-
return value;
|
|
14167
|
-
}
|
|
14168
|
-
}
|
|
14169
|
-
function inheritViewQuery(definition, superViewQuery) {
|
|
14170
|
-
const prevViewQuery = definition.viewQuery;
|
|
14171
|
-
if (prevViewQuery) {
|
|
14172
|
-
definition.viewQuery = (rf, ctx) => {
|
|
14173
|
-
superViewQuery(rf, ctx);
|
|
14174
|
-
prevViewQuery(rf, ctx);
|
|
14175
|
-
};
|
|
14176
|
-
}
|
|
14177
|
-
else {
|
|
14178
|
-
definition.viewQuery = superViewQuery;
|
|
14179
|
-
}
|
|
14180
|
-
}
|
|
14181
|
-
function inheritContentQueries(definition, superContentQueries) {
|
|
14182
|
-
const prevContentQueries = definition.contentQueries;
|
|
14183
|
-
if (prevContentQueries) {
|
|
14184
|
-
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
14185
|
-
superContentQueries(rf, ctx, directiveIndex);
|
|
14186
|
-
prevContentQueries(rf, ctx, directiveIndex);
|
|
14187
|
-
};
|
|
14188
|
-
}
|
|
14189
|
-
else {
|
|
14190
|
-
definition.contentQueries = superContentQueries;
|
|
14191
|
-
}
|
|
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;
|
|
14192
13859
|
}
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
|
|
13860
|
+
/**
|
|
13861
|
+
* Creates an interpolation binding with 5 expressions.
|
|
13862
|
+
*/
|
|
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;
|
|
14204
13871
|
}
|
|
14205
|
-
|
|
14206
13872
|
/**
|
|
14207
|
-
*
|
|
14208
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14209
|
-
*
|
|
14210
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14211
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13873
|
+
* Creates an interpolation binding with 6 expressions.
|
|
14212
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
|
+
}
|
|
14213
13885
|
/**
|
|
14214
|
-
*
|
|
14215
|
-
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13886
|
+
* Creates an interpolation binding with 7 expressions.
|
|
14216
13887
|
*/
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
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
|
+
}
|
|
14223
13898
|
/**
|
|
14224
|
-
*
|
|
14225
|
-
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
14226
|
-
*
|
|
14227
|
-
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
14228
|
-
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13899
|
+
* Creates an interpolation binding with 8 expressions.
|
|
14229
13900
|
*/
|
|
14230
|
-
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
'encapsulation',
|
|
14242
|
-
// The child class should be checked by the runtime in the same way as its parent.
|
|
14243
|
-
'schemas',
|
|
14244
|
-
];
|
|
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
|
+
|
|
14245
13912
|
/**
|
|
14246
|
-
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
14247
|
-
* definition.
|
|
14248
13913
|
*
|
|
14249
|
-
*
|
|
14250
|
-
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
14251
|
-
* 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.
|
|
14252
13915
|
*
|
|
14253
|
-
*
|
|
14254
|
-
* including things like the component template function.
|
|
13916
|
+
* Used when the value passed to a property has 1 interpolated value in it:
|
|
14255
13917
|
*
|
|
14256
|
-
*
|
|
14257
|
-
*
|
|
13918
|
+
* ```html
|
|
13919
|
+
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
13920
|
+
* ```
|
|
13921
|
+
*
|
|
13922
|
+
* Its compiled representation is::
|
|
13923
|
+
*
|
|
13924
|
+
* ```ts
|
|
13925
|
+
* ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
|
|
13926
|
+
* ```
|
|
14258
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.
|
|
14259
13934
|
* @codeGenApi
|
|
14260
13935
|
*/
|
|
14261
|
-
function
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
if (
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14270
|
-
superDef = superType.ɵdir;
|
|
14271
|
-
}
|
|
14272
|
-
// Needed because `definition` fields are readonly.
|
|
14273
|
-
const defAny = definition;
|
|
14274
|
-
// Copy over any fields that apply to either directives or components.
|
|
14275
|
-
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
14276
|
-
defAny[field] = superDef[field];
|
|
14277
|
-
}
|
|
14278
|
-
if (isComponentDef(superDef)) {
|
|
14279
|
-
// Copy over any component-specific fields.
|
|
14280
|
-
for (const field of COPY_COMPONENT_FIELDS) {
|
|
14281
|
-
defAny[field] = superDef[field];
|
|
14282
|
-
}
|
|
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);
|
|
14283
13944
|
}
|
|
13945
|
+
return ɵɵattributeInterpolate1;
|
|
14284
13946
|
}
|
|
14285
|
-
|
|
14286
13947
|
/**
|
|
14287
|
-
* @license
|
|
14288
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14289
13948
|
*
|
|
14290
|
-
*
|
|
14291
|
-
*
|
|
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
|
|
14292
13972
|
*/
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
// es6-shim specific logic
|
|
14302
|
-
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
14303
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
14304
|
-
const key = keys[i];
|
|
14305
|
-
if (key !== 'entries' && key !== 'size' &&
|
|
14306
|
-
Map.prototype[key] === Map.prototype['entries']) {
|
|
14307
|
-
_symbolIterator = key;
|
|
14308
|
-
}
|
|
14309
|
-
}
|
|
14310
|
-
}
|
|
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);
|
|
14311
13981
|
}
|
|
14312
|
-
return
|
|
13982
|
+
return ɵɵattributeInterpolate2;
|
|
14313
13983
|
}
|
|
14314
|
-
|
|
14315
13984
|
/**
|
|
14316
|
-
* @license
|
|
14317
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14318
13985
|
*
|
|
14319
|
-
*
|
|
14320
|
-
*
|
|
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
|
|
14321
14012
|
*/
|
|
14322
|
-
function
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
14331
|
-
}
|
|
14332
|
-
function areIterablesEqual(a, b, comparator) {
|
|
14333
|
-
const iterator1 = a[getSymbolIterator()]();
|
|
14334
|
-
const iterator2 = b[getSymbolIterator()]();
|
|
14335
|
-
while (true) {
|
|
14336
|
-
const item1 = iterator1.next();
|
|
14337
|
-
const item2 = iterator2.next();
|
|
14338
|
-
if (item1.done && item2.done)
|
|
14339
|
-
return true;
|
|
14340
|
-
if (item1.done || item2.done)
|
|
14341
|
-
return false;
|
|
14342
|
-
if (!comparator(item1.value, item2.value))
|
|
14343
|
-
return false;
|
|
14344
|
-
}
|
|
14345
|
-
}
|
|
14346
|
-
function iterateListLike(obj, fn) {
|
|
14347
|
-
if (Array.isArray(obj)) {
|
|
14348
|
-
for (let i = 0; i < obj.length; i++) {
|
|
14349
|
-
fn(obj[i]);
|
|
14350
|
-
}
|
|
14351
|
-
}
|
|
14352
|
-
else {
|
|
14353
|
-
const iterator = obj[getSymbolIterator()]();
|
|
14354
|
-
let item;
|
|
14355
|
-
while (!((item = iterator.next()).done)) {
|
|
14356
|
-
fn(item.value);
|
|
14357
|
-
}
|
|
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);
|
|
14358
14021
|
}
|
|
14022
|
+
return ɵɵattributeInterpolate3;
|
|
14359
14023
|
}
|
|
14360
|
-
function isJsObject(o) {
|
|
14361
|
-
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
14362
|
-
}
|
|
14363
|
-
|
|
14364
14024
|
/**
|
|
14365
|
-
* @license
|
|
14366
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14367
14025
|
*
|
|
14368
|
-
*
|
|
14369
|
-
*
|
|
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
|
|
14370
14054
|
*/
|
|
14371
|
-
function
|
|
14372
|
-
const
|
|
14373
|
-
const
|
|
14374
|
-
if (
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
14380
|
-
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
14381
|
-
return true;
|
|
14382
|
-
}
|
|
14383
|
-
else {
|
|
14384
|
-
return Object.is(a, b);
|
|
14385
|
-
}
|
|
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);
|
|
14386
14063
|
}
|
|
14064
|
+
return ɵɵattributeInterpolate4;
|
|
14387
14065
|
}
|
|
14388
|
-
|
|
14389
14066
|
/**
|
|
14390
|
-
* @license
|
|
14391
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14392
14067
|
*
|
|
14393
|
-
*
|
|
14394
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14395
|
-
*/
|
|
14396
|
-
// TODO(misko): consider inlining
|
|
14397
|
-
/** Updates binding and returns the value. */
|
|
14398
|
-
function updateBinding(lView, bindingIndex, value) {
|
|
14399
|
-
return lView[bindingIndex] = value;
|
|
14400
|
-
}
|
|
14401
|
-
/** Gets the current binding value. */
|
|
14402
|
-
function getBinding(lView, bindingIndex) {
|
|
14403
|
-
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
14404
|
-
ngDevMode &&
|
|
14405
|
-
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
14406
|
-
return lView[bindingIndex];
|
|
14407
|
-
}
|
|
14408
|
-
/**
|
|
14409
|
-
* Updates binding if changed, then returns whether it was updated.
|
|
14410
|
-
*
|
|
14411
|
-
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
14412
|
-
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
14413
|
-
* behavior.
|
|
14414
|
-
*
|
|
14415
|
-
* @param lView current `LView`
|
|
14416
|
-
* @param bindingIndex The binding in the `LView` to check
|
|
14417
|
-
* @param value New value to check against `lView[bindingIndex]`
|
|
14418
|
-
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
14419
|
-
* `CheckNoChangesMode`)
|
|
14420
|
-
*/
|
|
14421
|
-
function bindingUpdated(lView, bindingIndex, value) {
|
|
14422
|
-
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
14423
|
-
ngDevMode &&
|
|
14424
|
-
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
14425
|
-
const oldValue = lView[bindingIndex];
|
|
14426
|
-
if (Object.is(oldValue, value)) {
|
|
14427
|
-
return false;
|
|
14428
|
-
}
|
|
14429
|
-
else {
|
|
14430
|
-
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
14431
|
-
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
14432
|
-
// (before the change detection was run).
|
|
14433
|
-
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
14434
|
-
if (!devModeEqual(oldValueToCompare, value)) {
|
|
14435
|
-
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
14436
|
-
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
14437
|
-
}
|
|
14438
|
-
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
14439
|
-
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
14440
|
-
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
14441
|
-
// as change on next CD.)
|
|
14442
|
-
return false;
|
|
14443
|
-
}
|
|
14444
|
-
lView[bindingIndex] = value;
|
|
14445
|
-
return true;
|
|
14446
|
-
}
|
|
14447
|
-
}
|
|
14448
|
-
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
14449
|
-
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
14450
|
-
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
14451
|
-
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
14452
|
-
}
|
|
14453
|
-
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
14454
|
-
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
14455
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14456
|
-
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
14457
|
-
}
|
|
14458
|
-
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
14459
|
-
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
14460
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14461
|
-
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
14462
|
-
}
|
|
14463
|
-
|
|
14464
|
-
/**
|
|
14465
|
-
* @license
|
|
14466
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14467
|
-
*
|
|
14468
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14469
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14470
|
-
*/
|
|
14471
|
-
/**
|
|
14472
|
-
* Updates the value of or removes a bound attribute on an Element.
|
|
14473
|
-
*
|
|
14474
|
-
* Used in the case of `[attr.title]="value"`
|
|
14475
|
-
*
|
|
14476
|
-
* @param name name The name of the attribute.
|
|
14477
|
-
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
14478
|
-
* Otherwise the attribute value is set to the stringified value.
|
|
14479
|
-
* @param sanitizer An optional function used to sanitize the value.
|
|
14480
|
-
* @param namespace Optional namespace to use when setting the attribute.
|
|
14481
|
-
*
|
|
14482
|
-
* @codeGenApi
|
|
14483
|
-
*/
|
|
14484
|
-
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
14485
|
-
const lView = getLView();
|
|
14486
|
-
const bindingIndex = nextBindingIndex();
|
|
14487
|
-
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
14488
|
-
const tView = getTView();
|
|
14489
|
-
const tNode = getSelectedTNode();
|
|
14490
|
-
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
14491
|
-
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
14492
|
-
}
|
|
14493
|
-
return ɵɵattribute;
|
|
14494
|
-
}
|
|
14495
|
-
|
|
14496
|
-
/**
|
|
14497
|
-
* @license
|
|
14498
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14499
|
-
*
|
|
14500
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14501
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14502
|
-
*/
|
|
14503
|
-
/**
|
|
14504
|
-
* Create interpolation bindings with a variable number of expressions.
|
|
14505
|
-
*
|
|
14506
|
-
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
14507
|
-
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
14508
|
-
*
|
|
14509
|
-
* `values`:
|
|
14510
|
-
* - has static text at even indexes,
|
|
14511
|
-
* - has evaluated expressions at odd indexes.
|
|
14512
|
-
*
|
|
14513
|
-
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
14514
|
-
*/
|
|
14515
|
-
function interpolationV(lView, values) {
|
|
14516
|
-
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
14517
|
-
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
14518
|
-
let isBindingUpdated = false;
|
|
14519
|
-
let bindingIndex = getBindingIndex();
|
|
14520
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14521
|
-
// Check if bindings (odd indexes) have changed
|
|
14522
|
-
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
14523
|
-
}
|
|
14524
|
-
setBindingIndex(bindingIndex);
|
|
14525
|
-
if (!isBindingUpdated) {
|
|
14526
|
-
return NO_CHANGE;
|
|
14527
|
-
}
|
|
14528
|
-
// Build the updated content
|
|
14529
|
-
let content = values[0];
|
|
14530
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14531
|
-
content += renderStringify(values[i]) + values[i + 1];
|
|
14532
|
-
}
|
|
14533
|
-
return content;
|
|
14534
|
-
}
|
|
14535
|
-
/**
|
|
14536
|
-
* Creates an interpolation binding with 1 expression.
|
|
14537
|
-
*
|
|
14538
|
-
* @param prefix static value used for concatenation only.
|
|
14539
|
-
* @param v0 value checked for change.
|
|
14540
|
-
* @param suffix static value used for concatenation only.
|
|
14541
|
-
*/
|
|
14542
|
-
function interpolation1(lView, prefix, v0, suffix) {
|
|
14543
|
-
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
14544
|
-
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14545
|
-
}
|
|
14546
|
-
/**
|
|
14547
|
-
* Creates an interpolation binding with 2 expressions.
|
|
14548
|
-
*/
|
|
14549
|
-
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
14550
|
-
const bindingIndex = getBindingIndex();
|
|
14551
|
-
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
14552
|
-
incrementBindingIndex(2);
|
|
14553
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14554
|
-
}
|
|
14555
|
-
/**
|
|
14556
|
-
* Creates an interpolation binding with 3 expressions.
|
|
14557
|
-
*/
|
|
14558
|
-
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
14559
|
-
const bindingIndex = getBindingIndex();
|
|
14560
|
-
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
14561
|
-
incrementBindingIndex(3);
|
|
14562
|
-
return different ?
|
|
14563
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
14564
|
-
NO_CHANGE;
|
|
14565
|
-
}
|
|
14566
|
-
/**
|
|
14567
|
-
* Create an interpolation binding with 4 expressions.
|
|
14568
|
-
*/
|
|
14569
|
-
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
14570
|
-
const bindingIndex = getBindingIndex();
|
|
14571
|
-
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14572
|
-
incrementBindingIndex(4);
|
|
14573
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14574
|
-
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
14575
|
-
NO_CHANGE;
|
|
14576
|
-
}
|
|
14577
|
-
/**
|
|
14578
|
-
* Creates an interpolation binding with 5 expressions.
|
|
14579
|
-
*/
|
|
14580
|
-
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
14581
|
-
const bindingIndex = getBindingIndex();
|
|
14582
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14583
|
-
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
14584
|
-
incrementBindingIndex(5);
|
|
14585
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14586
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
14587
|
-
NO_CHANGE;
|
|
14588
|
-
}
|
|
14589
|
-
/**
|
|
14590
|
-
* Creates an interpolation binding with 6 expressions.
|
|
14591
|
-
*/
|
|
14592
|
-
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
14593
|
-
const bindingIndex = getBindingIndex();
|
|
14594
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14595
|
-
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
14596
|
-
incrementBindingIndex(6);
|
|
14597
|
-
return different ?
|
|
14598
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
14599
|
-
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
14600
|
-
NO_CHANGE;
|
|
14601
|
-
}
|
|
14602
|
-
/**
|
|
14603
|
-
* Creates an interpolation binding with 7 expressions.
|
|
14604
|
-
*/
|
|
14605
|
-
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
14606
|
-
const bindingIndex = getBindingIndex();
|
|
14607
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14608
|
-
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
14609
|
-
incrementBindingIndex(7);
|
|
14610
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14611
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14612
|
-
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
14613
|
-
NO_CHANGE;
|
|
14614
|
-
}
|
|
14615
|
-
/**
|
|
14616
|
-
* Creates an interpolation binding with 8 expressions.
|
|
14617
|
-
*/
|
|
14618
|
-
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
14619
|
-
const bindingIndex = getBindingIndex();
|
|
14620
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14621
|
-
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
14622
|
-
incrementBindingIndex(8);
|
|
14623
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14624
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14625
|
-
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
14626
|
-
NO_CHANGE;
|
|
14627
|
-
}
|
|
14628
|
-
|
|
14629
|
-
/**
|
|
14630
|
-
*
|
|
14631
|
-
* 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.
|
|
14632
14069
|
*
|
|
14633
|
-
* Used when the value passed to a property has
|
|
14070
|
+
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14634
14071
|
*
|
|
14635
14072
|
* ```html
|
|
14636
|
-
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
14073
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14637
14074
|
* ```
|
|
14638
14075
|
*
|
|
14639
14076
|
* Its compiled representation is::
|
|
14640
14077
|
*
|
|
14641
14078
|
* ```ts
|
|
14642
|
-
* ɵɵ
|
|
14079
|
+
* ɵɵattributeInterpolate5(
|
|
14080
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14643
14081
|
* ```
|
|
14644
14082
|
*
|
|
14645
14083
|
* @param attrName The name of the attribute to update
|
|
14646
14084
|
* @param prefix Static value used for concatenation only.
|
|
14647
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.
|
|
14648
14094
|
* @param suffix Static value used for concatenation only.
|
|
14649
14095
|
* @param sanitizer An optional sanitizer function
|
|
14650
14096
|
* @returns itself, so that it may be chained.
|
|
14651
14097
|
* @codeGenApi
|
|
14652
14098
|
*/
|
|
14653
|
-
function ɵɵ
|
|
14099
|
+
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14654
14100
|
const lView = getLView();
|
|
14655
|
-
const interpolatedValue =
|
|
14101
|
+
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14656
14102
|
if (interpolatedValue !== NO_CHANGE) {
|
|
14657
14103
|
const tNode = getSelectedTNode();
|
|
14658
14104
|
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14659
14105
|
ngDevMode &&
|
|
14660
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() -
|
|
14106
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14661
14107
|
}
|
|
14662
|
-
return ɵɵ
|
|
14108
|
+
return ɵɵattributeInterpolate5;
|
|
14663
14109
|
}
|
|
14664
14110
|
/**
|
|
14665
14111
|
*
|
|
14666
|
-
* Update an interpolated attribute on an element with
|
|
14112
|
+
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14667
14113
|
*
|
|
14668
|
-
* Used when the value passed to a property has
|
|
14114
|
+
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14669
14115
|
*
|
|
14670
14116
|
* ```html
|
|
14671
|
-
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
14672
|
-
* ```
|
|
14673
|
-
*
|
|
14674
|
-
* Its compiled representation is::
|
|
14675
|
-
*
|
|
14676
|
-
* ```ts
|
|
14677
|
-
* ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
|
|
14678
|
-
* ```
|
|
14679
|
-
*
|
|
14680
|
-
* @param attrName The name of the attribute to update
|
|
14681
|
-
* @param prefix Static value used for concatenation only.
|
|
14682
|
-
* @param v0 Value checked for change.
|
|
14683
|
-
* @param i0 Static value used for concatenation only.
|
|
14684
|
-
* @param v1 Value checked for change.
|
|
14685
|
-
* @param suffix Static value used for concatenation only.
|
|
14686
|
-
* @param sanitizer An optional sanitizer function
|
|
14687
|
-
* @returns itself, so that it may be chained.
|
|
14688
|
-
* @codeGenApi
|
|
14689
|
-
*/
|
|
14690
|
-
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
14691
|
-
const lView = getLView();
|
|
14692
|
-
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
14693
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14694
|
-
const tNode = getSelectedTNode();
|
|
14695
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14696
|
-
ngDevMode &&
|
|
14697
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14698
|
-
}
|
|
14699
|
-
return ɵɵattributeInterpolate2;
|
|
14700
|
-
}
|
|
14701
|
-
/**
|
|
14702
|
-
*
|
|
14703
|
-
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
14704
|
-
*
|
|
14705
|
-
* Used when the value passed to a property has 3 interpolated values in it:
|
|
14706
|
-
*
|
|
14707
|
-
* ```html
|
|
14708
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
14709
|
-
* ```
|
|
14710
|
-
*
|
|
14711
|
-
* Its compiled representation is::
|
|
14712
|
-
*
|
|
14713
|
-
* ```ts
|
|
14714
|
-
* ɵɵattributeInterpolate3(
|
|
14715
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
14716
|
-
* ```
|
|
14717
|
-
*
|
|
14718
|
-
* @param attrName The name of the attribute to update
|
|
14719
|
-
* @param prefix Static value used for concatenation only.
|
|
14720
|
-
* @param v0 Value checked for change.
|
|
14721
|
-
* @param i0 Static value used for concatenation only.
|
|
14722
|
-
* @param v1 Value checked for change.
|
|
14723
|
-
* @param i1 Static value used for concatenation only.
|
|
14724
|
-
* @param v2 Value checked for change.
|
|
14725
|
-
* @param suffix Static value used for concatenation only.
|
|
14726
|
-
* @param sanitizer An optional sanitizer function
|
|
14727
|
-
* @returns itself, so that it may be chained.
|
|
14728
|
-
* @codeGenApi
|
|
14729
|
-
*/
|
|
14730
|
-
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14731
|
-
const lView = getLView();
|
|
14732
|
-
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14733
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14734
|
-
const tNode = getSelectedTNode();
|
|
14735
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14736
|
-
ngDevMode &&
|
|
14737
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14738
|
-
}
|
|
14739
|
-
return ɵɵattributeInterpolate3;
|
|
14740
|
-
}
|
|
14741
|
-
/**
|
|
14742
|
-
*
|
|
14743
|
-
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14744
|
-
*
|
|
14745
|
-
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14746
|
-
*
|
|
14747
|
-
* ```html
|
|
14748
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14749
|
-
* ```
|
|
14750
|
-
*
|
|
14751
|
-
* Its compiled representation is::
|
|
14752
|
-
*
|
|
14753
|
-
* ```ts
|
|
14754
|
-
* ɵɵattributeInterpolate4(
|
|
14755
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14756
|
-
* ```
|
|
14757
|
-
*
|
|
14758
|
-
* @param attrName The name of the attribute to update
|
|
14759
|
-
* @param prefix Static value used for concatenation only.
|
|
14760
|
-
* @param v0 Value checked for change.
|
|
14761
|
-
* @param i0 Static value used for concatenation only.
|
|
14762
|
-
* @param v1 Value checked for change.
|
|
14763
|
-
* @param i1 Static value used for concatenation only.
|
|
14764
|
-
* @param v2 Value checked for change.
|
|
14765
|
-
* @param i2 Static value used for concatenation only.
|
|
14766
|
-
* @param v3 Value checked for change.
|
|
14767
|
-
* @param suffix Static value used for concatenation only.
|
|
14768
|
-
* @param sanitizer An optional sanitizer function
|
|
14769
|
-
* @returns itself, so that it may be chained.
|
|
14770
|
-
* @codeGenApi
|
|
14771
|
-
*/
|
|
14772
|
-
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14773
|
-
const lView = getLView();
|
|
14774
|
-
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14775
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14776
|
-
const tNode = getSelectedTNode();
|
|
14777
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14778
|
-
ngDevMode &&
|
|
14779
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14780
|
-
}
|
|
14781
|
-
return ɵɵattributeInterpolate4;
|
|
14782
|
-
}
|
|
14783
|
-
/**
|
|
14784
|
-
*
|
|
14785
|
-
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14786
|
-
*
|
|
14787
|
-
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14788
|
-
*
|
|
14789
|
-
* ```html
|
|
14790
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14791
|
-
* ```
|
|
14792
|
-
*
|
|
14793
|
-
* Its compiled representation is::
|
|
14794
|
-
*
|
|
14795
|
-
* ```ts
|
|
14796
|
-
* ɵɵattributeInterpolate5(
|
|
14797
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14798
|
-
* ```
|
|
14799
|
-
*
|
|
14800
|
-
* @param attrName The name of the attribute to update
|
|
14801
|
-
* @param prefix Static value used for concatenation only.
|
|
14802
|
-
* @param v0 Value checked for change.
|
|
14803
|
-
* @param i0 Static value used for concatenation only.
|
|
14804
|
-
* @param v1 Value checked for change.
|
|
14805
|
-
* @param i1 Static value used for concatenation only.
|
|
14806
|
-
* @param v2 Value checked for change.
|
|
14807
|
-
* @param i2 Static value used for concatenation only.
|
|
14808
|
-
* @param v3 Value checked for change.
|
|
14809
|
-
* @param i3 Static value used for concatenation only.
|
|
14810
|
-
* @param v4 Value checked for change.
|
|
14811
|
-
* @param suffix Static value used for concatenation only.
|
|
14812
|
-
* @param sanitizer An optional sanitizer function
|
|
14813
|
-
* @returns itself, so that it may be chained.
|
|
14814
|
-
* @codeGenApi
|
|
14815
|
-
*/
|
|
14816
|
-
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14817
|
-
const lView = getLView();
|
|
14818
|
-
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14819
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14820
|
-
const tNode = getSelectedTNode();
|
|
14821
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14822
|
-
ngDevMode &&
|
|
14823
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14824
|
-
}
|
|
14825
|
-
return ɵɵattributeInterpolate5;
|
|
14826
|
-
}
|
|
14827
|
-
/**
|
|
14828
|
-
*
|
|
14829
|
-
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14830
|
-
*
|
|
14831
|
-
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14832
|
-
*
|
|
14833
|
-
* ```html
|
|
14834
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14117
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14835
14118
|
* ```
|
|
14836
14119
|
*
|
|
14837
14120
|
* Its compiled representation is::
|
|
@@ -15011,6 +14294,57 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
|
|
|
15011
14294
|
return ɵɵattributeInterpolateV;
|
|
15012
14295
|
}
|
|
15013
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
|
+
/**
|
|
14331
|
+
* Used to perform change detection on the whole application.
|
|
14332
|
+
*
|
|
14333
|
+
* This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
|
|
14334
|
+
* executes lifecycle hooks and conditionally checks components based on their
|
|
14335
|
+
* `ChangeDetectionStrategy` and dirtiness.
|
|
14336
|
+
*
|
|
14337
|
+
* The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
|
|
14338
|
+
* schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
|
|
14339
|
+
* single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
|
|
14340
|
+
* be changed when calling `renderComponent` and providing the `scheduler` option.
|
|
14341
|
+
*/
|
|
14342
|
+
function tick(component) {
|
|
14343
|
+
const rootView = getRootView(component);
|
|
14344
|
+
const rootContext = rootView[CONTEXT];
|
|
14345
|
+
tickRootContext(rootContext);
|
|
14346
|
+
}
|
|
14347
|
+
|
|
15014
14348
|
/**
|
|
15015
14349
|
* @license
|
|
15016
14350
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -15555,51 +14889,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15555
14889
|
tNode.index;
|
|
15556
14890
|
// In order to match current behavior, native DOM event listeners must be added for all
|
|
15557
14891
|
// events (including outputs).
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15561
|
-
|
|
15562
|
-
|
|
15563
|
-
|
|
15564
|
-
|
|
15565
|
-
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15569
|
-
|
|
15570
|
-
|
|
15571
|
-
|
|
15572
|
-
|
|
15573
|
-
|
|
15574
|
-
|
|
15575
|
-
|
|
15576
|
-
|
|
15577
|
-
|
|
15578
|
-
|
|
15579
|
-
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
|
|
15586
|
-
|
|
15587
|
-
processOutputs = false;
|
|
15588
|
-
}
|
|
15589
|
-
else {
|
|
15590
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
15591
|
-
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15592
|
-
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15593
|
-
lCleanup.push(listenerFn, cleanupFn);
|
|
15594
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15595
|
-
}
|
|
14892
|
+
// There might be cases where multiple directives on the same element try to register an event
|
|
14893
|
+
// handler function for the same event. In this situation we want to avoid registration of
|
|
14894
|
+
// several native listeners as each registration would be intercepted by NgZone and
|
|
14895
|
+
// trigger change detection. This would mean that a single user action would result in several
|
|
14896
|
+
// change detections being invoked. To avoid this situation we want to have only one call to
|
|
14897
|
+
// native handler registration (for the same element and same type of event).
|
|
14898
|
+
//
|
|
14899
|
+
// In order to have just one native event handler in presence of multiple handler functions,
|
|
14900
|
+
// we just register a first handler function as a native event listener and then chain
|
|
14901
|
+
// (coalesce) other handler functions on top of the first native handler function.
|
|
14902
|
+
let existingListener = null;
|
|
14903
|
+
// Please note that the coalescing described here doesn't happen for events specifying an
|
|
14904
|
+
// alternative target (ex. (document:click)) - this is to keep backward compatibility with the
|
|
14905
|
+
// view engine.
|
|
14906
|
+
// Also, we don't have to search for existing listeners is there are no directives
|
|
14907
|
+
// matching on a given node as we can't register multiple event handlers for the same event in
|
|
14908
|
+
// a template (this would mean having duplicate attributes).
|
|
14909
|
+
if (!eventTargetResolver && isTNodeDirectiveHost) {
|
|
14910
|
+
existingListener = findExistingListener(tView, lView, eventName, tNode.index);
|
|
14911
|
+
}
|
|
14912
|
+
if (existingListener !== null) {
|
|
14913
|
+
// Attach a new listener to coalesced listeners list, maintaining the order in which
|
|
14914
|
+
// listeners are registered. For performance reasons, we keep a reference to the last
|
|
14915
|
+
// listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
|
|
14916
|
+
// the entire set each time we need to add a new listener.
|
|
14917
|
+
const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
|
|
14918
|
+
lastListenerFn.__ngNextListenerFn__ = listenerFn;
|
|
14919
|
+
existingListener.__ngLastListenerFn__ = listenerFn;
|
|
14920
|
+
processOutputs = false;
|
|
15596
14921
|
}
|
|
15597
14922
|
else {
|
|
15598
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn,
|
|
15599
|
-
|
|
14923
|
+
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
14924
|
+
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15600
14925
|
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15601
|
-
lCleanup.push(listenerFn);
|
|
15602
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex,
|
|
14926
|
+
lCleanup.push(listenerFn, cleanupFn);
|
|
14927
|
+
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15603
14928
|
}
|
|
15604
14929
|
}
|
|
15605
14930
|
else {
|
|
@@ -17673,7 +16998,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
|
|
|
17673
16998
|
valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
|
|
17674
16999
|
}
|
|
17675
17000
|
let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
|
|
17676
|
-
key === prop ? valueAtLViewIndex : undefined;
|
|
17001
|
+
(key === prop ? valueAtLViewIndex : undefined);
|
|
17677
17002
|
if (containsStatics && !isStylingValuePresent(currentValue)) {
|
|
17678
17003
|
currentValue = keyValueArrayGet(rawKey, prop);
|
|
17679
17004
|
}
|
|
@@ -19196,7 +18521,7 @@ function findLocaleData(locale) {
|
|
|
19196
18521
|
if (parentLocale === 'en') {
|
|
19197
18522
|
return localeEn;
|
|
19198
18523
|
}
|
|
19199
|
-
throw new
|
|
18524
|
+
throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
|
|
19200
18525
|
}
|
|
19201
18526
|
/**
|
|
19202
18527
|
* Retrieves the default currency code for the given locale.
|
|
@@ -21526,7 +20851,7 @@ function noComponentFactoryError(component) {
|
|
|
21526
20851
|
return error;
|
|
21527
20852
|
}
|
|
21528
20853
|
const ERROR_COMPONENT = 'ngComponent';
|
|
21529
|
-
function getComponent(error) {
|
|
20854
|
+
function getComponent$1(error) {
|
|
21530
20855
|
return error[ERROR_COMPONENT];
|
|
21531
20856
|
}
|
|
21532
20857
|
class _NullComponentFactoryResolver {
|
|
@@ -21710,14 +21035,6 @@ class Renderer2 {
|
|
|
21710
21035
|
* @nocollapse
|
|
21711
21036
|
*/
|
|
21712
21037
|
Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
|
|
21713
|
-
/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
|
|
21714
|
-
function getOrCreateRenderer2(lView) {
|
|
21715
|
-
const renderer = lView[RENDERER];
|
|
21716
|
-
if (ngDevMode && !isProceduralRenderer(renderer)) {
|
|
21717
|
-
throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
|
|
21718
|
-
}
|
|
21719
|
-
return renderer;
|
|
21720
|
-
}
|
|
21721
21038
|
/** Injects a Renderer2 for the current component. */
|
|
21722
21039
|
function injectRenderer2() {
|
|
21723
21040
|
// We need the Renderer to be based on the component that it's being injected into, however since
|
|
@@ -21725,7 +21042,7 @@ function injectRenderer2() {
|
|
|
21725
21042
|
const lView = getLView();
|
|
21726
21043
|
const tNode = getCurrentTNode();
|
|
21727
21044
|
const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
|
|
21728
|
-
return
|
|
21045
|
+
return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
|
|
21729
21046
|
}
|
|
21730
21047
|
|
|
21731
21048
|
/**
|
|
@@ -21772,7 +21089,7 @@ class Version {
|
|
|
21772
21089
|
/**
|
|
21773
21090
|
* @publicApi
|
|
21774
21091
|
*/
|
|
21775
|
-
const VERSION = new Version('14.1.0-next.
|
|
21092
|
+
const VERSION = new Version('14.1.0-next.4');
|
|
21776
21093
|
|
|
21777
21094
|
/**
|
|
21778
21095
|
* @license
|
|
@@ -22110,8 +21427,7 @@ class ViewRef$1 {
|
|
|
22110
21427
|
}
|
|
22111
21428
|
attachToViewContainerRef() {
|
|
22112
21429
|
if (this._appRef) {
|
|
22113
|
-
|
|
22114
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21430
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');
|
|
22115
21431
|
}
|
|
22116
21432
|
this._attachedToViewContainer = true;
|
|
22117
21433
|
}
|
|
@@ -22121,8 +21437,7 @@ class ViewRef$1 {
|
|
|
22121
21437
|
}
|
|
22122
21438
|
attachToAppRef(appRef) {
|
|
22123
21439
|
if (this._attachedToViewContainer) {
|
|
22124
|
-
|
|
22125
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21440
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
|
|
22126
21441
|
}
|
|
22127
21442
|
this._appRef = appRef;
|
|
22128
21443
|
}
|
|
@@ -22153,367 +21468,811 @@ class RootViewRef extends ViewRef$1 {
|
|
|
22153
21468
|
* Use of this source code is governed by an MIT-style license that can be
|
|
22154
21469
|
* found in the LICENSE file at https://angular.io/license
|
|
22155
21470
|
*/
|
|
22156
|
-
class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
|
|
22157
|
-
/**
|
|
22158
|
-
* @param ngModule The NgModuleRef to which all resolved factories are bound.
|
|
22159
|
-
*/
|
|
22160
|
-
constructor(ngModule) {
|
|
22161
|
-
super();
|
|
22162
|
-
this.ngModule = ngModule;
|
|
22163
|
-
}
|
|
22164
|
-
resolveComponentFactory(component) {
|
|
22165
|
-
ngDevMode && assertComponentType(component);
|
|
22166
|
-
const componentDef = getComponentDef(component);
|
|
22167
|
-
return new ComponentFactory(componentDef, this.ngModule);
|
|
22168
|
-
}
|
|
22169
|
-
}
|
|
22170
|
-
function toRefArray(map) {
|
|
22171
|
-
const array = [];
|
|
22172
|
-
for (let nonMinified in map) {
|
|
22173
|
-
if (map.hasOwnProperty(nonMinified)) {
|
|
22174
|
-
const minified = map[nonMinified];
|
|
22175
|
-
array.push({ propName: minified, templateName: nonMinified });
|
|
21471
|
+
class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
|
|
21472
|
+
/**
|
|
21473
|
+
* @param ngModule The NgModuleRef to which all resolved factories are bound.
|
|
21474
|
+
*/
|
|
21475
|
+
constructor(ngModule) {
|
|
21476
|
+
super();
|
|
21477
|
+
this.ngModule = ngModule;
|
|
21478
|
+
}
|
|
21479
|
+
resolveComponentFactory(component) {
|
|
21480
|
+
ngDevMode && assertComponentType(component);
|
|
21481
|
+
const componentDef = getComponentDef(component);
|
|
21482
|
+
return new ComponentFactory(componentDef, this.ngModule);
|
|
21483
|
+
}
|
|
21484
|
+
}
|
|
21485
|
+
function toRefArray(map) {
|
|
21486
|
+
const array = [];
|
|
21487
|
+
for (let nonMinified in map) {
|
|
21488
|
+
if (map.hasOwnProperty(nonMinified)) {
|
|
21489
|
+
const minified = map[nonMinified];
|
|
21490
|
+
array.push({ propName: minified, templateName: nonMinified });
|
|
21491
|
+
}
|
|
21492
|
+
}
|
|
21493
|
+
return array;
|
|
21494
|
+
}
|
|
21495
|
+
function getNamespace(elementName) {
|
|
21496
|
+
const name = elementName.toLowerCase();
|
|
21497
|
+
return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
|
|
21498
|
+
}
|
|
21499
|
+
/**
|
|
21500
|
+
* Injector that looks up a value using a specific injector, before falling back to the module
|
|
21501
|
+
* injector. Used primarily when creating components or embedded views dynamically.
|
|
21502
|
+
*/
|
|
21503
|
+
class ChainedInjector {
|
|
21504
|
+
constructor(injector, parentInjector) {
|
|
21505
|
+
this.injector = injector;
|
|
21506
|
+
this.parentInjector = parentInjector;
|
|
21507
|
+
}
|
|
21508
|
+
get(token, notFoundValue, flags) {
|
|
21509
|
+
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
|
|
21510
|
+
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
|
|
21511
|
+
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
21512
|
+
// Return the value from the root element injector when
|
|
21513
|
+
// - it provides it
|
|
21514
|
+
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21515
|
+
// - the module injector should not be checked
|
|
21516
|
+
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21517
|
+
return value;
|
|
21518
|
+
}
|
|
21519
|
+
return this.parentInjector.get(token, notFoundValue, flags);
|
|
21520
|
+
}
|
|
21521
|
+
}
|
|
21522
|
+
/**
|
|
21523
|
+
* Render3 implementation of {@link viewEngine_ComponentFactory}.
|
|
21524
|
+
*/
|
|
21525
|
+
class ComponentFactory extends ComponentFactory$1 {
|
|
21526
|
+
/**
|
|
21527
|
+
* @param componentDef The component definition.
|
|
21528
|
+
* @param ngModule The NgModuleRef to which the factory is bound.
|
|
21529
|
+
*/
|
|
21530
|
+
constructor(componentDef, ngModule) {
|
|
21531
|
+
super();
|
|
21532
|
+
this.componentDef = componentDef;
|
|
21533
|
+
this.ngModule = ngModule;
|
|
21534
|
+
this.componentType = componentDef.type;
|
|
21535
|
+
this.selector = stringifyCSSSelectorList(componentDef.selectors);
|
|
21536
|
+
this.ngContentSelectors =
|
|
21537
|
+
componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
|
|
21538
|
+
this.isBoundToModule = !!ngModule;
|
|
21539
|
+
}
|
|
21540
|
+
get inputs() {
|
|
21541
|
+
return toRefArray(this.componentDef.inputs);
|
|
21542
|
+
}
|
|
21543
|
+
get outputs() {
|
|
21544
|
+
return toRefArray(this.componentDef.outputs);
|
|
21545
|
+
}
|
|
21546
|
+
create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
|
|
21547
|
+
environmentInjector = environmentInjector || this.ngModule;
|
|
21548
|
+
let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
|
|
21549
|
+
environmentInjector :
|
|
21550
|
+
environmentInjector === null || environmentInjector === void 0 ? void 0 : environmentInjector.injector;
|
|
21551
|
+
if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
|
|
21552
|
+
realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
|
|
21553
|
+
realEnvironmentInjector;
|
|
21554
|
+
}
|
|
21555
|
+
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
|
|
21556
|
+
const rendererFactory = rootViewInjector.get(RendererFactory2, null);
|
|
21557
|
+
if (rendererFactory === null) {
|
|
21558
|
+
throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
|
|
21559
|
+
'Angular was not able to inject a renderer (RendererFactory2). ' +
|
|
21560
|
+
'Likely this is due to a broken DI hierarchy. ' +
|
|
21561
|
+
'Make sure that any injector used to create this component has a correct parent.');
|
|
21562
|
+
}
|
|
21563
|
+
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
21564
|
+
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
21565
|
+
// Determine a tag name used for creating host elements when this component is created
|
|
21566
|
+
// dynamically. Default to 'div' if this component did not specify any tag name in its selector.
|
|
21567
|
+
const elementName = this.componentDef.selectors[0][0] || 'div';
|
|
21568
|
+
const hostRNode = rootSelectorOrNode ?
|
|
21569
|
+
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
|
|
21570
|
+
createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
|
|
21571
|
+
const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
21572
|
+
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
21573
|
+
const rootContext = createRootContext();
|
|
21574
|
+
// Create the root view. Uses empty TView and ContentTemplate.
|
|
21575
|
+
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
21576
|
+
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
21577
|
+
// rootView is the parent when bootstrapping
|
|
21578
|
+
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
21579
|
+
// `renderView` does that. However as the code is written it is needed because
|
|
21580
|
+
// `createRootComponentView` and `createRootComponent` both read global state. Fixing those
|
|
21581
|
+
// issues would allow us to drop this.
|
|
21582
|
+
enterView(rootLView);
|
|
21583
|
+
let component;
|
|
21584
|
+
let tElementNode;
|
|
21585
|
+
try {
|
|
21586
|
+
const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
|
|
21587
|
+
if (hostRNode) {
|
|
21588
|
+
if (rootSelectorOrNode) {
|
|
21589
|
+
setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
|
|
21590
|
+
}
|
|
21591
|
+
else {
|
|
21592
|
+
// If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
|
|
21593
|
+
// is not defined), also apply attributes and classes extracted from component selector.
|
|
21594
|
+
// Extract attributes and classes from the first selector only to match VE behavior.
|
|
21595
|
+
const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
|
|
21596
|
+
if (attrs) {
|
|
21597
|
+
setUpAttributes(hostRenderer, hostRNode, attrs);
|
|
21598
|
+
}
|
|
21599
|
+
if (classes && classes.length > 0) {
|
|
21600
|
+
writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
|
|
21601
|
+
}
|
|
21602
|
+
}
|
|
21603
|
+
}
|
|
21604
|
+
tElementNode = getTNode(rootTView, HEADER_OFFSET);
|
|
21605
|
+
if (projectableNodes !== undefined) {
|
|
21606
|
+
const projection = tElementNode.projection = [];
|
|
21607
|
+
for (let i = 0; i < this.ngContentSelectors.length; i++) {
|
|
21608
|
+
const nodesforSlot = projectableNodes[i];
|
|
21609
|
+
// Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
|
|
21610
|
+
// case). Here we do normalize passed data structure to be an array of arrays to avoid
|
|
21611
|
+
// complex checks down the line.
|
|
21612
|
+
// We also normalize the length of the passed in projectable nodes (to match the number of
|
|
21613
|
+
// <ng-container> slots defined by a component).
|
|
21614
|
+
projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
|
|
21615
|
+
}
|
|
21616
|
+
}
|
|
21617
|
+
// TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
|
|
21618
|
+
// executed here?
|
|
21619
|
+
// Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
|
|
21620
|
+
component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
|
|
21621
|
+
renderView(rootTView, rootLView, null);
|
|
21622
|
+
}
|
|
21623
|
+
finally {
|
|
21624
|
+
leaveView();
|
|
21625
|
+
}
|
|
21626
|
+
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
21627
|
+
}
|
|
21628
|
+
}
|
|
21629
|
+
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21630
|
+
/**
|
|
21631
|
+
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
21632
|
+
* ComponentFactoryResolver
|
|
21633
|
+
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21634
|
+
*
|
|
21635
|
+
* @returns The ComponentFactoryResolver instance to use
|
|
21636
|
+
*/
|
|
21637
|
+
function injectComponentFactoryResolver() {
|
|
21638
|
+
return componentFactoryResolver;
|
|
21639
|
+
}
|
|
21640
|
+
/**
|
|
21641
|
+
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
21642
|
+
*
|
|
21643
|
+
* `ComponentRef` provides access to the Component Instance as well other objects related to this
|
|
21644
|
+
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
|
|
21645
|
+
* method.
|
|
21646
|
+
*
|
|
21647
|
+
*/
|
|
21648
|
+
class ComponentRef extends ComponentRef$1 {
|
|
21649
|
+
constructor(componentType, instance, location, _rootLView, _tNode) {
|
|
21650
|
+
super();
|
|
21651
|
+
this.location = location;
|
|
21652
|
+
this._rootLView = _rootLView;
|
|
21653
|
+
this._tNode = _tNode;
|
|
21654
|
+
this.instance = instance;
|
|
21655
|
+
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
21656
|
+
this.componentType = componentType;
|
|
21657
|
+
}
|
|
21658
|
+
setInput(name, value) {
|
|
21659
|
+
const inputData = this._tNode.inputs;
|
|
21660
|
+
let dataValue;
|
|
21661
|
+
if (inputData !== null && (dataValue = inputData[name])) {
|
|
21662
|
+
const lView = this._rootLView;
|
|
21663
|
+
setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
|
|
21664
|
+
markDirtyIfOnPush(lView, this._tNode.index);
|
|
21665
|
+
}
|
|
21666
|
+
else {
|
|
21667
|
+
if (ngDevMode) {
|
|
21668
|
+
const cmpNameForError = stringifyForError(this.componentType);
|
|
21669
|
+
let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
|
|
21670
|
+
message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
|
|
21671
|
+
reportUnknownPropertyError(message);
|
|
21672
|
+
}
|
|
21673
|
+
}
|
|
21674
|
+
}
|
|
21675
|
+
get injector() {
|
|
21676
|
+
return new NodeInjector(this._tNode, this._rootLView);
|
|
21677
|
+
}
|
|
21678
|
+
destroy() {
|
|
21679
|
+
this.hostView.destroy();
|
|
21680
|
+
}
|
|
21681
|
+
onDestroy(callback) {
|
|
21682
|
+
this.hostView.onDestroy(callback);
|
|
21683
|
+
}
|
|
21684
|
+
}
|
|
21685
|
+
|
|
21686
|
+
/**
|
|
21687
|
+
* @license
|
|
21688
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21689
|
+
*
|
|
21690
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21691
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21692
|
+
*/
|
|
21693
|
+
/**
|
|
21694
|
+
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
21695
|
+
* @param ngModule NgModule class.
|
|
21696
|
+
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
21697
|
+
* not provided, `NullInjector` will be used instead.
|
|
21698
|
+
* @publicApi
|
|
21699
|
+
*/
|
|
21700
|
+
function createNgModuleRef(ngModule, parentInjector) {
|
|
21701
|
+
return new NgModuleRef(ngModule, parentInjector !== null && parentInjector !== void 0 ? parentInjector : null);
|
|
21702
|
+
}
|
|
21703
|
+
class NgModuleRef extends NgModuleRef$1 {
|
|
21704
|
+
constructor(ngModuleType, _parent) {
|
|
21705
|
+
super();
|
|
21706
|
+
this._parent = _parent;
|
|
21707
|
+
// tslint:disable-next-line:require-internal-with-underscore
|
|
21708
|
+
this._bootstrapComponents = [];
|
|
21709
|
+
this.injector = this;
|
|
21710
|
+
this.destroyCbs = [];
|
|
21711
|
+
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
21712
|
+
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
21713
|
+
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
21714
|
+
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
21715
|
+
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
21716
|
+
// and providing it, rather than letting the injector resolve it.
|
|
21717
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21718
|
+
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
21719
|
+
ngDevMode &&
|
|
21720
|
+
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
21721
|
+
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
21722
|
+
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
21723
|
+
{ provide: NgModuleRef$1, useValue: this }, {
|
|
21724
|
+
provide: ComponentFactoryResolver$1,
|
|
21725
|
+
useValue: this.componentFactoryResolver
|
|
21726
|
+
}
|
|
21727
|
+
], stringify(ngModuleType), new Set(['environment']));
|
|
21728
|
+
// We need to resolve the injector types separately from the injector creation, because
|
|
21729
|
+
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21730
|
+
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21731
|
+
this._r3Injector.resolveInjectorInitializers();
|
|
21732
|
+
this.instance = this.get(ngModuleType);
|
|
21733
|
+
}
|
|
21734
|
+
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
21735
|
+
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
21736
|
+
return this;
|
|
21737
|
+
}
|
|
21738
|
+
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
21739
|
+
}
|
|
21740
|
+
runInContext(fn) {
|
|
21741
|
+
return this.injector.runInContext(fn);
|
|
21742
|
+
}
|
|
21743
|
+
destroy() {
|
|
21744
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21745
|
+
const injector = this._r3Injector;
|
|
21746
|
+
!injector.destroyed && injector.destroy();
|
|
21747
|
+
this.destroyCbs.forEach(fn => fn());
|
|
21748
|
+
this.destroyCbs = null;
|
|
21749
|
+
}
|
|
21750
|
+
onDestroy(callback) {
|
|
21751
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21752
|
+
this.destroyCbs.push(callback);
|
|
21753
|
+
}
|
|
21754
|
+
}
|
|
21755
|
+
class NgModuleFactory extends NgModuleFactory$1 {
|
|
21756
|
+
constructor(moduleType) {
|
|
21757
|
+
super();
|
|
21758
|
+
this.moduleType = moduleType;
|
|
21759
|
+
}
|
|
21760
|
+
create(parentInjector) {
|
|
21761
|
+
return new NgModuleRef(this.moduleType, parentInjector);
|
|
21762
|
+
}
|
|
21763
|
+
}
|
|
21764
|
+
class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
21765
|
+
constructor(providers, parent, source) {
|
|
21766
|
+
super();
|
|
21767
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21768
|
+
this.instance = null;
|
|
21769
|
+
const injector = new R3Injector([
|
|
21770
|
+
...providers,
|
|
21771
|
+
{ provide: NgModuleRef$1, useValue: this },
|
|
21772
|
+
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
21773
|
+
], parent || getNullInjector(), source, new Set(['environment']));
|
|
21774
|
+
this.injector = injector;
|
|
21775
|
+
injector.resolveInjectorInitializers();
|
|
21776
|
+
}
|
|
21777
|
+
destroy() {
|
|
21778
|
+
this.injector.destroy();
|
|
21779
|
+
}
|
|
21780
|
+
onDestroy(callback) {
|
|
21781
|
+
this.injector.onDestroy(callback);
|
|
21782
|
+
}
|
|
21783
|
+
}
|
|
21784
|
+
/**
|
|
21785
|
+
* Create a new environment injector.
|
|
21786
|
+
*
|
|
21787
|
+
* Learn more about environment injectors in
|
|
21788
|
+
* [this guide](guide/standalone-components#environment-injectors).
|
|
21789
|
+
*
|
|
21790
|
+
* @param providers An array of providers.
|
|
21791
|
+
* @param parent A parent environment injector.
|
|
21792
|
+
* @param debugName An optional name for this injector instance, which will be used in error
|
|
21793
|
+
* messages.
|
|
21794
|
+
*
|
|
21795
|
+
* @publicApi
|
|
21796
|
+
* @developerPreview
|
|
21797
|
+
*/
|
|
21798
|
+
function createEnvironmentInjector(providers, parent, debugName = null) {
|
|
21799
|
+
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
21800
|
+
return adapter.injector;
|
|
21801
|
+
}
|
|
21802
|
+
|
|
21803
|
+
/**
|
|
21804
|
+
* @license
|
|
21805
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21806
|
+
*
|
|
21807
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21808
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21809
|
+
*/
|
|
21810
|
+
/**
|
|
21811
|
+
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
21812
|
+
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
21813
|
+
* collected from the imports graph rooted at a given standalone component.
|
|
21814
|
+
*/
|
|
21815
|
+
class StandaloneService {
|
|
21816
|
+
constructor(_injector) {
|
|
21817
|
+
this._injector = _injector;
|
|
21818
|
+
this.cachedInjectors = new Map();
|
|
21819
|
+
}
|
|
21820
|
+
getOrCreateStandaloneInjector(componentDef) {
|
|
21821
|
+
if (!componentDef.standalone) {
|
|
21822
|
+
return null;
|
|
21823
|
+
}
|
|
21824
|
+
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
21825
|
+
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
21826
|
+
const standaloneInjector = providers.length > 0 ?
|
|
21827
|
+
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
21828
|
+
null;
|
|
21829
|
+
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
21830
|
+
}
|
|
21831
|
+
return this.cachedInjectors.get(componentDef.id);
|
|
21832
|
+
}
|
|
21833
|
+
ngOnDestroy() {
|
|
21834
|
+
try {
|
|
21835
|
+
for (const injector of this.cachedInjectors.values()) {
|
|
21836
|
+
if (injector !== null) {
|
|
21837
|
+
injector.destroy();
|
|
21838
|
+
}
|
|
21839
|
+
}
|
|
21840
|
+
}
|
|
21841
|
+
finally {
|
|
21842
|
+
this.cachedInjectors.clear();
|
|
21843
|
+
}
|
|
21844
|
+
}
|
|
21845
|
+
}
|
|
21846
|
+
/** @nocollapse */
|
|
21847
|
+
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
21848
|
+
token: StandaloneService,
|
|
21849
|
+
providedIn: 'environment',
|
|
21850
|
+
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
21851
|
+
});
|
|
21852
|
+
/**
|
|
21853
|
+
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
21854
|
+
*
|
|
21855
|
+
* The most important responsaibility of this feature is to expose the "getStandaloneInjector"
|
|
21856
|
+
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
21857
|
+
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
21858
|
+
* is tree-shakable and not included in applications that don't use standalone components.
|
|
21859
|
+
*
|
|
21860
|
+
* @codeGenApi
|
|
21861
|
+
*/
|
|
21862
|
+
function ɵɵStandaloneFeature(definition) {
|
|
21863
|
+
definition.getStandaloneInjector = (parentInjector) => {
|
|
21864
|
+
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
|
|
21865
|
+
};
|
|
21866
|
+
}
|
|
21867
|
+
|
|
21868
|
+
/**
|
|
21869
|
+
* @license
|
|
21870
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21871
|
+
*
|
|
21872
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21873
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21874
|
+
*/
|
|
21875
|
+
/**
|
|
21876
|
+
* Retrieves the component instance associated with a given DOM element.
|
|
21877
|
+
*
|
|
21878
|
+
* @usageNotes
|
|
21879
|
+
* Given the following DOM structure:
|
|
21880
|
+
*
|
|
21881
|
+
* ```html
|
|
21882
|
+
* <app-root>
|
|
21883
|
+
* <div>
|
|
21884
|
+
* <child-comp></child-comp>
|
|
21885
|
+
* </div>
|
|
21886
|
+
* </app-root>
|
|
21887
|
+
* ```
|
|
21888
|
+
*
|
|
21889
|
+
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
21890
|
+
* associated with this DOM element.
|
|
21891
|
+
*
|
|
21892
|
+
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
21893
|
+
*
|
|
21894
|
+
*
|
|
21895
|
+
* @param element DOM element from which the component should be retrieved.
|
|
21896
|
+
* @returns Component instance associated with the element or `null` if there
|
|
21897
|
+
* is no component associated with it.
|
|
21898
|
+
*
|
|
21899
|
+
* @publicApi
|
|
21900
|
+
* @globalApi ng
|
|
21901
|
+
*/
|
|
21902
|
+
function getComponent(element) {
|
|
21903
|
+
ngDevMode && assertDomElement(element);
|
|
21904
|
+
const context = getLContext(element);
|
|
21905
|
+
if (context === null)
|
|
21906
|
+
return null;
|
|
21907
|
+
if (context.component === undefined) {
|
|
21908
|
+
const lView = context.lView;
|
|
21909
|
+
if (lView === null) {
|
|
21910
|
+
return null;
|
|
22176
21911
|
}
|
|
21912
|
+
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
22177
21913
|
}
|
|
22178
|
-
return
|
|
21914
|
+
return context.component;
|
|
22179
21915
|
}
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
21916
|
+
/**
|
|
21917
|
+
* If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
|
|
21918
|
+
* view that the element is part of. Otherwise retrieves the instance of the component whose view
|
|
21919
|
+
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
21920
|
+
*
|
|
21921
|
+
* @param element Element for which to get the surrounding component instance.
|
|
21922
|
+
* @returns Instance of the component that is around the element or null if the element isn't
|
|
21923
|
+
* inside any component.
|
|
21924
|
+
*
|
|
21925
|
+
* @publicApi
|
|
21926
|
+
* @globalApi ng
|
|
21927
|
+
*/
|
|
21928
|
+
function getContext(element) {
|
|
21929
|
+
assertDomElement(element);
|
|
21930
|
+
const context = getLContext(element);
|
|
21931
|
+
const lView = context ? context.lView : null;
|
|
21932
|
+
return lView === null ? null : lView[CONTEXT];
|
|
22183
21933
|
}
|
|
22184
21934
|
/**
|
|
22185
|
-
*
|
|
22186
|
-
*
|
|
21935
|
+
* Retrieves the component instance whose view contains the DOM element.
|
|
21936
|
+
*
|
|
21937
|
+
* For example, if `<child-comp>` is used in the template of `<app-comp>`
|
|
21938
|
+
* (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
|
|
21939
|
+
* would return `<app-comp>`.
|
|
21940
|
+
*
|
|
21941
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21942
|
+
* for which to retrieve the root components.
|
|
21943
|
+
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
21944
|
+
* part of a component view.
|
|
21945
|
+
*
|
|
21946
|
+
* @publicApi
|
|
21947
|
+
* @globalApi ng
|
|
22187
21948
|
*/
|
|
22188
|
-
|
|
22189
|
-
|
|
22190
|
-
|
|
22191
|
-
|
|
22192
|
-
|
|
22193
|
-
|
|
22194
|
-
|
|
22195
|
-
|
|
22196
|
-
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
22197
|
-
// Return the value from the root element injector when
|
|
22198
|
-
// - it provides it
|
|
22199
|
-
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
22200
|
-
// - the module injector should not be checked
|
|
22201
|
-
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
22202
|
-
return value;
|
|
22203
|
-
}
|
|
22204
|
-
return this.parentInjector.get(token, notFoundValue, flags);
|
|
21949
|
+
function getOwningComponent(elementOrDir) {
|
|
21950
|
+
const context = getLContext(elementOrDir);
|
|
21951
|
+
let lView = context ? context.lView : null;
|
|
21952
|
+
if (lView === null)
|
|
21953
|
+
return null;
|
|
21954
|
+
let parent;
|
|
21955
|
+
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
21956
|
+
lView = parent;
|
|
22205
21957
|
}
|
|
21958
|
+
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
22206
21959
|
}
|
|
22207
21960
|
/**
|
|
22208
|
-
*
|
|
21961
|
+
* Retrieves all root components associated with a DOM element, directive or component instance.
|
|
21962
|
+
* Root components are those which have been bootstrapped by Angular.
|
|
21963
|
+
*
|
|
21964
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21965
|
+
* for which to retrieve the root components.
|
|
21966
|
+
* @returns Root components associated with the target object.
|
|
21967
|
+
*
|
|
21968
|
+
* @publicApi
|
|
21969
|
+
* @globalApi ng
|
|
22209
21970
|
*/
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22217
|
-
|
|
22218
|
-
|
|
22219
|
-
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
|
|
22239
|
-
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22243
|
-
|
|
22244
|
-
|
|
22245
|
-
|
|
22246
|
-
|
|
22247
|
-
|
|
22248
|
-
|
|
22249
|
-
|
|
22250
|
-
|
|
22251
|
-
|
|
22252
|
-
|
|
22253
|
-
|
|
22254
|
-
|
|
22255
|
-
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
22256
|
-
// rootView is the parent when bootstrapping
|
|
22257
|
-
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
22258
|
-
// `renderView` does that. However as the code is written it is needed because
|
|
22259
|
-
// `createRootComponentView` and `createRootComponent` both read global state. Fixing those
|
|
22260
|
-
// issues would allow us to drop this.
|
|
22261
|
-
enterView(rootLView);
|
|
22262
|
-
let component;
|
|
22263
|
-
let tElementNode;
|
|
22264
|
-
try {
|
|
22265
|
-
const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
|
|
22266
|
-
if (hostRNode) {
|
|
22267
|
-
if (rootSelectorOrNode) {
|
|
22268
|
-
setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
|
|
22269
|
-
}
|
|
22270
|
-
else {
|
|
22271
|
-
// If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
|
|
22272
|
-
// is not defined), also apply attributes and classes extracted from component selector.
|
|
22273
|
-
// Extract attributes and classes from the first selector only to match VE behavior.
|
|
22274
|
-
const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
|
|
22275
|
-
if (attrs) {
|
|
22276
|
-
setUpAttributes(hostRenderer, hostRNode, attrs);
|
|
22277
|
-
}
|
|
22278
|
-
if (classes && classes.length > 0) {
|
|
22279
|
-
writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
|
|
22280
|
-
}
|
|
22281
|
-
}
|
|
22282
|
-
}
|
|
22283
|
-
tElementNode = getTNode(rootTView, HEADER_OFFSET);
|
|
22284
|
-
if (projectableNodes !== undefined) {
|
|
22285
|
-
const projection = tElementNode.projection = [];
|
|
22286
|
-
for (let i = 0; i < this.ngContentSelectors.length; i++) {
|
|
22287
|
-
const nodesforSlot = projectableNodes[i];
|
|
22288
|
-
// Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
|
|
22289
|
-
// case). Here we do normalize passed data structure to be an array of arrays to avoid
|
|
22290
|
-
// complex checks down the line.
|
|
22291
|
-
// We also normalize the length of the passed in projectable nodes (to match the number of
|
|
22292
|
-
// <ng-container> slots defined by a component).
|
|
22293
|
-
projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
|
|
22294
|
-
}
|
|
22295
|
-
}
|
|
22296
|
-
// TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
|
|
22297
|
-
// executed here?
|
|
22298
|
-
// Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
|
|
22299
|
-
component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
|
|
22300
|
-
renderView(rootTView, rootLView, null);
|
|
22301
|
-
}
|
|
22302
|
-
finally {
|
|
22303
|
-
leaveView();
|
|
21971
|
+
function getRootComponents(elementOrDir) {
|
|
21972
|
+
const lView = readPatchedLView(elementOrDir);
|
|
21973
|
+
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
21974
|
+
}
|
|
21975
|
+
/**
|
|
21976
|
+
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
21977
|
+
*
|
|
21978
|
+
* @param elementOrDir DOM element, component or directive instance for which to
|
|
21979
|
+
* retrieve the injector.
|
|
21980
|
+
* @returns Injector associated with the element, component or directive instance.
|
|
21981
|
+
*
|
|
21982
|
+
* @publicApi
|
|
21983
|
+
* @globalApi ng
|
|
21984
|
+
*/
|
|
21985
|
+
function getInjector(elementOrDir) {
|
|
21986
|
+
const context = getLContext(elementOrDir);
|
|
21987
|
+
const lView = context ? context.lView : null;
|
|
21988
|
+
if (lView === null)
|
|
21989
|
+
return Injector.NULL;
|
|
21990
|
+
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
21991
|
+
return new NodeInjector(tNode, lView);
|
|
21992
|
+
}
|
|
21993
|
+
/**
|
|
21994
|
+
* Retrieve a set of injection tokens at a given DOM node.
|
|
21995
|
+
*
|
|
21996
|
+
* @param element Element for which the injection tokens should be retrieved.
|
|
21997
|
+
*/
|
|
21998
|
+
function getInjectionTokens(element) {
|
|
21999
|
+
const context = getLContext(element);
|
|
22000
|
+
const lView = context ? context.lView : null;
|
|
22001
|
+
if (lView === null)
|
|
22002
|
+
return [];
|
|
22003
|
+
const tView = lView[TVIEW];
|
|
22004
|
+
const tNode = tView.data[context.nodeIndex];
|
|
22005
|
+
const providerTokens = [];
|
|
22006
|
+
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
22007
|
+
const endIndex = tNode.directiveEnd;
|
|
22008
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
22009
|
+
let value = tView.data[i];
|
|
22010
|
+
if (isDirectiveDefHack(value)) {
|
|
22011
|
+
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
22012
|
+
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
22013
|
+
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
22014
|
+
// is that we should always be storing injectable type in this location.
|
|
22015
|
+
value = value.type;
|
|
22304
22016
|
}
|
|
22305
|
-
|
|
22017
|
+
providerTokens.push(value);
|
|
22306
22018
|
}
|
|
22019
|
+
return providerTokens;
|
|
22307
22020
|
}
|
|
22308
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
22309
22021
|
/**
|
|
22310
|
-
*
|
|
22311
|
-
*
|
|
22312
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
22022
|
+
* Retrieves directive instances associated with a given DOM node. Does not include
|
|
22023
|
+
* component instances.
|
|
22313
22024
|
*
|
|
22314
|
-
* @
|
|
22025
|
+
* @usageNotes
|
|
22026
|
+
* Given the following DOM structure:
|
|
22027
|
+
*
|
|
22028
|
+
* ```html
|
|
22029
|
+
* <app-root>
|
|
22030
|
+
* <button my-button></button>
|
|
22031
|
+
* <my-comp></my-comp>
|
|
22032
|
+
* </app-root>
|
|
22033
|
+
* ```
|
|
22034
|
+
*
|
|
22035
|
+
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
22036
|
+
* directive that is associated with the DOM node.
|
|
22037
|
+
*
|
|
22038
|
+
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
22039
|
+
*
|
|
22040
|
+
* @param node DOM node for which to get the directives.
|
|
22041
|
+
* @returns Array of directives associated with the node.
|
|
22042
|
+
*
|
|
22043
|
+
* @publicApi
|
|
22044
|
+
* @globalApi ng
|
|
22315
22045
|
*/
|
|
22316
|
-
function
|
|
22317
|
-
|
|
22046
|
+
function getDirectives(node) {
|
|
22047
|
+
// Skip text nodes because we can't have directives associated with them.
|
|
22048
|
+
if (node instanceof Text) {
|
|
22049
|
+
return [];
|
|
22050
|
+
}
|
|
22051
|
+
const context = getLContext(node);
|
|
22052
|
+
const lView = context ? context.lView : null;
|
|
22053
|
+
if (lView === null) {
|
|
22054
|
+
return [];
|
|
22055
|
+
}
|
|
22056
|
+
const tView = lView[TVIEW];
|
|
22057
|
+
const nodeIndex = context.nodeIndex;
|
|
22058
|
+
if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
|
|
22059
|
+
return [];
|
|
22060
|
+
}
|
|
22061
|
+
if (context.directives === undefined) {
|
|
22062
|
+
context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
|
|
22063
|
+
}
|
|
22064
|
+
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
22065
|
+
// result so we don't expose an internal data structure in the user's console.
|
|
22066
|
+
return context.directives === null ? [] : [...context.directives];
|
|
22318
22067
|
}
|
|
22319
22068
|
/**
|
|
22320
|
-
*
|
|
22069
|
+
* Returns the debug (partial) metadata for a particular directive or component instance.
|
|
22070
|
+
* The function accepts an instance of a directive or component and returns the corresponding
|
|
22071
|
+
* metadata.
|
|
22321
22072
|
*
|
|
22322
|
-
*
|
|
22323
|
-
*
|
|
22324
|
-
* method.
|
|
22073
|
+
* @param directiveOrComponentInstance Instance of a directive or component
|
|
22074
|
+
* @returns metadata of the passed directive or component
|
|
22325
22075
|
*
|
|
22076
|
+
* @publicApi
|
|
22077
|
+
* @globalApi ng
|
|
22326
22078
|
*/
|
|
22327
|
-
|
|
22328
|
-
|
|
22329
|
-
|
|
22330
|
-
|
|
22331
|
-
this._rootLView = _rootLView;
|
|
22332
|
-
this._tNode = _tNode;
|
|
22333
|
-
this.instance = instance;
|
|
22334
|
-
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
22335
|
-
this.componentType = componentType;
|
|
22336
|
-
}
|
|
22337
|
-
get injector() {
|
|
22338
|
-
return new NodeInjector(this._tNode, this._rootLView);
|
|
22079
|
+
function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
22080
|
+
const { constructor } = directiveOrComponentInstance;
|
|
22081
|
+
if (!constructor) {
|
|
22082
|
+
throw new Error('Unable to find the instance constructor');
|
|
22339
22083
|
}
|
|
22340
|
-
|
|
22341
|
-
|
|
22084
|
+
// In case a component inherits from a directive, we may have component and directive metadata
|
|
22085
|
+
// To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
|
|
22086
|
+
const componentDef = getComponentDef(constructor);
|
|
22087
|
+
if (componentDef) {
|
|
22088
|
+
return {
|
|
22089
|
+
inputs: componentDef.inputs,
|
|
22090
|
+
outputs: componentDef.outputs,
|
|
22091
|
+
encapsulation: componentDef.encapsulation,
|
|
22092
|
+
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
|
|
22093
|
+
ChangeDetectionStrategy.Default
|
|
22094
|
+
};
|
|
22342
22095
|
}
|
|
22343
|
-
|
|
22344
|
-
|
|
22096
|
+
const directiveDef = getDirectiveDef(constructor);
|
|
22097
|
+
if (directiveDef) {
|
|
22098
|
+
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
22345
22099
|
}
|
|
22100
|
+
return null;
|
|
22346
22101
|
}
|
|
22347
|
-
|
|
22348
22102
|
/**
|
|
22349
|
-
*
|
|
22350
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22103
|
+
* Retrieve map of local references.
|
|
22351
22104
|
*
|
|
22352
|
-
*
|
|
22353
|
-
*
|
|
22105
|
+
* The references are retrieved as a map of local reference name to element or directive instance.
|
|
22106
|
+
*
|
|
22107
|
+
* @param target DOM element, component or directive instance for which to retrieve
|
|
22108
|
+
* the local references.
|
|
22354
22109
|
*/
|
|
22110
|
+
function getLocalRefs(target) {
|
|
22111
|
+
const context = getLContext(target);
|
|
22112
|
+
if (context === null)
|
|
22113
|
+
return {};
|
|
22114
|
+
if (context.localRefs === undefined) {
|
|
22115
|
+
const lView = context.lView;
|
|
22116
|
+
if (lView === null) {
|
|
22117
|
+
return {};
|
|
22118
|
+
}
|
|
22119
|
+
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
22120
|
+
}
|
|
22121
|
+
return context.localRefs || {};
|
|
22122
|
+
}
|
|
22355
22123
|
/**
|
|
22356
|
-
*
|
|
22357
|
-
*
|
|
22358
|
-
*
|
|
22359
|
-
*
|
|
22124
|
+
* Retrieves the host element of a component or directive instance.
|
|
22125
|
+
* The host element is the DOM element that matched the selector of the directive.
|
|
22126
|
+
*
|
|
22127
|
+
* @param componentOrDirective Component or directive instance for which the host
|
|
22128
|
+
* element should be retrieved.
|
|
22129
|
+
* @returns Host element of the target.
|
|
22130
|
+
*
|
|
22360
22131
|
* @publicApi
|
|
22132
|
+
* @globalApi ng
|
|
22361
22133
|
*/
|
|
22362
|
-
function
|
|
22363
|
-
return
|
|
22134
|
+
function getHostElement(componentOrDirective) {
|
|
22135
|
+
return getLContext(componentOrDirective).native;
|
|
22364
22136
|
}
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
|
|
22377
|
-
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22381
|
-
|
|
22382
|
-
|
|
22383
|
-
|
|
22384
|
-
|
|
22385
|
-
|
|
22386
|
-
|
|
22387
|
-
|
|
22137
|
+
/**
|
|
22138
|
+
* Retrieves the rendered text for a given component.
|
|
22139
|
+
*
|
|
22140
|
+
* This function retrieves the host element of a component and
|
|
22141
|
+
* and then returns the `textContent` for that element. This implies
|
|
22142
|
+
* that the text returned will include re-projected content of
|
|
22143
|
+
* the component as well.
|
|
22144
|
+
*
|
|
22145
|
+
* @param component The component to return the content text for.
|
|
22146
|
+
*/
|
|
22147
|
+
function getRenderedText(component) {
|
|
22148
|
+
const hostElement = getHostElement(component);
|
|
22149
|
+
return hostElement.textContent || '';
|
|
22150
|
+
}
|
|
22151
|
+
/**
|
|
22152
|
+
* Retrieves a list of event listeners associated with a DOM element. The list does include host
|
|
22153
|
+
* listeners, but it does not include event listeners defined outside of the Angular context
|
|
22154
|
+
* (e.g. through `addEventListener`).
|
|
22155
|
+
*
|
|
22156
|
+
* @usageNotes
|
|
22157
|
+
* Given the following DOM structure:
|
|
22158
|
+
*
|
|
22159
|
+
* ```html
|
|
22160
|
+
* <app-root>
|
|
22161
|
+
* <div (click)="doSomething()"></div>
|
|
22162
|
+
* </app-root>
|
|
22163
|
+
* ```
|
|
22164
|
+
*
|
|
22165
|
+
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
22166
|
+
*
|
|
22167
|
+
* ```ts
|
|
22168
|
+
* {
|
|
22169
|
+
* name: 'click',
|
|
22170
|
+
* element: <div>,
|
|
22171
|
+
* callback: () => doSomething(),
|
|
22172
|
+
* useCapture: false
|
|
22173
|
+
* }
|
|
22174
|
+
* ```
|
|
22175
|
+
*
|
|
22176
|
+
* @param element Element for which the DOM listeners should be retrieved.
|
|
22177
|
+
* @returns Array of event listeners on the DOM element.
|
|
22178
|
+
*
|
|
22179
|
+
* @publicApi
|
|
22180
|
+
* @globalApi ng
|
|
22181
|
+
*/
|
|
22182
|
+
function getListeners(element) {
|
|
22183
|
+
ngDevMode && assertDomElement(element);
|
|
22184
|
+
const lContext = getLContext(element);
|
|
22185
|
+
const lView = lContext === null ? null : lContext.lView;
|
|
22186
|
+
if (lView === null)
|
|
22187
|
+
return [];
|
|
22188
|
+
const tView = lView[TVIEW];
|
|
22189
|
+
const lCleanup = lView[CLEANUP];
|
|
22190
|
+
const tCleanup = tView.cleanup;
|
|
22191
|
+
const listeners = [];
|
|
22192
|
+
if (tCleanup && lCleanup) {
|
|
22193
|
+
for (let i = 0; i < tCleanup.length;) {
|
|
22194
|
+
const firstParam = tCleanup[i++];
|
|
22195
|
+
const secondParam = tCleanup[i++];
|
|
22196
|
+
if (typeof firstParam === 'string') {
|
|
22197
|
+
const name = firstParam;
|
|
22198
|
+
const listenerElement = unwrapRNode(lView[secondParam]);
|
|
22199
|
+
const callback = lCleanup[tCleanup[i++]];
|
|
22200
|
+
const useCaptureOrIndx = tCleanup[i++];
|
|
22201
|
+
// if useCaptureOrIndx is boolean then report it as is.
|
|
22202
|
+
// if useCaptureOrIndx is positive number then it in unsubscribe method
|
|
22203
|
+
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
22204
|
+
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
22205
|
+
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
22206
|
+
if (element == listenerElement) {
|
|
22207
|
+
listeners.push({ element, name, callback, useCapture, type });
|
|
22208
|
+
}
|
|
22388
22209
|
}
|
|
22389
|
-
], stringify(ngModuleType), new Set(['environment']));
|
|
22390
|
-
// We need to resolve the injector types separately from the injector creation, because
|
|
22391
|
-
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
22392
|
-
// circular error that will eventually error out, because the injector isn't created yet.
|
|
22393
|
-
this._r3Injector.resolveInjectorInitializers();
|
|
22394
|
-
this.instance = this.get(ngModuleType);
|
|
22395
|
-
}
|
|
22396
|
-
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
22397
|
-
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
22398
|
-
return this;
|
|
22399
22210
|
}
|
|
22400
|
-
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
22401
|
-
}
|
|
22402
|
-
destroy() {
|
|
22403
|
-
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
22404
|
-
const injector = this._r3Injector;
|
|
22405
|
-
!injector.destroyed && injector.destroy();
|
|
22406
|
-
this.destroyCbs.forEach(fn => fn());
|
|
22407
|
-
this.destroyCbs = null;
|
|
22408
|
-
}
|
|
22409
|
-
onDestroy(callback) {
|
|
22410
|
-
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
22411
|
-
this.destroyCbs.push(callback);
|
|
22412
|
-
}
|
|
22413
|
-
}
|
|
22414
|
-
class NgModuleFactory extends NgModuleFactory$1 {
|
|
22415
|
-
constructor(moduleType) {
|
|
22416
|
-
super();
|
|
22417
|
-
this.moduleType = moduleType;
|
|
22418
|
-
}
|
|
22419
|
-
create(parentInjector) {
|
|
22420
|
-
return new NgModuleRef(this.moduleType, parentInjector);
|
|
22421
22211
|
}
|
|
22212
|
+
listeners.sort(sortListeners);
|
|
22213
|
+
return listeners;
|
|
22422
22214
|
}
|
|
22423
|
-
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
this.instance = null;
|
|
22428
|
-
const injector = new R3Injector([
|
|
22429
|
-
...providers,
|
|
22430
|
-
{ provide: NgModuleRef$1, useValue: this },
|
|
22431
|
-
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
22432
|
-
], parent || getNullInjector(), source, new Set(['environment']));
|
|
22433
|
-
this.injector = injector;
|
|
22434
|
-
injector.resolveInjectorInitializers();
|
|
22435
|
-
}
|
|
22436
|
-
destroy() {
|
|
22437
|
-
this.injector.destroy();
|
|
22438
|
-
}
|
|
22439
|
-
onDestroy(callback) {
|
|
22440
|
-
this.injector.onDestroy(callback);
|
|
22441
|
-
}
|
|
22215
|
+
function sortListeners(a, b) {
|
|
22216
|
+
if (a.name == b.name)
|
|
22217
|
+
return 0;
|
|
22218
|
+
return a.name < b.name ? -1 : 1;
|
|
22442
22219
|
}
|
|
22443
22220
|
/**
|
|
22444
|
-
*
|
|
22221
|
+
* This function should not exist because it is megamorphic and only mostly correct.
|
|
22445
22222
|
*
|
|
22446
|
-
*
|
|
22447
|
-
* @developerPreview
|
|
22223
|
+
* See call site for more info.
|
|
22448
22224
|
*/
|
|
22449
|
-
function
|
|
22450
|
-
|
|
22451
|
-
return adapter.injector;
|
|
22225
|
+
function isDirectiveDefHack(obj) {
|
|
22226
|
+
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22452
22227
|
}
|
|
22453
|
-
|
|
22454
22228
|
/**
|
|
22455
|
-
*
|
|
22456
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22229
|
+
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22457
22230
|
*
|
|
22458
|
-
*
|
|
22459
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22460
|
-
*/
|
|
22461
|
-
/**
|
|
22462
|
-
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
22463
|
-
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
22464
|
-
* collected from the imports graph rooted at a given standalone component.
|
|
22231
|
+
* @param element DOM element which is owned by an existing component's view.
|
|
22465
22232
|
*/
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
this.cachedInjectors = new Map();
|
|
22233
|
+
function getDebugNode$1(element) {
|
|
22234
|
+
if (ngDevMode && !(element instanceof Node)) {
|
|
22235
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22470
22236
|
}
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
22476
|
-
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
22477
|
-
const standaloneInjector = providers.length > 0 ?
|
|
22478
|
-
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22479
|
-
null;
|
|
22480
|
-
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
22481
|
-
}
|
|
22482
|
-
return this.cachedInjectors.get(componentDef.id);
|
|
22237
|
+
const lContext = getLContext(element);
|
|
22238
|
+
const lView = lContext ? lContext.lView : null;
|
|
22239
|
+
if (lView === null) {
|
|
22240
|
+
return null;
|
|
22483
22241
|
}
|
|
22484
|
-
|
|
22485
|
-
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
this.cachedInjectors.clear();
|
|
22494
|
-
}
|
|
22242
|
+
const nodeIndex = lContext.nodeIndex;
|
|
22243
|
+
if (nodeIndex !== -1) {
|
|
22244
|
+
const valueInLView = lView[nodeIndex];
|
|
22245
|
+
// this means that value in the lView is a component with its own
|
|
22246
|
+
// data. In this situation the TNode is not accessed at the same spot.
|
|
22247
|
+
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22248
|
+
ngDevMode &&
|
|
22249
|
+
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22250
|
+
return buildDebugNode(tNode, lView);
|
|
22495
22251
|
}
|
|
22252
|
+
return null;
|
|
22496
22253
|
}
|
|
22497
|
-
/** @nocollapse */
|
|
22498
|
-
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22499
|
-
token: StandaloneService,
|
|
22500
|
-
providedIn: 'environment',
|
|
22501
|
-
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22502
|
-
});
|
|
22503
22254
|
/**
|
|
22504
|
-
*
|
|
22255
|
+
* Retrieve the component `LView` from component/element.
|
|
22505
22256
|
*
|
|
22506
|
-
*
|
|
22507
|
-
*
|
|
22508
|
-
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
22509
|
-
* is tree-shakable and not included in applications that don't use standalone components.
|
|
22257
|
+
* NOTE: `LView` is a private and should not be leaked outside.
|
|
22258
|
+
* Don't export this method to `ng.*` on window.
|
|
22510
22259
|
*
|
|
22511
|
-
* @
|
|
22260
|
+
* @param target DOM element or component instance for which to retrieve the LView.
|
|
22512
22261
|
*/
|
|
22513
|
-
function
|
|
22514
|
-
|
|
22515
|
-
|
|
22516
|
-
|
|
22262
|
+
function getComponentLView(target) {
|
|
22263
|
+
const lContext = getLContext(target);
|
|
22264
|
+
const nodeIndx = lContext.nodeIndex;
|
|
22265
|
+
const lView = lContext.lView;
|
|
22266
|
+
ngDevMode && assertLView(lView);
|
|
22267
|
+
const componentLView = lView[nodeIndx];
|
|
22268
|
+
ngDevMode && assertLView(componentLView);
|
|
22269
|
+
return componentLView;
|
|
22270
|
+
}
|
|
22271
|
+
/** Asserts that a value is a DOM Element. */
|
|
22272
|
+
function assertDomElement(value) {
|
|
22273
|
+
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
22274
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22275
|
+
}
|
|
22517
22276
|
}
|
|
22518
22277
|
|
|
22519
22278
|
/**
|
|
@@ -23734,7 +23493,7 @@ const unusedValueExportToPlacateAjd = 1;
|
|
|
23734
23493
|
* Use of this source code is governed by an MIT-style license that can be
|
|
23735
23494
|
* found in the LICENSE file at https://angular.io/license
|
|
23736
23495
|
*/
|
|
23737
|
-
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$
|
|
23496
|
+
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
|
|
23738
23497
|
class LQuery_ {
|
|
23739
23498
|
constructor(queryList) {
|
|
23740
23499
|
this.queryList = queryList;
|
|
@@ -25153,14 +24912,20 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25153
24912
|
// Standalone components are always able to self-reference, so include the component's own
|
|
25154
24913
|
// definition in its `directiveDefs`.
|
|
25155
24914
|
cachedDirectiveDefs = [getComponentDef(type)];
|
|
24915
|
+
const seen = new Set();
|
|
25156
24916
|
for (const rawDep of imports) {
|
|
25157
24917
|
ngDevMode && verifyStandaloneImport(rawDep, type);
|
|
25158
24918
|
const dep = resolveForwardRef(rawDep);
|
|
24919
|
+
if (seen.has(dep)) {
|
|
24920
|
+
continue;
|
|
24921
|
+
}
|
|
24922
|
+
seen.add(dep);
|
|
25159
24923
|
if (!!getNgModuleDef(dep)) {
|
|
25160
24924
|
const scope = transitiveScopesFor(dep);
|
|
25161
24925
|
for (const dir of scope.exported.directives) {
|
|
25162
24926
|
const def = getComponentDef(dir) || getDirectiveDef(dir);
|
|
25163
|
-
if (def) {
|
|
24927
|
+
if (def && !seen.has(dir)) {
|
|
24928
|
+
seen.add(dir);
|
|
25164
24929
|
cachedDirectiveDefs.push(def);
|
|
25165
24930
|
}
|
|
25166
24931
|
}
|
|
@@ -25178,11 +24943,22 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25178
24943
|
const pipeDefs = () => {
|
|
25179
24944
|
if (cachedPipeDefs === null) {
|
|
25180
24945
|
cachedPipeDefs = [];
|
|
24946
|
+
const seen = new Set();
|
|
25181
24947
|
for (const rawDep of imports) {
|
|
25182
24948
|
const dep = resolveForwardRef(rawDep);
|
|
24949
|
+
if (seen.has(dep)) {
|
|
24950
|
+
continue;
|
|
24951
|
+
}
|
|
24952
|
+
seen.add(dep);
|
|
25183
24953
|
if (!!getNgModuleDef(dep)) {
|
|
25184
24954
|
const scope = transitiveScopesFor(dep);
|
|
25185
|
-
|
|
24955
|
+
for (const pipe of scope.exported.pipes) {
|
|
24956
|
+
const def = getPipeDef$1(pipe);
|
|
24957
|
+
if (def && !seen.has(pipe)) {
|
|
24958
|
+
seen.add(pipe);
|
|
24959
|
+
cachedPipeDefs.push(def);
|
|
24960
|
+
}
|
|
24961
|
+
}
|
|
25186
24962
|
}
|
|
25187
24963
|
else {
|
|
25188
24964
|
const def = getPipeDef$1(dep);
|
|
@@ -26139,6 +25915,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
|
26139
25915
|
class CompilerFactory {
|
|
26140
25916
|
}
|
|
26141
25917
|
|
|
25918
|
+
/**
|
|
25919
|
+
* @license
|
|
25920
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25921
|
+
*
|
|
25922
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25923
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25924
|
+
*/
|
|
25925
|
+
/**
|
|
25926
|
+
* Marks a component for check (in case of OnPush components) and synchronously
|
|
25927
|
+
* performs change detection on the application this component belongs to.
|
|
25928
|
+
*
|
|
25929
|
+
* @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
|
|
25930
|
+
*
|
|
25931
|
+
* @publicApi
|
|
25932
|
+
* @globalApi ng
|
|
25933
|
+
*/
|
|
25934
|
+
function applyChanges(component) {
|
|
25935
|
+
markDirty(component);
|
|
25936
|
+
getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
|
|
25937
|
+
}
|
|
25938
|
+
|
|
25939
|
+
/**
|
|
25940
|
+
* @license
|
|
25941
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25942
|
+
*
|
|
25943
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25944
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25945
|
+
*/
|
|
25946
|
+
/**
|
|
25947
|
+
* This file introduces series of globally accessible debug tools
|
|
25948
|
+
* to allow for the Angular debugging story to function.
|
|
25949
|
+
*
|
|
25950
|
+
* To see this in action run the following command:
|
|
25951
|
+
*
|
|
25952
|
+
* bazel run //packages/core/test/bundling/todo:devserver
|
|
25953
|
+
*
|
|
25954
|
+
* Then load `localhost:5432` and start using the console tools.
|
|
25955
|
+
*/
|
|
25956
|
+
/**
|
|
25957
|
+
* This value reflects the property on the window where the dev
|
|
25958
|
+
* tools are patched (window.ng).
|
|
25959
|
+
* */
|
|
25960
|
+
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
25961
|
+
let _published = false;
|
|
25962
|
+
/**
|
|
25963
|
+
* Publishes a collection of default debug tools onto`window.ng`.
|
|
25964
|
+
*
|
|
25965
|
+
* These functions are available globally when Angular is in development
|
|
25966
|
+
* mode and are automatically stripped away from prod mode is on.
|
|
25967
|
+
*/
|
|
25968
|
+
function publishDefaultGlobalUtils$1() {
|
|
25969
|
+
if (!_published) {
|
|
25970
|
+
_published = true;
|
|
25971
|
+
/**
|
|
25972
|
+
* Warning: this function is *INTERNAL* and should not be relied upon in application's code.
|
|
25973
|
+
* The contract of the function might be changed in any release and/or the function can be
|
|
25974
|
+
* removed completely.
|
|
25975
|
+
*/
|
|
25976
|
+
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
25977
|
+
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
25978
|
+
publishGlobalUtil('getComponent', getComponent);
|
|
25979
|
+
publishGlobalUtil('getContext', getContext);
|
|
25980
|
+
publishGlobalUtil('getListeners', getListeners);
|
|
25981
|
+
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
25982
|
+
publishGlobalUtil('getHostElement', getHostElement);
|
|
25983
|
+
publishGlobalUtil('getInjector', getInjector);
|
|
25984
|
+
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
25985
|
+
publishGlobalUtil('getDirectives', getDirectives);
|
|
25986
|
+
publishGlobalUtil('applyChanges', applyChanges);
|
|
25987
|
+
}
|
|
25988
|
+
}
|
|
25989
|
+
/**
|
|
25990
|
+
* Publishes the given function to `window.ng` so that it can be
|
|
25991
|
+
* used from the browser console when an application is not in production.
|
|
25992
|
+
*/
|
|
25993
|
+
function publishGlobalUtil(name, fn) {
|
|
25994
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
|
25995
|
+
// Note: we can't export `ng` when using closure enhanced optimization as:
|
|
25996
|
+
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
25997
|
+
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
25998
|
+
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
25999
|
+
const w = _global;
|
|
26000
|
+
ngDevMode && assertDefined(fn, 'function not defined');
|
|
26001
|
+
if (w) {
|
|
26002
|
+
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
26003
|
+
if (!container) {
|
|
26004
|
+
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
26005
|
+
}
|
|
26006
|
+
container[name] = fn;
|
|
26007
|
+
}
|
|
26008
|
+
}
|
|
26009
|
+
}
|
|
26010
|
+
|
|
26142
26011
|
/**
|
|
26143
26012
|
* @license
|
|
26144
26013
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -26294,7 +26163,7 @@ class NgZone {
|
|
|
26294
26163
|
*/
|
|
26295
26164
|
this.onError = new EventEmitter(false);
|
|
26296
26165
|
if (typeof Zone == 'undefined') {
|
|
26297
|
-
throw new
|
|
26166
|
+
throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
|
|
26298
26167
|
}
|
|
26299
26168
|
Zone.assertZonePatched();
|
|
26300
26169
|
const self = this;
|
|
@@ -26321,12 +26190,12 @@ class NgZone {
|
|
|
26321
26190
|
}
|
|
26322
26191
|
static assertInAngularZone() {
|
|
26323
26192
|
if (!NgZone.isInAngularZone()) {
|
|
26324
|
-
throw new
|
|
26193
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
|
|
26325
26194
|
}
|
|
26326
26195
|
}
|
|
26327
26196
|
static assertNotInAngularZone() {
|
|
26328
26197
|
if (NgZone.isInAngularZone()) {
|
|
26329
|
-
throw new
|
|
26198
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
|
|
26330
26199
|
}
|
|
26331
26200
|
}
|
|
26332
26201
|
/**
|
|
@@ -26897,7 +26766,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
|
26897
26766
|
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26898
26767
|
* entire class tree-shakeable.
|
|
26899
26768
|
*/
|
|
26900
|
-
const
|
|
26769
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
26901
26770
|
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26902
26771
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26903
26772
|
ngDevMode && assertNgModuleType(moduleType);
|
|
@@ -26962,10 +26831,8 @@ class NgProbeToken {
|
|
|
26962
26831
|
*/
|
|
26963
26832
|
function createPlatform(injector) {
|
|
26964
26833
|
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26965
|
-
|
|
26966
|
-
'There can be only one platform. Destroy the previous one to create a new one.'
|
|
26967
|
-
'';
|
|
26968
|
-
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
|
|
26834
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
|
|
26835
|
+
'There can be only one platform. Destroy the previous one to create a new one.');
|
|
26969
26836
|
}
|
|
26970
26837
|
publishDefaultGlobalUtils();
|
|
26971
26838
|
_platformInjector = injector;
|
|
@@ -27038,7 +26905,15 @@ function internalBootstrapApplication(config) {
|
|
|
27038
26905
|
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
27039
26906
|
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
27040
26907
|
const appRef = appInjector.get(ApplicationRef);
|
|
27041
|
-
|
|
26908
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
26909
|
+
// for all bootstrapped applications as well.
|
|
26910
|
+
const destroyListener = () => appRef.destroy();
|
|
26911
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
26912
|
+
onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.add(destroyListener);
|
|
26913
|
+
appRef.onDestroy(() => {
|
|
26914
|
+
onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.delete(destroyListener);
|
|
26915
|
+
onErrorSubscription.unsubscribe();
|
|
26916
|
+
});
|
|
27042
26917
|
appRef.bootstrap(rootComponent);
|
|
27043
26918
|
return appRef;
|
|
27044
26919
|
});
|
|
@@ -27085,8 +26960,7 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
|
27085
26960
|
function assertPlatform(requiredToken) {
|
|
27086
26961
|
const platform = getPlatform();
|
|
27087
26962
|
if (!platform) {
|
|
27088
|
-
|
|
27089
|
-
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
|
|
26963
|
+
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
|
|
27090
26964
|
}
|
|
27091
26965
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
27092
26966
|
!platform.injector.get(requiredToken, null)) {
|
|
@@ -27103,7 +26977,7 @@ function createPlatformInjector(providers = [], name) {
|
|
|
27103
26977
|
name,
|
|
27104
26978
|
providers: [
|
|
27105
26979
|
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
27106
|
-
{ provide:
|
|
26980
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
27107
26981
|
...providers
|
|
27108
26982
|
],
|
|
27109
26983
|
});
|
|
@@ -27166,10 +27040,7 @@ class PlatformRef {
|
|
|
27166
27040
|
const moduleRef = moduleFactory.create(ngZoneInjector);
|
|
27167
27041
|
const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
|
|
27168
27042
|
if (!exceptionHandler) {
|
|
27169
|
-
|
|
27170
|
-
'No ErrorHandler. Is platform module (BrowserModule) included?' :
|
|
27171
|
-
'';
|
|
27172
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
27043
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
27173
27044
|
}
|
|
27174
27045
|
ngZone.runOutsideAngular(() => {
|
|
27175
27046
|
const subscription = ngZone.onError.subscribe({
|
|
@@ -27225,12 +27096,10 @@ class PlatformRef {
|
|
|
27225
27096
|
moduleRef.instance.ngDoBootstrap(appRef);
|
|
27226
27097
|
}
|
|
27227
27098
|
else {
|
|
27228
|
-
|
|
27099
|
+
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
|
|
27229
27100
|
`The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
|
|
27230
27101
|
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
27231
|
-
`Please define one of these.`
|
|
27232
|
-
'';
|
|
27233
|
-
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
27102
|
+
`Please define one of these.`);
|
|
27234
27103
|
}
|
|
27235
27104
|
this._modules.push(moduleRef);
|
|
27236
27105
|
}
|
|
@@ -27253,15 +27122,15 @@ class PlatformRef {
|
|
|
27253
27122
|
*/
|
|
27254
27123
|
destroy() {
|
|
27255
27124
|
if (this._destroyed) {
|
|
27256
|
-
|
|
27257
|
-
'The platform has already been destroyed!' :
|
|
27258
|
-
'';
|
|
27259
|
-
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
27125
|
+
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
|
|
27260
27126
|
}
|
|
27261
27127
|
this._modules.slice().forEach(module => module.destroy());
|
|
27262
27128
|
this._destroyListeners.forEach(listener => listener());
|
|
27263
|
-
const
|
|
27264
|
-
|
|
27129
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27130
|
+
if (destroyListeners) {
|
|
27131
|
+
destroyListeners.forEach(listener => listener());
|
|
27132
|
+
destroyListeners.clear();
|
|
27133
|
+
}
|
|
27265
27134
|
this._destroyed = true;
|
|
27266
27135
|
}
|
|
27267
27136
|
/**
|
|
@@ -27421,11 +27290,10 @@ function optionsReducer(dst, objs) {
|
|
|
27421
27290
|
*/
|
|
27422
27291
|
class ApplicationRef {
|
|
27423
27292
|
/** @internal */
|
|
27424
|
-
constructor(_zone, _injector, _exceptionHandler
|
|
27293
|
+
constructor(_zone, _injector, _exceptionHandler) {
|
|
27425
27294
|
this._zone = _zone;
|
|
27426
27295
|
this._injector = _injector;
|
|
27427
27296
|
this._exceptionHandler = _exceptionHandler;
|
|
27428
|
-
this._initStatus = _initStatus;
|
|
27429
27297
|
/** @internal */
|
|
27430
27298
|
this._bootstrapListeners = [];
|
|
27431
27299
|
this._views = [];
|
|
@@ -27542,7 +27410,8 @@ class ApplicationRef {
|
|
|
27542
27410
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27543
27411
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27544
27412
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
27545
|
-
|
|
27413
|
+
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
27414
|
+
if (!initStatus.done) {
|
|
27546
27415
|
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27547
27416
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27548
27417
|
(standalone ? '' :
|
|
@@ -27590,10 +27459,7 @@ class ApplicationRef {
|
|
|
27590
27459
|
tick() {
|
|
27591
27460
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27592
27461
|
if (this._runningTick) {
|
|
27593
|
-
|
|
27594
|
-
'ApplicationRef.tick is called recursively' :
|
|
27595
|
-
'';
|
|
27596
|
-
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
27462
|
+
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
|
|
27597
27463
|
}
|
|
27598
27464
|
try {
|
|
27599
27465
|
this._runningTick = true;
|
|
@@ -27682,7 +27548,7 @@ class ApplicationRef {
|
|
|
27682
27548
|
*/
|
|
27683
27549
|
destroy() {
|
|
27684
27550
|
if (this._destroyed) {
|
|
27685
|
-
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */,
|
|
27551
|
+
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27686
27552
|
}
|
|
27687
27553
|
const injector = this._injector;
|
|
27688
27554
|
// Check that this injector instance supports destroy operation.
|
|
@@ -27704,13 +27570,13 @@ class ApplicationRef {
|
|
|
27704
27570
|
}
|
|
27705
27571
|
}
|
|
27706
27572
|
}
|
|
27707
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)
|
|
27573
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)); };
|
|
27708
27574
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
27709
27575
|
(function () {
|
|
27710
27576
|
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
27711
27577
|
type: Injectable,
|
|
27712
27578
|
args: [{ providedIn: 'root' }]
|
|
27713
|
-
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }
|
|
27579
|
+
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }]; }, null);
|
|
27714
27580
|
})();
|
|
27715
27581
|
function remove(list, el) {
|
|
27716
27582
|
const index = list.indexOf(el);
|
|
@@ -28058,7 +27924,7 @@ class DebugNode {
|
|
|
28058
27924
|
get componentInstance() {
|
|
28059
27925
|
const nativeElement = this.nativeNode;
|
|
28060
27926
|
return nativeElement &&
|
|
28061
|
-
(getComponent
|
|
27927
|
+
(getComponent(nativeElement) || getOwningComponent(nativeElement));
|
|
28062
27928
|
}
|
|
28063
27929
|
/**
|
|
28064
27930
|
* An object that provides parent context for this element. Often an ancestor component instance
|
|
@@ -28069,7 +27935,7 @@ class DebugNode {
|
|
|
28069
27935
|
* of heroes"`.
|
|
28070
27936
|
*/
|
|
28071
27937
|
get context() {
|
|
28072
|
-
return getComponent
|
|
27938
|
+
return getComponent(this.nativeNode) || getContext(this.nativeNode);
|
|
28073
27939
|
}
|
|
28074
27940
|
/**
|
|
28075
27941
|
* The callbacks attached to the component's @Output properties and/or the element's event
|
|
@@ -28409,8 +28275,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28409
28275
|
// Renderer2, however that's not the case in Ivy. This approach is being used because:
|
|
28410
28276
|
// 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
|
|
28411
28277
|
// from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
|
|
28412
|
-
// 2.
|
|
28413
|
-
// 3. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28278
|
+
// 2. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28414
28279
|
nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
|
|
28415
28280
|
}
|
|
28416
28281
|
// In all cases, if a dynamic container exists for this node, each view inside it has to be
|
|
@@ -28721,10 +28586,8 @@ class DefaultIterableDiffer {
|
|
|
28721
28586
|
if (collection == null)
|
|
28722
28587
|
collection = [];
|
|
28723
28588
|
if (!isListLikeIterable(collection)) {
|
|
28724
|
-
|
|
28725
|
-
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`
|
|
28726
|
-
'';
|
|
28727
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
28589
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
28590
|
+
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
|
|
28728
28591
|
}
|
|
28729
28592
|
if (this.check(collection)) {
|
|
28730
28593
|
return this;
|
|
@@ -29325,10 +29188,8 @@ class DefaultKeyValueDiffer {
|
|
|
29325
29188
|
map = new Map();
|
|
29326
29189
|
}
|
|
29327
29190
|
else if (!(map instanceof Map || isJsObject(map))) {
|
|
29328
|
-
|
|
29329
|
-
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`
|
|
29330
|
-
'';
|
|
29331
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
29191
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
29192
|
+
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
|
|
29332
29193
|
}
|
|
29333
29194
|
return this.check(map) ? this : null;
|
|
29334
29195
|
}
|
|
@@ -29575,10 +29436,8 @@ class IterableDiffers {
|
|
|
29575
29436
|
return factory;
|
|
29576
29437
|
}
|
|
29577
29438
|
else {
|
|
29578
|
-
|
|
29579
|
-
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`
|
|
29580
|
-
'';
|
|
29581
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29439
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&
|
|
29440
|
+
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
|
|
29582
29441
|
}
|
|
29583
29442
|
}
|
|
29584
29443
|
}
|
|
@@ -29652,10 +29511,7 @@ class KeyValueDiffers {
|
|
|
29652
29511
|
if (factory) {
|
|
29653
29512
|
return factory;
|
|
29654
29513
|
}
|
|
29655
|
-
|
|
29656
|
-
`Cannot find a differ supporting object '${kv}'` :
|
|
29657
|
-
'';
|
|
29658
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29514
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
|
|
29659
29515
|
}
|
|
29660
29516
|
}
|
|
29661
29517
|
/** @nocollapse */
|
|
@@ -29891,5 +29747,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
29891
29747
|
* Generated bundle index. Do not edit.
|
|
29892
29748
|
*/
|
|
29893
29749
|
|
|
29894
|
-
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,
|
|
29750
|
+
export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
|
|
29895
29751
|
//# sourceMappingURL=core.mjs.map
|