@angular/core 14.1.0-next.2 → 14.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/application_ref.mjs +29 -15
- package/esm2020/src/change_detection/change_detector_ref.mjs +1 -1
- package/esm2020/src/core.mjs +2 -2
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +3 -4
- package/esm2020/src/di/index.mjs +1 -1
- package/esm2020/src/di/injector_compatibility.mjs +13 -8
- package/esm2020/src/di/injector_token.mjs +2 -2
- package/esm2020/src/di/interface/injector.mjs +2 -1
- package/esm2020/src/di/jit/util.mjs +3 -2
- package/esm2020/src/di/r3_injector.mjs +13 -1
- package/esm2020/src/di/reflective_key.mjs +3 -2
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/locale_data_api.mjs +3 -2
- package/esm2020/src/linker/component_factory.mjs +1 -1
- package/esm2020/src/linker/ng_module_factory.mjs +2 -2
- package/esm2020/src/linker/view_container_ref.mjs +2 -2
- package/esm2020/src/metadata/di.mjs +1 -1
- package/esm2020/src/render/api.mjs +2 -11
- package/esm2020/src/render3/component.mjs +3 -57
- package/esm2020/src/render3/component_ref.mjs +30 -5
- package/esm2020/src/render3/features/standalone_feature.mjs +2 -2
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +2 -20
- package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
- package/esm2020/src/render3/instructions/listener.mjs +34 -44
- package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
- package/esm2020/src/render3/instructions/property_interpolation.mjs +2 -2
- package/esm2020/src/render3/instructions/shared.mjs +22 -59
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/i18n.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -17
- package/esm2020/src/render3/interfaces/styling.mjs +1 -1
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/ng_module_ref.mjs +15 -2
- package/esm2020/src/render3/node_manipulation.mjs +24 -87
- package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
- package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
- package/esm2020/src/render3/util/view_utils.mjs +3 -6
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +9 -4
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +1697 -1830
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +1037 -1279
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1697 -1830
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +1037 -1279
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +169 -144
- package/package.json +1 -1
- package/schematics/migrations/typed-forms/util.js +2 -2
- package/schematics/utils/typescript/symbol.js +2 -2
- package/testing/index.d.ts +1 -1
- package/schematics/utils/schematics_prompt.d.ts +0 -17
- package/schematics/utils/schematics_prompt.js +0 -45
package/fesm2020/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0-
|
|
2
|
+
* @license Angular v14.1.0-rc.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -499,6 +499,7 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
|
|
|
499
499
|
* Injection flags for DI.
|
|
500
500
|
*
|
|
501
501
|
* @publicApi
|
|
502
|
+
* @deprecated use an options object for `inject` instead.
|
|
502
503
|
*/
|
|
503
504
|
var InjectFlags;
|
|
504
505
|
(function (InjectFlags) {
|
|
@@ -1593,87 +1594,6 @@ function getNamespaceUri(namespace) {
|
|
|
1593
1594
|
(name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
|
|
1594
1595
|
}
|
|
1595
1596
|
|
|
1596
|
-
/**
|
|
1597
|
-
* @license
|
|
1598
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1599
|
-
*
|
|
1600
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1601
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1602
|
-
*/
|
|
1603
|
-
/**
|
|
1604
|
-
* Most of the use of `document` in Angular is from within the DI system so it is possible to simply
|
|
1605
|
-
* inject the `DOCUMENT` token and are done.
|
|
1606
|
-
*
|
|
1607
|
-
* Ivy is special because it does not rely upon the DI and must get hold of the document some other
|
|
1608
|
-
* way.
|
|
1609
|
-
*
|
|
1610
|
-
* The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
|
|
1611
|
-
* Wherever ivy needs the global document, it calls `getDocument()` instead.
|
|
1612
|
-
*
|
|
1613
|
-
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
1614
|
-
* tell ivy what the global `document` is.
|
|
1615
|
-
*
|
|
1616
|
-
* Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
|
|
1617
|
-
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
1618
|
-
*/
|
|
1619
|
-
let DOCUMENT = undefined;
|
|
1620
|
-
/**
|
|
1621
|
-
* Tell ivy what the `document` is for this platform.
|
|
1622
|
-
*
|
|
1623
|
-
* It is only necessary to call this if the current platform is not a browser.
|
|
1624
|
-
*
|
|
1625
|
-
* @param document The object representing the global `document` in this environment.
|
|
1626
|
-
*/
|
|
1627
|
-
function setDocument(document) {
|
|
1628
|
-
DOCUMENT = document;
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Access the object that represents the `document` for this platform.
|
|
1632
|
-
*
|
|
1633
|
-
* Ivy calls this whenever it needs to access the `document` object.
|
|
1634
|
-
* For example to create the renderer or to do sanitization.
|
|
1635
|
-
*/
|
|
1636
|
-
function getDocument() {
|
|
1637
|
-
if (DOCUMENT !== undefined) {
|
|
1638
|
-
return DOCUMENT;
|
|
1639
|
-
}
|
|
1640
|
-
else if (typeof document !== 'undefined') {
|
|
1641
|
-
return document;
|
|
1642
|
-
}
|
|
1643
|
-
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
1644
|
-
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
1645
|
-
// this should not happen in Angular apps.
|
|
1646
|
-
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
1647
|
-
// public API. Meanwhile we just return `undefined` and let the application fail.
|
|
1648
|
-
return undefined;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
/**
|
|
1652
|
-
* @license
|
|
1653
|
-
* Copyright Google LLC All Rights Reserved.
|
|
1654
|
-
*
|
|
1655
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1656
|
-
* found in the LICENSE file at https://angular.io/license
|
|
1657
|
-
*/
|
|
1658
|
-
// TODO: cleanup once the code is merged in angular/angular
|
|
1659
|
-
var RendererStyleFlags3;
|
|
1660
|
-
(function (RendererStyleFlags3) {
|
|
1661
|
-
RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
|
|
1662
|
-
RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
|
|
1663
|
-
})(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
|
|
1664
|
-
/** Returns whether the `renderer` is a `ProceduralRenderer3` */
|
|
1665
|
-
function isProceduralRenderer(renderer) {
|
|
1666
|
-
return !!(renderer.listen);
|
|
1667
|
-
}
|
|
1668
|
-
const domRendererFactory3 = {
|
|
1669
|
-
createRenderer: (hostElement, rendererType) => {
|
|
1670
|
-
return getDocument();
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
1674
|
-
// failure based on types.
|
|
1675
|
-
const unusedValueExportToPlacateAjd$6 = 1;
|
|
1676
|
-
|
|
1677
1597
|
/**
|
|
1678
1598
|
* @license
|
|
1679
1599
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -1756,7 +1676,6 @@ function getNativeByTNode(tNode, lView) {
|
|
|
1756
1676
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1757
1677
|
ngDevMode && assertIndexInRange(lView, tNode.index);
|
|
1758
1678
|
const node = unwrapRNode(lView[tNode.index]);
|
|
1759
|
-
ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1760
1679
|
return node;
|
|
1761
1680
|
}
|
|
1762
1681
|
/**
|
|
@@ -1772,7 +1691,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
|
|
|
1772
1691
|
if (index !== -1) {
|
|
1773
1692
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
1774
1693
|
const node = unwrapRNode(lView[index]);
|
|
1775
|
-
ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
|
|
1776
1694
|
return node;
|
|
1777
1695
|
}
|
|
1778
1696
|
return null;
|
|
@@ -2721,7 +2639,7 @@ function isFactory(obj) {
|
|
|
2721
2639
|
}
|
|
2722
2640
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2723
2641
|
// failure based on types.
|
|
2724
|
-
const unusedValueExportToPlacateAjd$
|
|
2642
|
+
const unusedValueExportToPlacateAjd$6 = 1;
|
|
2725
2643
|
|
|
2726
2644
|
/**
|
|
2727
2645
|
* Converts `TNodeType` into human readable text.
|
|
@@ -2740,7 +2658,7 @@ function toTNodeTypeAsString(tNodeType) {
|
|
|
2740
2658
|
}
|
|
2741
2659
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2742
2660
|
// failure based on types.
|
|
2743
|
-
const unusedValueExportToPlacateAjd$
|
|
2661
|
+
const unusedValueExportToPlacateAjd$5 = 1;
|
|
2744
2662
|
/**
|
|
2745
2663
|
* Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
|
|
2746
2664
|
*
|
|
@@ -2844,7 +2762,6 @@ function assertPureTNodeType(type) {
|
|
|
2844
2762
|
* @returns the index value that was last accessed in the attributes array
|
|
2845
2763
|
*/
|
|
2846
2764
|
function setUpAttributes(renderer, native, attrs) {
|
|
2847
|
-
const isProc = isProceduralRenderer(renderer);
|
|
2848
2765
|
let i = 0;
|
|
2849
2766
|
while (i < attrs.length) {
|
|
2850
2767
|
const value = attrs[i];
|
|
@@ -2861,9 +2778,7 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2861
2778
|
const attrName = attrs[i++];
|
|
2862
2779
|
const attrVal = attrs[i++];
|
|
2863
2780
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2864
|
-
|
|
2865
|
-
renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
|
|
2866
|
-
native.setAttributeNS(namespaceURI, attrName, attrVal);
|
|
2781
|
+
renderer.setAttribute(native, attrName, attrVal, namespaceURI);
|
|
2867
2782
|
}
|
|
2868
2783
|
else {
|
|
2869
2784
|
// attrName is string;
|
|
@@ -2872,14 +2787,10 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2872
2787
|
// Standard attributes
|
|
2873
2788
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
2874
2789
|
if (isAnimationProp(attrName)) {
|
|
2875
|
-
|
|
2876
|
-
renderer.setProperty(native, attrName, attrVal);
|
|
2877
|
-
}
|
|
2790
|
+
renderer.setProperty(native, attrName, attrVal);
|
|
2878
2791
|
}
|
|
2879
2792
|
else {
|
|
2880
|
-
|
|
2881
|
-
renderer.setAttribute(native, attrName, attrVal) :
|
|
2882
|
-
native.setAttribute(attrName, attrVal);
|
|
2793
|
+
renderer.setAttribute(native, attrName, attrVal);
|
|
2883
2794
|
}
|
|
2884
2795
|
i++;
|
|
2885
2796
|
}
|
|
@@ -4875,22 +4786,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
|
|
|
4875
4786
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
4876
4787
|
* particular class.
|
|
4877
4788
|
*
|
|
4878
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
4879
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
4880
|
-
*
|
|
4881
4789
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
4882
4790
|
* and thus in the stack trace.
|
|
4883
4791
|
*
|
|
4884
4792
|
* @codeGenApi
|
|
4885
4793
|
*/
|
|
4886
4794
|
function ɵɵinvalidFactoryDep(index) {
|
|
4887
|
-
|
|
4795
|
+
throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
|
|
4888
4796
|
`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
|
|
4889
4797
|
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.
|
|
4890
4798
|
|
|
4891
|
-
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.`
|
|
4892
|
-
'invalid';
|
|
4893
|
-
throw new Error(msg);
|
|
4799
|
+
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.`);
|
|
4894
4800
|
}
|
|
4895
4801
|
/**
|
|
4896
4802
|
* Injects a token from the currently active injector.
|
|
@@ -4957,6 +4863,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
4957
4863
|
* @publicApi
|
|
4958
4864
|
*/
|
|
4959
4865
|
function inject(token, flags = InjectFlags.Default) {
|
|
4866
|
+
if (typeof flags !== 'number') {
|
|
4867
|
+
// While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
|
|
4868
|
+
// JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
|
|
4869
|
+
// `InjectOptions` to `InjectFlags`.
|
|
4870
|
+
flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
|
|
4871
|
+
(flags.optional && 8 /* InternalInjectFlags.Optional */) |
|
|
4872
|
+
(flags.host && 1 /* InternalInjectFlags.Host */) |
|
|
4873
|
+
(flags.self && 2 /* InternalInjectFlags.Self */) |
|
|
4874
|
+
(flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
|
|
4875
|
+
}
|
|
4960
4876
|
return ɵɵinject(token, flags);
|
|
4961
4877
|
}
|
|
4962
4878
|
function injectArgs(types) {
|
|
@@ -5154,7 +5070,7 @@ function reflectDependency(dep) {
|
|
|
5154
5070
|
}
|
|
5155
5071
|
else if (param instanceof Attribute) {
|
|
5156
5072
|
if (param.attributeName === undefined) {
|
|
5157
|
-
throw new
|
|
5073
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
|
|
5158
5074
|
}
|
|
5159
5075
|
meta.attribute = param.attributeName;
|
|
5160
5076
|
}
|
|
@@ -5340,6 +5256,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5340
5256
|
checkForDuplicateNgModules = !allowDuplicates;
|
|
5341
5257
|
}
|
|
5342
5258
|
|
|
5259
|
+
/**
|
|
5260
|
+
* @license
|
|
5261
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5262
|
+
*
|
|
5263
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5264
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5265
|
+
*/
|
|
5266
|
+
/**
|
|
5267
|
+
* Most of the use of `document` in Angular is from within the DI system so it is possible to simply
|
|
5268
|
+
* inject the `DOCUMENT` token and are done.
|
|
5269
|
+
*
|
|
5270
|
+
* Ivy is special because it does not rely upon the DI and must get hold of the document some other
|
|
5271
|
+
* way.
|
|
5272
|
+
*
|
|
5273
|
+
* The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
|
|
5274
|
+
* Wherever ivy needs the global document, it calls `getDocument()` instead.
|
|
5275
|
+
*
|
|
5276
|
+
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
5277
|
+
* tell ivy what the global `document` is.
|
|
5278
|
+
*
|
|
5279
|
+
* Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
|
|
5280
|
+
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
5281
|
+
*/
|
|
5282
|
+
let DOCUMENT = undefined;
|
|
5283
|
+
/**
|
|
5284
|
+
* Tell ivy what the `document` is for this platform.
|
|
5285
|
+
*
|
|
5286
|
+
* It is only necessary to call this if the current platform is not a browser.
|
|
5287
|
+
*
|
|
5288
|
+
* @param document The object representing the global `document` in this environment.
|
|
5289
|
+
*/
|
|
5290
|
+
function setDocument(document) {
|
|
5291
|
+
DOCUMENT = document;
|
|
5292
|
+
}
|
|
5293
|
+
/**
|
|
5294
|
+
* Access the object that represents the `document` for this platform.
|
|
5295
|
+
*
|
|
5296
|
+
* Ivy calls this whenever it needs to access the `document` object.
|
|
5297
|
+
* For example to create the renderer or to do sanitization.
|
|
5298
|
+
*/
|
|
5299
|
+
function getDocument() {
|
|
5300
|
+
if (DOCUMENT !== undefined) {
|
|
5301
|
+
return DOCUMENT;
|
|
5302
|
+
}
|
|
5303
|
+
else if (typeof document !== 'undefined') {
|
|
5304
|
+
return document;
|
|
5305
|
+
}
|
|
5306
|
+
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
5307
|
+
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
5308
|
+
// this should not happen in Angular apps.
|
|
5309
|
+
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
5310
|
+
// public API. Meanwhile we just return `undefined` and let the application fail.
|
|
5311
|
+
return undefined;
|
|
5312
|
+
}
|
|
5313
|
+
|
|
5343
5314
|
/**
|
|
5344
5315
|
* @license
|
|
5345
5316
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7069,6 +7040,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
7069
7040
|
}
|
|
7070
7041
|
}
|
|
7071
7042
|
|
|
7043
|
+
/**
|
|
7044
|
+
* @license
|
|
7045
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7046
|
+
*
|
|
7047
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7048
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7049
|
+
*/
|
|
7050
|
+
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
7051
|
+
// failure based on types.
|
|
7052
|
+
const unusedValueExportToPlacateAjd$4 = 1;
|
|
7053
|
+
|
|
7072
7054
|
/**
|
|
7073
7055
|
* @license
|
|
7074
7056
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -7151,7 +7133,7 @@ function getNearestLContainer(viewOrContainer) {
|
|
|
7151
7133
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7152
7134
|
* found in the LICENSE file at https://angular.io/license
|
|
7153
7135
|
*/
|
|
7154
|
-
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$
|
|
7136
|
+
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$8;
|
|
7155
7137
|
/**
|
|
7156
7138
|
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
7157
7139
|
* being passed as an argument.
|
|
@@ -7176,7 +7158,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7176
7158
|
lNodeToHandle = lNodeToHandle[HOST];
|
|
7177
7159
|
}
|
|
7178
7160
|
const rNode = unwrapRNode(lNodeToHandle);
|
|
7179
|
-
ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
|
|
7180
7161
|
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7181
7162
|
if (beforeNode == null) {
|
|
7182
7163
|
nativeAppendChild(renderer, parent, rNode);
|
|
@@ -7203,17 +7184,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7203
7184
|
function createTextNode(renderer, value) {
|
|
7204
7185
|
ngDevMode && ngDevMode.rendererCreateTextNode++;
|
|
7205
7186
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7206
|
-
return
|
|
7207
|
-
renderer.createTextNode(value);
|
|
7187
|
+
return renderer.createText(value);
|
|
7208
7188
|
}
|
|
7209
7189
|
function updateTextNode(renderer, rNode, value) {
|
|
7210
7190
|
ngDevMode && ngDevMode.rendererSetText++;
|
|
7211
|
-
|
|
7191
|
+
renderer.setValue(rNode, value);
|
|
7212
7192
|
}
|
|
7213
7193
|
function createCommentNode(renderer, value) {
|
|
7214
7194
|
ngDevMode && ngDevMode.rendererCreateComment++;
|
|
7215
|
-
// isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
|
|
7216
|
-
// method name.
|
|
7217
7195
|
return renderer.createComment(escapeCommentText(value));
|
|
7218
7196
|
}
|
|
7219
7197
|
/**
|
|
@@ -7225,14 +7203,7 @@ function createCommentNode(renderer, value) {
|
|
|
7225
7203
|
*/
|
|
7226
7204
|
function createElementNode(renderer, name, namespace) {
|
|
7227
7205
|
ngDevMode && ngDevMode.rendererCreateElement++;
|
|
7228
|
-
|
|
7229
|
-
return renderer.createElement(name, namespace);
|
|
7230
|
-
}
|
|
7231
|
-
else {
|
|
7232
|
-
const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
|
|
7233
|
-
return namespaceUri === null ? renderer.createElement(name) :
|
|
7234
|
-
renderer.createElementNS(namespaceUri, name);
|
|
7235
|
-
}
|
|
7206
|
+
return renderer.createElement(name, namespace);
|
|
7236
7207
|
}
|
|
7237
7208
|
/**
|
|
7238
7209
|
* Removes all DOM elements associated with a view.
|
|
@@ -7464,7 +7435,7 @@ function detachView(lContainer, removeIndex) {
|
|
|
7464
7435
|
function destroyLView(tView, lView) {
|
|
7465
7436
|
if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
|
|
7466
7437
|
const renderer = lView[RENDERER];
|
|
7467
|
-
if (
|
|
7438
|
+
if (renderer.destroyNode) {
|
|
7468
7439
|
applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
|
|
7469
7440
|
}
|
|
7470
7441
|
destroyViewTree(lView);
|
|
@@ -7492,7 +7463,7 @@ function cleanUpView(tView, lView) {
|
|
|
7492
7463
|
executeOnDestroys(tView, lView);
|
|
7493
7464
|
processCleanups(tView, lView);
|
|
7494
7465
|
// For component views only, the local renderer is destroyed at clean up time.
|
|
7495
|
-
if (lView[TVIEW].type === 1 /* TViewType.Component */
|
|
7466
|
+
if (lView[TVIEW].type === 1 /* TViewType.Component */) {
|
|
7496
7467
|
ngDevMode && ngDevMode.rendererDestroy++;
|
|
7497
7468
|
lView[RENDERER].destroy();
|
|
7498
7469
|
}
|
|
@@ -7668,30 +7639,17 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7668
7639
|
}
|
|
7669
7640
|
}
|
|
7670
7641
|
/**
|
|
7671
|
-
* Inserts a native node before another native node for a given parent
|
|
7672
|
-
* This is a utility function that can be used when native nodes were determined
|
|
7673
|
-
* actual renderer being used.
|
|
7642
|
+
* Inserts a native node before another native node for a given parent.
|
|
7643
|
+
* This is a utility function that can be used when native nodes were determined.
|
|
7674
7644
|
*/
|
|
7675
7645
|
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7676
7646
|
ngDevMode && ngDevMode.rendererInsertBefore++;
|
|
7677
|
-
|
|
7678
|
-
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7679
|
-
}
|
|
7680
|
-
else {
|
|
7681
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7682
|
-
targetParent.insertBefore(child, beforeNode, isMove);
|
|
7683
|
-
}
|
|
7647
|
+
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7684
7648
|
}
|
|
7685
7649
|
function nativeAppendChild(renderer, parent, child) {
|
|
7686
7650
|
ngDevMode && ngDevMode.rendererAppendChild++;
|
|
7687
7651
|
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
7688
|
-
|
|
7689
|
-
renderer.appendChild(parent, child);
|
|
7690
|
-
}
|
|
7691
|
-
else {
|
|
7692
|
-
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7693
|
-
targetParent.appendChild(child);
|
|
7694
|
-
}
|
|
7652
|
+
renderer.appendChild(parent, child);
|
|
7695
7653
|
}
|
|
7696
7654
|
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
7697
7655
|
if (beforeNode !== null) {
|
|
@@ -7703,12 +7661,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
|
|
|
7703
7661
|
}
|
|
7704
7662
|
/** Removes a node from the DOM given its native parent. */
|
|
7705
7663
|
function nativeRemoveChild(renderer, parent, child, isHostElement) {
|
|
7706
|
-
|
|
7707
|
-
renderer.removeChild(parent, child, isHostElement);
|
|
7708
|
-
}
|
|
7709
|
-
else {
|
|
7710
|
-
parent.removeChild(child);
|
|
7711
|
-
}
|
|
7664
|
+
renderer.removeChild(parent, child, isHostElement);
|
|
7712
7665
|
}
|
|
7713
7666
|
/** Checks if an element is a `<template>` node. */
|
|
7714
7667
|
function isTemplateNode(node) {
|
|
@@ -7718,13 +7671,13 @@ function isTemplateNode(node) {
|
|
|
7718
7671
|
* Returns a native parent of a given native node.
|
|
7719
7672
|
*/
|
|
7720
7673
|
function nativeParentNode(renderer, node) {
|
|
7721
|
-
return
|
|
7674
|
+
return renderer.parentNode(node);
|
|
7722
7675
|
}
|
|
7723
7676
|
/**
|
|
7724
7677
|
* Returns a native sibling of a given native node.
|
|
7725
7678
|
*/
|
|
7726
7679
|
function nativeNextSibling(renderer, node) {
|
|
7727
|
-
return
|
|
7680
|
+
return renderer.nextSibling(node);
|
|
7728
7681
|
}
|
|
7729
7682
|
/**
|
|
7730
7683
|
* Find a node in front of which `currentTNode` should be inserted.
|
|
@@ -8033,39 +7986,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
|
|
|
8033
7986
|
* otherwise).
|
|
8034
7987
|
*/
|
|
8035
7988
|
function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
8036
|
-
const isProcedural = isProceduralRenderer(renderer);
|
|
8037
7989
|
if (isClassBased) {
|
|
8038
7990
|
// We actually want JS true/false here because any truthy value should add the class
|
|
8039
7991
|
if (!value) {
|
|
8040
7992
|
ngDevMode && ngDevMode.rendererRemoveClass++;
|
|
8041
|
-
|
|
8042
|
-
renderer.removeClass(rNode, prop);
|
|
8043
|
-
}
|
|
8044
|
-
else {
|
|
8045
|
-
rNode.classList.remove(prop);
|
|
8046
|
-
}
|
|
7993
|
+
renderer.removeClass(rNode, prop);
|
|
8047
7994
|
}
|
|
8048
7995
|
else {
|
|
8049
7996
|
ngDevMode && ngDevMode.rendererAddClass++;
|
|
8050
|
-
|
|
8051
|
-
renderer.addClass(rNode, prop);
|
|
8052
|
-
}
|
|
8053
|
-
else {
|
|
8054
|
-
ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
|
|
8055
|
-
rNode.classList.add(prop);
|
|
8056
|
-
}
|
|
7997
|
+
renderer.addClass(rNode, prop);
|
|
8057
7998
|
}
|
|
8058
7999
|
}
|
|
8059
8000
|
else {
|
|
8060
8001
|
let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
|
|
8061
8002
|
if (value == null /** || value === undefined */) {
|
|
8062
8003
|
ngDevMode && ngDevMode.rendererRemoveStyle++;
|
|
8063
|
-
|
|
8064
|
-
renderer.removeStyle(rNode, prop, flags);
|
|
8065
|
-
}
|
|
8066
|
-
else {
|
|
8067
|
-
rNode.style.removeProperty(prop);
|
|
8068
|
-
}
|
|
8004
|
+
renderer.removeStyle(rNode, prop, flags);
|
|
8069
8005
|
}
|
|
8070
8006
|
else {
|
|
8071
8007
|
// A value is important if it ends with `!important`. The style
|
|
@@ -8077,13 +8013,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8077
8013
|
flags |= RendererStyleFlags2.Important;
|
|
8078
8014
|
}
|
|
8079
8015
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8080
|
-
|
|
8081
|
-
renderer.setStyle(rNode, prop, value, flags);
|
|
8082
|
-
}
|
|
8083
|
-
else {
|
|
8084
|
-
ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
|
|
8085
|
-
rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
|
|
8086
|
-
}
|
|
8016
|
+
renderer.setStyle(rNode, prop, value, flags);
|
|
8087
8017
|
}
|
|
8088
8018
|
}
|
|
8089
8019
|
}
|
|
@@ -8099,12 +8029,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
|
|
|
8099
8029
|
*/
|
|
8100
8030
|
function writeDirectStyle(renderer, element, newValue) {
|
|
8101
8031
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8102
|
-
|
|
8103
|
-
renderer.setAttribute(element, 'style', newValue);
|
|
8104
|
-
}
|
|
8105
|
-
else {
|
|
8106
|
-
element.style.cssText = newValue;
|
|
8107
|
-
}
|
|
8032
|
+
renderer.setAttribute(element, 'style', newValue);
|
|
8108
8033
|
ngDevMode && ngDevMode.rendererSetStyle++;
|
|
8109
8034
|
}
|
|
8110
8035
|
/**
|
|
@@ -8119,17 +8044,12 @@ function writeDirectStyle(renderer, element, newValue) {
|
|
|
8119
8044
|
*/
|
|
8120
8045
|
function writeDirectClass(renderer, element, newValue) {
|
|
8121
8046
|
ngDevMode && assertString(newValue, '\'newValue\' should be a string');
|
|
8122
|
-
if (
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
renderer.removeAttribute(element, 'class');
|
|
8126
|
-
}
|
|
8127
|
-
else {
|
|
8128
|
-
renderer.setAttribute(element, 'class', newValue);
|
|
8129
|
-
}
|
|
8047
|
+
if (newValue === '') {
|
|
8048
|
+
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
8049
|
+
renderer.removeAttribute(element, 'class');
|
|
8130
8050
|
}
|
|
8131
8051
|
else {
|
|
8132
|
-
element
|
|
8052
|
+
renderer.setAttribute(element, 'class', newValue);
|
|
8133
8053
|
}
|
|
8134
8054
|
ngDevMode && ngDevMode.rendererSetClassName++;
|
|
8135
8055
|
}
|
|
@@ -8179,7 +8099,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
8179
8099
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8180
8100
|
* found in the LICENSE file at https://angular.io/license
|
|
8181
8101
|
*/
|
|
8182
|
-
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$
|
|
8102
|
+
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
|
|
8183
8103
|
const NG_TEMPLATE_SELECTOR = 'ng-template';
|
|
8184
8104
|
/**
|
|
8185
8105
|
* Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
|
|
@@ -9064,7 +8984,7 @@ function isClassProvider(value) {
|
|
|
9064
8984
|
* @publicApi
|
|
9065
8985
|
*/
|
|
9066
8986
|
const INJECTOR = new InjectionToken('INJECTOR',
|
|
9067
|
-
//
|
|
8987
|
+
// Disable tslint because this is const enum which gets inlined not top level prop access.
|
|
9068
8988
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
9069
8989
|
-1 /* InjectorMarkers.Injector */);
|
|
9070
8990
|
|
|
@@ -9208,6 +9128,18 @@ class R3Injector extends EnvironmentInjector {
|
|
|
9208
9128
|
onDestroy(callback) {
|
|
9209
9129
|
this._onDestroyHooks.push(callback);
|
|
9210
9130
|
}
|
|
9131
|
+
runInContext(fn) {
|
|
9132
|
+
this.assertNotDestroyed();
|
|
9133
|
+
const previousInjector = setCurrentInjector(this);
|
|
9134
|
+
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
9135
|
+
try {
|
|
9136
|
+
return fn();
|
|
9137
|
+
}
|
|
9138
|
+
finally {
|
|
9139
|
+
setCurrentInjector(previousInjector);
|
|
9140
|
+
setInjectImplementation(previousInjectImplementation);
|
|
9141
|
+
}
|
|
9142
|
+
}
|
|
9211
9143
|
get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
|
|
9212
9144
|
this.assertNotDestroyed();
|
|
9213
9145
|
// Set the injection context.
|
|
@@ -9818,7 +9750,7 @@ class ReflectiveKey {
|
|
|
9818
9750
|
this.token = token;
|
|
9819
9751
|
this.id = id;
|
|
9820
9752
|
if (!token) {
|
|
9821
|
-
throw new
|
|
9753
|
+
throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
|
|
9822
9754
|
}
|
|
9823
9755
|
this.displayName = stringify(this.token);
|
|
9824
9756
|
}
|
|
@@ -10622,6 +10554,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
|
|
|
10622
10554
|
`the ${schemas} of this component.`;
|
|
10623
10555
|
}
|
|
10624
10556
|
}
|
|
10557
|
+
reportUnknownPropertyError(message);
|
|
10558
|
+
}
|
|
10559
|
+
function reportUnknownPropertyError(message) {
|
|
10625
10560
|
if (shouldThrowErrorOnUnknownProperty) {
|
|
10626
10561
|
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
10627
10562
|
}
|
|
@@ -11508,6 +11443,13 @@ class LContainerDebug {
|
|
|
11508
11443
|
}
|
|
11509
11444
|
}
|
|
11510
11445
|
|
|
11446
|
+
/**
|
|
11447
|
+
* @license
|
|
11448
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11449
|
+
*
|
|
11450
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11451
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11452
|
+
*/
|
|
11511
11453
|
/**
|
|
11512
11454
|
* A permanent marker promise which signifies that the current CD tree is
|
|
11513
11455
|
* clean.
|
|
@@ -11575,7 +11517,7 @@ function refreshChildComponents(hostLView, components) {
|
|
|
11575
11517
|
/** Renders child components in the current view (creation mode). */
|
|
11576
11518
|
function renderChildComponents(hostLView, components) {
|
|
11577
11519
|
for (let i = 0; i < components.length; i++) {
|
|
11578
|
-
renderComponent
|
|
11520
|
+
renderComponent(hostLView, components[i]);
|
|
11579
11521
|
}
|
|
11580
11522
|
}
|
|
11581
11523
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
@@ -12093,16 +12035,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
|
12093
12035
|
function createError(text, token) {
|
|
12094
12036
|
return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
|
|
12095
12037
|
}
|
|
12096
|
-
function assertHostNodeExists(rElement, elementOrSelector) {
|
|
12097
|
-
if (!rElement) {
|
|
12098
|
-
if (typeof elementOrSelector === 'string') {
|
|
12099
|
-
throw createError('Host node with selector not found:', elementOrSelector);
|
|
12100
|
-
}
|
|
12101
|
-
else {
|
|
12102
|
-
throw createError('Host node is required:', elementOrSelector);
|
|
12103
|
-
}
|
|
12104
|
-
}
|
|
12105
|
-
}
|
|
12106
12038
|
/**
|
|
12107
12039
|
* Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
|
|
12108
12040
|
*
|
|
@@ -12111,21 +12043,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
|
|
|
12111
12043
|
* @param encapsulation View Encapsulation defined for component that requests host element.
|
|
12112
12044
|
*/
|
|
12113
12045
|
function locateHostElement(renderer, elementOrSelector, encapsulation) {
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12118
|
-
}
|
|
12119
|
-
let rElement = typeof elementOrSelector === 'string' ?
|
|
12120
|
-
renderer.querySelector(elementOrSelector) :
|
|
12121
|
-
elementOrSelector;
|
|
12122
|
-
ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
|
|
12123
|
-
// Always clear host element's content when Renderer3 is in use. For procedural renderer case we
|
|
12124
|
-
// make it depend on whether ShadowDom encapsulation is used (in which case the content should be
|
|
12125
|
-
// preserved to allow native slot projection). ShadowDom encapsulation requires procedural
|
|
12126
|
-
// renderer, and procedural renderer case is handled above.
|
|
12127
|
-
rElement.textContent = '';
|
|
12128
|
-
return rElement;
|
|
12046
|
+
// When using native Shadow DOM, do not clear host element to allow native slot projection
|
|
12047
|
+
const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
|
|
12048
|
+
return renderer.selectRootElement(elementOrSelector, preserveContent);
|
|
12129
12049
|
}
|
|
12130
12050
|
/**
|
|
12131
12051
|
* Saves context for this cleanup function in LView.cleanupInstances.
|
|
@@ -12340,13 +12260,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
12340
12260
|
// It is assumed that the sanitizer is only added when the compiler determines that the
|
|
12341
12261
|
// property is risky, so sanitization can be done without further checks.
|
|
12342
12262
|
value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
|
|
12343
|
-
|
|
12344
|
-
renderer.setProperty(element, propName, value);
|
|
12345
|
-
}
|
|
12346
|
-
else if (!isAnimationProp(propName)) {
|
|
12347
|
-
element.setProperty ? element.setProperty(propName, value) :
|
|
12348
|
-
element[propName] = value;
|
|
12349
|
-
}
|
|
12263
|
+
renderer.setProperty(element, propName, value);
|
|
12350
12264
|
}
|
|
12351
12265
|
else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
|
|
12352
12266
|
// If the node is a container and the property didn't
|
|
@@ -12370,23 +12284,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
|
12370
12284
|
const debugValue = normalizeDebugBindingValue(value);
|
|
12371
12285
|
if (type & 3 /* TNodeType.AnyRNode */) {
|
|
12372
12286
|
if (value == null) {
|
|
12373
|
-
|
|
12374
|
-
element.removeAttribute(attrName);
|
|
12287
|
+
renderer.removeAttribute(element, attrName);
|
|
12375
12288
|
}
|
|
12376
12289
|
else {
|
|
12377
|
-
|
|
12378
|
-
renderer.setAttribute(element, attrName, debugValue) :
|
|
12379
|
-
element.setAttribute(attrName, debugValue);
|
|
12290
|
+
renderer.setAttribute(element, attrName, debugValue);
|
|
12380
12291
|
}
|
|
12381
12292
|
}
|
|
12382
12293
|
else {
|
|
12383
12294
|
const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
|
|
12384
|
-
|
|
12385
|
-
renderer.setValue(element, textContent);
|
|
12386
|
-
}
|
|
12387
|
-
else {
|
|
12388
|
-
element.textContent = textContent;
|
|
12389
|
-
}
|
|
12295
|
+
renderer.setValue(element, textContent);
|
|
12390
12296
|
}
|
|
12391
12297
|
}
|
|
12392
12298
|
function setNgReflectProperties(lView, element, type, dataValue, value) {
|
|
@@ -12416,6 +12322,7 @@ function instantiateRootComponent(tView, lView, def) {
|
|
|
12416
12322
|
ngDevMode &&
|
|
12417
12323
|
assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
|
|
12418
12324
|
configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
|
|
12325
|
+
initializeInputAndOutputAliases(tView, rootTNode);
|
|
12419
12326
|
}
|
|
12420
12327
|
const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
|
|
12421
12328
|
attachPatchData(directive, lView);
|
|
@@ -12740,19 +12647,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
|
|
|
12740
12647
|
function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
|
|
12741
12648
|
if (value == null) {
|
|
12742
12649
|
ngDevMode && ngDevMode.rendererRemoveAttribute++;
|
|
12743
|
-
|
|
12744
|
-
element.removeAttribute(name);
|
|
12650
|
+
renderer.removeAttribute(element, name, namespace);
|
|
12745
12651
|
}
|
|
12746
12652
|
else {
|
|
12747
12653
|
ngDevMode && ngDevMode.rendererSetAttribute++;
|
|
12748
12654
|
const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
|
|
12749
|
-
|
|
12750
|
-
renderer.setAttribute(element, name, strValue, namespace);
|
|
12751
|
-
}
|
|
12752
|
-
else {
|
|
12753
|
-
namespace ? element.setAttributeNS(namespace, name, strValue) :
|
|
12754
|
-
element.setAttribute(name, strValue);
|
|
12755
|
-
}
|
|
12655
|
+
renderer.setAttribute(element, name, strValue, namespace);
|
|
12756
12656
|
}
|
|
12757
12657
|
}
|
|
12758
12658
|
/**
|
|
@@ -12844,7 +12744,6 @@ const LContainerArray = class LContainer extends Array {
|
|
|
12844
12744
|
*/
|
|
12845
12745
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
12846
12746
|
ngDevMode && assertLView(currentView);
|
|
12847
|
-
ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
|
|
12848
12747
|
// https://jsperf.com/array-literal-vs-new-array-really
|
|
12849
12748
|
const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
|
|
12850
12749
|
true, // Boolean `true` in this position signifies that this is an `LContainer`
|
|
@@ -12960,7 +12859,7 @@ function refreshContainsDirtyView(lView) {
|
|
|
12960
12859
|
}
|
|
12961
12860
|
}
|
|
12962
12861
|
}
|
|
12963
|
-
function renderComponent
|
|
12862
|
+
function renderComponent(hostLView, componentHostIdx) {
|
|
12964
12863
|
ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
|
|
12965
12864
|
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
|
|
12966
12865
|
const componentTView = componentView[TVIEW];
|
|
@@ -13312,458 +13211,450 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
|
|
|
13312
13211
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13313
13212
|
* found in the LICENSE file at https://angular.io/license
|
|
13314
13213
|
*/
|
|
13214
|
+
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13215
|
+
const NULL_INJECTOR = {
|
|
13216
|
+
get: (token, notFoundValue) => {
|
|
13217
|
+
throwProviderNotFoundError(token, 'NullInjector');
|
|
13218
|
+
}
|
|
13219
|
+
};
|
|
13315
13220
|
/**
|
|
13316
|
-
*
|
|
13317
|
-
*
|
|
13318
|
-
* This function triggers change detection in a synchronous way on a component.
|
|
13319
|
-
*
|
|
13320
|
-
* @param component The component which the change detection should be performed on.
|
|
13321
|
-
*/
|
|
13322
|
-
function detectChanges(component) {
|
|
13323
|
-
const view = getComponentViewByInstance(component);
|
|
13324
|
-
detectChangesInternal(view[TVIEW], view, component);
|
|
13325
|
-
}
|
|
13326
|
-
/**
|
|
13327
|
-
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
13328
|
-
* schedule a change detection on it at some point in the future.
|
|
13329
|
-
*
|
|
13330
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
13331
|
-
* detection can be scheduled per component tree.
|
|
13332
|
-
*
|
|
13333
|
-
* @param component Component to mark as dirty.
|
|
13334
|
-
*/
|
|
13335
|
-
function markDirty(component) {
|
|
13336
|
-
ngDevMode && assertDefined(component, 'component');
|
|
13337
|
-
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
13338
|
-
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
13339
|
-
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
13340
|
-
}
|
|
13341
|
-
/**
|
|
13342
|
-
* Used to perform change detection on the whole application.
|
|
13343
|
-
*
|
|
13344
|
-
* This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
|
|
13345
|
-
* executes lifecycle hooks and conditionally checks components based on their
|
|
13346
|
-
* `ChangeDetectionStrategy` and dirtiness.
|
|
13221
|
+
* Creates the root component view and the root component node.
|
|
13347
13222
|
*
|
|
13348
|
-
*
|
|
13349
|
-
*
|
|
13350
|
-
*
|
|
13351
|
-
*
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
const rootView = getRootView(component);
|
|
13355
|
-
const rootContext = rootView[CONTEXT];
|
|
13356
|
-
tickRootContext(rootContext);
|
|
13357
|
-
}
|
|
13358
|
-
|
|
13359
|
-
/**
|
|
13360
|
-
* @license
|
|
13361
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13223
|
+
* @param rNode Render host element.
|
|
13224
|
+
* @param def ComponentDef
|
|
13225
|
+
* @param rootView The parent view where the host node is stored
|
|
13226
|
+
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13227
|
+
* @param hostRenderer The current renderer
|
|
13228
|
+
* @param sanitizer The sanitizer, if provided
|
|
13362
13229
|
*
|
|
13363
|
-
*
|
|
13364
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13230
|
+
* @returns Component view created
|
|
13365
13231
|
*/
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
* @param element DOM element from which the component should be retrieved.
|
|
13387
|
-
* @returns Component instance associated with the element or `null` if there
|
|
13388
|
-
* is no component associated with it.
|
|
13389
|
-
*
|
|
13390
|
-
* @publicApi
|
|
13391
|
-
* @globalApi ng
|
|
13392
|
-
*/
|
|
13393
|
-
function getComponent$1(element) {
|
|
13394
|
-
ngDevMode && assertDomElement(element);
|
|
13395
|
-
const context = getLContext(element);
|
|
13396
|
-
if (context === null)
|
|
13397
|
-
return null;
|
|
13398
|
-
if (context.component === undefined) {
|
|
13399
|
-
const lView = context.lView;
|
|
13400
|
-
if (lView === null) {
|
|
13401
|
-
return null;
|
|
13232
|
+
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13233
|
+
const tView = rootView[TVIEW];
|
|
13234
|
+
const index = HEADER_OFFSET;
|
|
13235
|
+
ngDevMode && assertIndexInRange(rootView, index);
|
|
13236
|
+
rootView[index] = rNode;
|
|
13237
|
+
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13238
|
+
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13239
|
+
// representing a host element.
|
|
13240
|
+
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13241
|
+
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13242
|
+
if (mergedAttrs !== null) {
|
|
13243
|
+
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13244
|
+
if (rNode !== null) {
|
|
13245
|
+
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13246
|
+
if (tNode.classes !== null) {
|
|
13247
|
+
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13248
|
+
}
|
|
13249
|
+
if (tNode.styles !== null) {
|
|
13250
|
+
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13251
|
+
}
|
|
13402
13252
|
}
|
|
13403
|
-
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
13404
13253
|
}
|
|
13405
|
-
|
|
13254
|
+
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13255
|
+
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13256
|
+
if (tView.firstCreatePass) {
|
|
13257
|
+
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13258
|
+
markAsComponentHost(tView, tNode);
|
|
13259
|
+
initTNodeFlags(tNode, rootView.length, 1);
|
|
13260
|
+
}
|
|
13261
|
+
addToViewTree(rootView, componentView);
|
|
13262
|
+
// Store component view at node index, with node as the HOST
|
|
13263
|
+
return rootView[index] = componentView;
|
|
13406
13264
|
}
|
|
13407
13265
|
/**
|
|
13408
|
-
*
|
|
13409
|
-
*
|
|
13410
|
-
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
13411
|
-
*
|
|
13412
|
-
* @param element Element for which to get the surrounding component instance.
|
|
13413
|
-
* @returns Instance of the component that is around the element or null if the element isn't
|
|
13414
|
-
* inside any component.
|
|
13415
|
-
*
|
|
13416
|
-
* @publicApi
|
|
13417
|
-
* @globalApi ng
|
|
13266
|
+
* Creates a root component and sets it up with features and host bindings. Shared by
|
|
13267
|
+
* renderComponent() and ViewContainerRef.createComponent().
|
|
13418
13268
|
*/
|
|
13419
|
-
function
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
const
|
|
13423
|
-
|
|
13269
|
+
function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
|
|
13270
|
+
const tView = rootLView[TVIEW];
|
|
13271
|
+
// Create directive instance with factory() and store at next index in viewData
|
|
13272
|
+
const component = instantiateRootComponent(tView, rootLView, componentDef);
|
|
13273
|
+
rootContext.components.push(component);
|
|
13274
|
+
componentView[CONTEXT] = component;
|
|
13275
|
+
if (hostFeatures !== null) {
|
|
13276
|
+
for (const feature of hostFeatures) {
|
|
13277
|
+
feature(component, componentDef);
|
|
13278
|
+
}
|
|
13279
|
+
}
|
|
13280
|
+
// We want to generate an empty QueryList for root content queries for backwards
|
|
13281
|
+
// compatibility with ViewEngine.
|
|
13282
|
+
if (componentDef.contentQueries) {
|
|
13283
|
+
const tNode = getCurrentTNode();
|
|
13284
|
+
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13285
|
+
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13286
|
+
}
|
|
13287
|
+
const rootTNode = getCurrentTNode();
|
|
13288
|
+
ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
|
|
13289
|
+
if (tView.firstCreatePass &&
|
|
13290
|
+
(componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
|
|
13291
|
+
setSelectedIndex(rootTNode.index);
|
|
13292
|
+
const rootTView = rootLView[TVIEW];
|
|
13293
|
+
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13294
|
+
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13295
|
+
}
|
|
13296
|
+
return component;
|
|
13297
|
+
}
|
|
13298
|
+
function createRootContext(scheduler, playerHandler) {
|
|
13299
|
+
return {
|
|
13300
|
+
components: [],
|
|
13301
|
+
scheduler: scheduler || defaultScheduler,
|
|
13302
|
+
clean: CLEAN_PROMISE,
|
|
13303
|
+
playerHandler: playerHandler || null,
|
|
13304
|
+
flags: 0 /* RootContextFlags.Empty */
|
|
13305
|
+
};
|
|
13424
13306
|
}
|
|
13425
13307
|
/**
|
|
13426
|
-
*
|
|
13308
|
+
* Used to enable lifecycle hooks on the root component.
|
|
13427
13309
|
*
|
|
13428
|
-
*
|
|
13429
|
-
*
|
|
13430
|
-
*
|
|
13310
|
+
* Include this feature when calling `renderComponent` if the root component
|
|
13311
|
+
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
13312
|
+
* be called properly.
|
|
13431
13313
|
*
|
|
13432
|
-
*
|
|
13433
|
-
* for which to retrieve the root components.
|
|
13434
|
-
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
13435
|
-
* part of a component view.
|
|
13314
|
+
* Example:
|
|
13436
13315
|
*
|
|
13437
|
-
*
|
|
13438
|
-
*
|
|
13316
|
+
* ```
|
|
13317
|
+
* renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
|
|
13318
|
+
* ```
|
|
13439
13319
|
*/
|
|
13440
|
-
function
|
|
13441
|
-
const
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
return null;
|
|
13445
|
-
let parent;
|
|
13446
|
-
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
13447
|
-
lView = parent;
|
|
13448
|
-
}
|
|
13449
|
-
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
13320
|
+
function LifecycleHooksFeature() {
|
|
13321
|
+
const tNode = getCurrentTNode();
|
|
13322
|
+
ngDevMode && assertDefined(tNode, 'TNode is required');
|
|
13323
|
+
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13450
13324
|
}
|
|
13451
13325
|
/**
|
|
13452
|
-
*
|
|
13453
|
-
* Root components are those which have been bootstrapped by Angular.
|
|
13454
|
-
*
|
|
13455
|
-
* @param elementOrDir DOM element, component or directive instance
|
|
13456
|
-
* for which to retrieve the root components.
|
|
13457
|
-
* @returns Root components associated with the target object.
|
|
13326
|
+
* Wait on component until it is rendered.
|
|
13458
13327
|
*
|
|
13459
|
-
*
|
|
13460
|
-
*
|
|
13461
|
-
|
|
13462
|
-
function
|
|
13463
|
-
const lView = readPatchedLView(elementOrDir);
|
|
13464
|
-
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
13465
|
-
}
|
|
13466
|
-
/**
|
|
13467
|
-
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
13328
|
+
* This function returns a `Promise` which is resolved when the component's
|
|
13329
|
+
* change detection is executed. This is determined by finding the scheduler
|
|
13330
|
+
* associated with the `component`'s render tree and waiting until the scheduler
|
|
13331
|
+
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
13468
13332
|
*
|
|
13469
|
-
*
|
|
13470
|
-
*
|
|
13471
|
-
*
|
|
13333
|
+
* Example:
|
|
13334
|
+
* ```
|
|
13335
|
+
* await whenRendered(myComponent);
|
|
13336
|
+
* ```
|
|
13472
13337
|
*
|
|
13473
|
-
* @
|
|
13474
|
-
* @
|
|
13338
|
+
* @param component Component to wait upon
|
|
13339
|
+
* @returns Promise which resolves when the component is rendered.
|
|
13475
13340
|
*/
|
|
13476
|
-
function
|
|
13477
|
-
|
|
13478
|
-
const lView = context ? context.lView : null;
|
|
13479
|
-
if (lView === null)
|
|
13480
|
-
return Injector.NULL;
|
|
13481
|
-
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
13482
|
-
return new NodeInjector(tNode, lView);
|
|
13341
|
+
function whenRendered(component) {
|
|
13342
|
+
return getRootContext(component).clean;
|
|
13483
13343
|
}
|
|
13344
|
+
|
|
13484
13345
|
/**
|
|
13485
|
-
*
|
|
13346
|
+
* @license
|
|
13347
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13486
13348
|
*
|
|
13487
|
-
*
|
|
13349
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13350
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13488
13351
|
*/
|
|
13489
|
-
function
|
|
13490
|
-
|
|
13491
|
-
const lView = context ? context.lView : null;
|
|
13492
|
-
if (lView === null)
|
|
13493
|
-
return [];
|
|
13494
|
-
const tView = lView[TVIEW];
|
|
13495
|
-
const tNode = tView.data[context.nodeIndex];
|
|
13496
|
-
const providerTokens = [];
|
|
13497
|
-
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
13498
|
-
const endIndex = tNode.directiveEnd;
|
|
13499
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
13500
|
-
let value = tView.data[i];
|
|
13501
|
-
if (isDirectiveDefHack(value)) {
|
|
13502
|
-
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
13503
|
-
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
13504
|
-
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
13505
|
-
// is that we should always be storing injectable type in this location.
|
|
13506
|
-
value = value.type;
|
|
13507
|
-
}
|
|
13508
|
-
providerTokens.push(value);
|
|
13509
|
-
}
|
|
13510
|
-
return providerTokens;
|
|
13352
|
+
function getSuperType(type) {
|
|
13353
|
+
return Object.getPrototypeOf(type.prototype).constructor;
|
|
13511
13354
|
}
|
|
13512
13355
|
/**
|
|
13513
|
-
*
|
|
13514
|
-
* component
|
|
13515
|
-
*
|
|
13516
|
-
* @usageNotes
|
|
13517
|
-
* Given the following DOM structure:
|
|
13518
|
-
*
|
|
13519
|
-
* ```html
|
|
13520
|
-
* <app-root>
|
|
13521
|
-
* <button my-button></button>
|
|
13522
|
-
* <my-comp></my-comp>
|
|
13523
|
-
* </app-root>
|
|
13524
|
-
* ```
|
|
13525
|
-
*
|
|
13526
|
-
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
13527
|
-
* directive that is associated with the DOM node.
|
|
13528
|
-
*
|
|
13529
|
-
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
13530
|
-
*
|
|
13531
|
-
* @param node DOM node for which to get the directives.
|
|
13532
|
-
* @returns Array of directives associated with the node.
|
|
13356
|
+
* Merges the definition from a super class to a sub class.
|
|
13357
|
+
* @param definition The definition that is a SubClass of another directive of component
|
|
13533
13358
|
*
|
|
13534
|
-
* @
|
|
13535
|
-
* @globalApi ng
|
|
13359
|
+
* @codeGenApi
|
|
13536
13360
|
*/
|
|
13537
|
-
function
|
|
13538
|
-
|
|
13539
|
-
|
|
13540
|
-
|
|
13541
|
-
|
|
13542
|
-
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13361
|
+
function ɵɵInheritDefinitionFeature(definition) {
|
|
13362
|
+
let superType = getSuperType(definition.type);
|
|
13363
|
+
let shouldInheritFields = true;
|
|
13364
|
+
const inheritanceChain = [definition];
|
|
13365
|
+
while (superType) {
|
|
13366
|
+
let superDef = undefined;
|
|
13367
|
+
if (isComponentDef(definition)) {
|
|
13368
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13369
|
+
superDef = superType.ɵcmp || superType.ɵdir;
|
|
13370
|
+
}
|
|
13371
|
+
else {
|
|
13372
|
+
if (superType.ɵcmp) {
|
|
13373
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
13374
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
13375
|
+
}
|
|
13376
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13377
|
+
superDef = superType.ɵdir;
|
|
13378
|
+
}
|
|
13379
|
+
if (superDef) {
|
|
13380
|
+
if (shouldInheritFields) {
|
|
13381
|
+
inheritanceChain.push(superDef);
|
|
13382
|
+
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
13383
|
+
// would've justified object creation. Unwrap them if necessary.
|
|
13384
|
+
const writeableDef = definition;
|
|
13385
|
+
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
13386
|
+
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
13387
|
+
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
13388
|
+
// Merge hostBindings
|
|
13389
|
+
const superHostBindings = superDef.hostBindings;
|
|
13390
|
+
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
13391
|
+
// Merge queries
|
|
13392
|
+
const superViewQuery = superDef.viewQuery;
|
|
13393
|
+
const superContentQueries = superDef.contentQueries;
|
|
13394
|
+
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
13395
|
+
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
13396
|
+
// Merge inputs and outputs
|
|
13397
|
+
fillProperties(definition.inputs, superDef.inputs);
|
|
13398
|
+
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
13399
|
+
fillProperties(definition.outputs, superDef.outputs);
|
|
13400
|
+
// Merge animations metadata.
|
|
13401
|
+
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
13402
|
+
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
13403
|
+
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
13404
|
+
// not inherit Components (we throw an error above and cannot reach this code).
|
|
13405
|
+
const defData = definition.data;
|
|
13406
|
+
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
13407
|
+
}
|
|
13408
|
+
}
|
|
13409
|
+
// Run parent features
|
|
13410
|
+
const features = superDef.features;
|
|
13411
|
+
if (features) {
|
|
13412
|
+
for (let i = 0; i < features.length; i++) {
|
|
13413
|
+
const feature = features[i];
|
|
13414
|
+
if (feature && feature.ngInherit) {
|
|
13415
|
+
feature(definition);
|
|
13416
|
+
}
|
|
13417
|
+
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
13418
|
+
// def already has all the necessary information inherited from its super class(es), so we
|
|
13419
|
+
// can stop merging fields from super classes. However we need to iterate through the
|
|
13420
|
+
// prototype chain to look for classes that might contain other "features" (like
|
|
13421
|
+
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
13422
|
+
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
13423
|
+
// logic and only invoking functions from the "features" list.
|
|
13424
|
+
if (feature === ɵɵInheritDefinitionFeature) {
|
|
13425
|
+
shouldInheritFields = false;
|
|
13426
|
+
}
|
|
13427
|
+
}
|
|
13428
|
+
}
|
|
13429
|
+
}
|
|
13430
|
+
superType = Object.getPrototypeOf(superType);
|
|
13554
13431
|
}
|
|
13555
|
-
|
|
13556
|
-
// result so we don't expose an internal data structure in the user's console.
|
|
13557
|
-
return context.directives === null ? [] : [...context.directives];
|
|
13432
|
+
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13558
13433
|
}
|
|
13559
13434
|
/**
|
|
13560
|
-
*
|
|
13561
|
-
* The function accepts an instance of a directive or component and returns the corresponding
|
|
13562
|
-
* metadata.
|
|
13563
|
-
*
|
|
13564
|
-
* @param directiveOrComponentInstance Instance of a directive or component
|
|
13565
|
-
* @returns metadata of the passed directive or component
|
|
13435
|
+
* Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
|
|
13566
13436
|
*
|
|
13567
|
-
* @
|
|
13568
|
-
*
|
|
13437
|
+
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
13438
|
+
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
13439
|
+
* type.
|
|
13569
13440
|
*/
|
|
13570
|
-
function
|
|
13571
|
-
|
|
13572
|
-
|
|
13573
|
-
|
|
13441
|
+
function mergeHostAttrsAcrossInheritance(inheritanceChain) {
|
|
13442
|
+
let hostVars = 0;
|
|
13443
|
+
let hostAttrs = null;
|
|
13444
|
+
// We process the inheritance order from the base to the leaves here.
|
|
13445
|
+
for (let i = inheritanceChain.length - 1; i >= 0; i--) {
|
|
13446
|
+
const def = inheritanceChain[i];
|
|
13447
|
+
// For each `hostVars`, we need to add the superclass amount.
|
|
13448
|
+
def.hostVars = (hostVars += def.hostVars);
|
|
13449
|
+
// for each `hostAttrs` we need to merge it with superclass.
|
|
13450
|
+
def.hostAttrs =
|
|
13451
|
+
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
13574
13452
|
}
|
|
13575
|
-
|
|
13576
|
-
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13453
|
+
}
|
|
13454
|
+
function maybeUnwrapEmpty(value) {
|
|
13455
|
+
if (value === EMPTY_OBJ) {
|
|
13456
|
+
return {};
|
|
13457
|
+
}
|
|
13458
|
+
else if (value === EMPTY_ARRAY) {
|
|
13459
|
+
return [];
|
|
13460
|
+
}
|
|
13461
|
+
else {
|
|
13462
|
+
return value;
|
|
13463
|
+
}
|
|
13464
|
+
}
|
|
13465
|
+
function inheritViewQuery(definition, superViewQuery) {
|
|
13466
|
+
const prevViewQuery = definition.viewQuery;
|
|
13467
|
+
if (prevViewQuery) {
|
|
13468
|
+
definition.viewQuery = (rf, ctx) => {
|
|
13469
|
+
superViewQuery(rf, ctx);
|
|
13470
|
+
prevViewQuery(rf, ctx);
|
|
13585
13471
|
};
|
|
13586
13472
|
}
|
|
13587
|
-
|
|
13588
|
-
|
|
13589
|
-
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
13473
|
+
else {
|
|
13474
|
+
definition.viewQuery = superViewQuery;
|
|
13590
13475
|
}
|
|
13591
|
-
return null;
|
|
13592
13476
|
}
|
|
13593
|
-
|
|
13594
|
-
|
|
13595
|
-
|
|
13596
|
-
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13608
|
-
|
|
13609
|
-
|
|
13610
|
-
|
|
13477
|
+
function inheritContentQueries(definition, superContentQueries) {
|
|
13478
|
+
const prevContentQueries = definition.contentQueries;
|
|
13479
|
+
if (prevContentQueries) {
|
|
13480
|
+
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
13481
|
+
superContentQueries(rf, ctx, directiveIndex);
|
|
13482
|
+
prevContentQueries(rf, ctx, directiveIndex);
|
|
13483
|
+
};
|
|
13484
|
+
}
|
|
13485
|
+
else {
|
|
13486
|
+
definition.contentQueries = superContentQueries;
|
|
13487
|
+
}
|
|
13488
|
+
}
|
|
13489
|
+
function inheritHostBindings(definition, superHostBindings) {
|
|
13490
|
+
const prevHostBindings = definition.hostBindings;
|
|
13491
|
+
if (prevHostBindings) {
|
|
13492
|
+
definition.hostBindings = (rf, ctx) => {
|
|
13493
|
+
superHostBindings(rf, ctx);
|
|
13494
|
+
prevHostBindings(rf, ctx);
|
|
13495
|
+
};
|
|
13496
|
+
}
|
|
13497
|
+
else {
|
|
13498
|
+
definition.hostBindings = superHostBindings;
|
|
13611
13499
|
}
|
|
13612
|
-
return context.localRefs || {};
|
|
13613
13500
|
}
|
|
13501
|
+
|
|
13614
13502
|
/**
|
|
13615
|
-
*
|
|
13616
|
-
*
|
|
13617
|
-
*
|
|
13618
|
-
* @param componentOrDirective Component or directive instance for which the host
|
|
13619
|
-
* element should be retrieved.
|
|
13620
|
-
* @returns Host element of the target.
|
|
13503
|
+
* @license
|
|
13504
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13621
13505
|
*
|
|
13622
|
-
*
|
|
13623
|
-
*
|
|
13506
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13507
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13624
13508
|
*/
|
|
13625
|
-
function getHostElement(componentOrDirective) {
|
|
13626
|
-
return getLContext(componentOrDirective).native;
|
|
13627
|
-
}
|
|
13628
13509
|
/**
|
|
13629
|
-
*
|
|
13630
|
-
*
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13510
|
+
* Fields which exist on either directive or component definitions, and need to be copied from
|
|
13511
|
+
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13512
|
+
*/
|
|
13513
|
+
const COPY_DIRECTIVE_FIELDS = [
|
|
13514
|
+
// The child class should use the providers of its parent.
|
|
13515
|
+
'providersResolver',
|
|
13516
|
+
// Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
|
|
13517
|
+
// as inputs, outputs, and host binding functions.
|
|
13518
|
+
];
|
|
13519
|
+
/**
|
|
13520
|
+
* Fields which exist only on component definitions, and need to be copied from parent to child
|
|
13521
|
+
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
13635
13522
|
*
|
|
13636
|
-
*
|
|
13523
|
+
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
13524
|
+
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13637
13525
|
*/
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
|
|
13526
|
+
const COPY_COMPONENT_FIELDS = [
|
|
13527
|
+
// The child class should use the template function of its parent, including all template
|
|
13528
|
+
// semantics.
|
|
13529
|
+
'template',
|
|
13530
|
+
'decls',
|
|
13531
|
+
'consts',
|
|
13532
|
+
'vars',
|
|
13533
|
+
'onPush',
|
|
13534
|
+
'ngContentSelectors',
|
|
13535
|
+
// The child class should use the CSS styles of its parent, including all styling semantics.
|
|
13536
|
+
'styles',
|
|
13537
|
+
'encapsulation',
|
|
13538
|
+
// The child class should be checked by the runtime in the same way as its parent.
|
|
13539
|
+
'schemas',
|
|
13540
|
+
];
|
|
13642
13541
|
/**
|
|
13643
|
-
*
|
|
13644
|
-
*
|
|
13645
|
-
* (e.g. through `addEventListener`).
|
|
13542
|
+
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
13543
|
+
* definition.
|
|
13646
13544
|
*
|
|
13647
|
-
*
|
|
13648
|
-
*
|
|
13545
|
+
* This exists primarily to support ngcc migration of an existing View Engine pattern, where an
|
|
13546
|
+
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
13547
|
+
* generates a skeleton definition on the child class, and applies this feature.
|
|
13649
13548
|
*
|
|
13650
|
-
*
|
|
13651
|
-
*
|
|
13652
|
-
* <div (click)="doSomething()"></div>
|
|
13653
|
-
* </app-root>
|
|
13654
|
-
* ```
|
|
13655
|
-
*
|
|
13656
|
-
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
13657
|
-
*
|
|
13658
|
-
* ```ts
|
|
13659
|
-
* {
|
|
13660
|
-
* name: 'click',
|
|
13661
|
-
* element: <div>,
|
|
13662
|
-
* callback: () => doSomething(),
|
|
13663
|
-
* useCapture: false
|
|
13664
|
-
* }
|
|
13665
|
-
* ```
|
|
13549
|
+
* The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
|
|
13550
|
+
* including things like the component template function.
|
|
13666
13551
|
*
|
|
13667
|
-
* @param
|
|
13668
|
-
*
|
|
13552
|
+
* @param definition The definition of a child class which inherits from a parent class with its
|
|
13553
|
+
* own definition.
|
|
13669
13554
|
*
|
|
13670
|
-
* @
|
|
13671
|
-
* @globalApi ng
|
|
13555
|
+
* @codeGenApi
|
|
13672
13556
|
*/
|
|
13673
|
-
function
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
13695
|
-
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
13696
|
-
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
13697
|
-
if (element == listenerElement) {
|
|
13698
|
-
listeners.push({ element, name, callback, useCapture, type });
|
|
13699
|
-
}
|
|
13700
|
-
}
|
|
13557
|
+
function ɵɵCopyDefinitionFeature(definition) {
|
|
13558
|
+
let superType = getSuperType(definition.type);
|
|
13559
|
+
let superDef = undefined;
|
|
13560
|
+
if (isComponentDef(definition)) {
|
|
13561
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13562
|
+
superDef = superType.ɵcmp;
|
|
13563
|
+
}
|
|
13564
|
+
else {
|
|
13565
|
+
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
13566
|
+
superDef = superType.ɵdir;
|
|
13567
|
+
}
|
|
13568
|
+
// Needed because `definition` fields are readonly.
|
|
13569
|
+
const defAny = definition;
|
|
13570
|
+
// Copy over any fields that apply to either directives or components.
|
|
13571
|
+
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
13572
|
+
defAny[field] = superDef[field];
|
|
13573
|
+
}
|
|
13574
|
+
if (isComponentDef(superDef)) {
|
|
13575
|
+
// Copy over any component-specific fields.
|
|
13576
|
+
for (const field of COPY_COMPONENT_FIELDS) {
|
|
13577
|
+
defAny[field] = superDef[field];
|
|
13701
13578
|
}
|
|
13702
13579
|
}
|
|
13703
|
-
listeners.sort(sortListeners);
|
|
13704
|
-
return listeners;
|
|
13705
|
-
}
|
|
13706
|
-
function sortListeners(a, b) {
|
|
13707
|
-
if (a.name == b.name)
|
|
13708
|
-
return 0;
|
|
13709
|
-
return a.name < b.name ? -1 : 1;
|
|
13710
13580
|
}
|
|
13581
|
+
|
|
13711
13582
|
/**
|
|
13712
|
-
*
|
|
13583
|
+
* @license
|
|
13584
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13713
13585
|
*
|
|
13714
|
-
*
|
|
13586
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13587
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13715
13588
|
*/
|
|
13716
|
-
|
|
13717
|
-
|
|
13589
|
+
let _symbolIterator = null;
|
|
13590
|
+
function getSymbolIterator() {
|
|
13591
|
+
if (!_symbolIterator) {
|
|
13592
|
+
const Symbol = _global['Symbol'];
|
|
13593
|
+
if (Symbol && Symbol.iterator) {
|
|
13594
|
+
_symbolIterator = Symbol.iterator;
|
|
13595
|
+
}
|
|
13596
|
+
else {
|
|
13597
|
+
// es6-shim specific logic
|
|
13598
|
+
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
13599
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
13600
|
+
const key = keys[i];
|
|
13601
|
+
if (key !== 'entries' && key !== 'size' &&
|
|
13602
|
+
Map.prototype[key] === Map.prototype['entries']) {
|
|
13603
|
+
_symbolIterator = key;
|
|
13604
|
+
}
|
|
13605
|
+
}
|
|
13606
|
+
}
|
|
13607
|
+
}
|
|
13608
|
+
return _symbolIterator;
|
|
13718
13609
|
}
|
|
13610
|
+
|
|
13719
13611
|
/**
|
|
13720
|
-
*
|
|
13612
|
+
* @license
|
|
13613
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13721
13614
|
*
|
|
13722
|
-
*
|
|
13615
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13616
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13723
13617
|
*/
|
|
13724
|
-
function
|
|
13725
|
-
|
|
13726
|
-
|
|
13618
|
+
function isIterable(obj) {
|
|
13619
|
+
return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
|
|
13620
|
+
}
|
|
13621
|
+
function isListLikeIterable(obj) {
|
|
13622
|
+
if (!isJsObject(obj))
|
|
13623
|
+
return false;
|
|
13624
|
+
return Array.isArray(obj) ||
|
|
13625
|
+
(!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
|
|
13626
|
+
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
13627
|
+
}
|
|
13628
|
+
function areIterablesEqual(a, b, comparator) {
|
|
13629
|
+
const iterator1 = a[getSymbolIterator()]();
|
|
13630
|
+
const iterator2 = b[getSymbolIterator()]();
|
|
13631
|
+
while (true) {
|
|
13632
|
+
const item1 = iterator1.next();
|
|
13633
|
+
const item2 = iterator2.next();
|
|
13634
|
+
if (item1.done && item2.done)
|
|
13635
|
+
return true;
|
|
13636
|
+
if (item1.done || item2.done)
|
|
13637
|
+
return false;
|
|
13638
|
+
if (!comparator(item1.value, item2.value))
|
|
13639
|
+
return false;
|
|
13727
13640
|
}
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
if (
|
|
13731
|
-
|
|
13641
|
+
}
|
|
13642
|
+
function iterateListLike(obj, fn) {
|
|
13643
|
+
if (Array.isArray(obj)) {
|
|
13644
|
+
for (let i = 0; i < obj.length; i++) {
|
|
13645
|
+
fn(obj[i]);
|
|
13646
|
+
}
|
|
13732
13647
|
}
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
ngDevMode &&
|
|
13740
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
13741
|
-
return buildDebugNode(tNode, lView);
|
|
13648
|
+
else {
|
|
13649
|
+
const iterator = obj[getSymbolIterator()]();
|
|
13650
|
+
let item;
|
|
13651
|
+
while (!((item = iterator.next()).done)) {
|
|
13652
|
+
fn(item.value);
|
|
13653
|
+
}
|
|
13742
13654
|
}
|
|
13743
|
-
return null;
|
|
13744
|
-
}
|
|
13745
|
-
/**
|
|
13746
|
-
* Retrieve the component `LView` from component/element.
|
|
13747
|
-
*
|
|
13748
|
-
* NOTE: `LView` is a private and should not be leaked outside.
|
|
13749
|
-
* Don't export this method to `ng.*` on window.
|
|
13750
|
-
*
|
|
13751
|
-
* @param target DOM element or component instance for which to retrieve the LView.
|
|
13752
|
-
*/
|
|
13753
|
-
function getComponentLView(target) {
|
|
13754
|
-
const lContext = getLContext(target);
|
|
13755
|
-
const nodeIndx = lContext.nodeIndex;
|
|
13756
|
-
const lView = lContext.lView;
|
|
13757
|
-
ngDevMode && assertLView(lView);
|
|
13758
|
-
const componentLView = lView[nodeIndx];
|
|
13759
|
-
ngDevMode && assertLView(componentLView);
|
|
13760
|
-
return componentLView;
|
|
13761
13655
|
}
|
|
13762
|
-
|
|
13763
|
-
function
|
|
13764
|
-
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
13765
|
-
throw new Error('Expecting instance of DOM Element');
|
|
13766
|
-
}
|
|
13656
|
+
function isJsObject(o) {
|
|
13657
|
+
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
13767
13658
|
}
|
|
13768
13659
|
|
|
13769
13660
|
/**
|
|
@@ -13773,18 +13664,22 @@ function assertDomElement(value) {
|
|
|
13773
13664
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13774
13665
|
* found in the LICENSE file at https://angular.io/license
|
|
13775
13666
|
*/
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13667
|
+
function devModeEqual(a, b) {
|
|
13668
|
+
const isListLikeIterableA = isListLikeIterable(a);
|
|
13669
|
+
const isListLikeIterableB = isListLikeIterable(b);
|
|
13670
|
+
if (isListLikeIterableA && isListLikeIterableB) {
|
|
13671
|
+
return areIterablesEqual(a, b, devModeEqual);
|
|
13672
|
+
}
|
|
13673
|
+
else {
|
|
13674
|
+
const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
|
13675
|
+
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
13676
|
+
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
13677
|
+
return true;
|
|
13678
|
+
}
|
|
13679
|
+
else {
|
|
13680
|
+
return Object.is(a, b);
|
|
13681
|
+
}
|
|
13682
|
+
}
|
|
13788
13683
|
}
|
|
13789
13684
|
|
|
13790
13685
|
/**
|
|
@@ -13794,70 +13689,73 @@ function applyChanges(component) {
|
|
|
13794
13689
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13795
13690
|
* found in the LICENSE file at https://angular.io/license
|
|
13796
13691
|
*/
|
|
13692
|
+
// TODO(misko): consider inlining
|
|
13693
|
+
/** Updates binding and returns the value. */
|
|
13694
|
+
function updateBinding(lView, bindingIndex, value) {
|
|
13695
|
+
return lView[bindingIndex] = value;
|
|
13696
|
+
}
|
|
13697
|
+
/** Gets the current binding value. */
|
|
13698
|
+
function getBinding(lView, bindingIndex) {
|
|
13699
|
+
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
13700
|
+
ngDevMode &&
|
|
13701
|
+
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
13702
|
+
return lView[bindingIndex];
|
|
13703
|
+
}
|
|
13797
13704
|
/**
|
|
13798
|
-
*
|
|
13799
|
-
* to allow for the Angular debugging story to function.
|
|
13800
|
-
*
|
|
13801
|
-
* To see this in action run the following command:
|
|
13802
|
-
*
|
|
13803
|
-
* bazel run //packages/core/test/bundling/todo:devserver
|
|
13705
|
+
* Updates binding if changed, then returns whether it was updated.
|
|
13804
13706
|
*
|
|
13805
|
-
*
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
* This value reflects the property on the window where the dev
|
|
13809
|
-
* tools are patched (window.ng).
|
|
13810
|
-
* */
|
|
13811
|
-
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
13812
|
-
let _published = false;
|
|
13813
|
-
/**
|
|
13814
|
-
* Publishes a collection of default debug tools onto`window.ng`.
|
|
13707
|
+
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
13708
|
+
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
13709
|
+
* behavior.
|
|
13815
13710
|
*
|
|
13816
|
-
*
|
|
13817
|
-
*
|
|
13711
|
+
* @param lView current `LView`
|
|
13712
|
+
* @param bindingIndex The binding in the `LView` to check
|
|
13713
|
+
* @param value New value to check against `lView[bindingIndex]`
|
|
13714
|
+
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
13715
|
+
* `CheckNoChangesMode`)
|
|
13818
13716
|
*/
|
|
13819
|
-
function
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
|
|
13824
|
-
|
|
13825
|
-
|
|
13826
|
-
*/
|
|
13827
|
-
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
13828
|
-
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
13829
|
-
publishGlobalUtil('getComponent', getComponent$1);
|
|
13830
|
-
publishGlobalUtil('getContext', getContext);
|
|
13831
|
-
publishGlobalUtil('getListeners', getListeners);
|
|
13832
|
-
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
13833
|
-
publishGlobalUtil('getHostElement', getHostElement);
|
|
13834
|
-
publishGlobalUtil('getInjector', getInjector);
|
|
13835
|
-
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
13836
|
-
publishGlobalUtil('getDirectives', getDirectives);
|
|
13837
|
-
publishGlobalUtil('applyChanges', applyChanges);
|
|
13717
|
+
function bindingUpdated(lView, bindingIndex, value) {
|
|
13718
|
+
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
13719
|
+
ngDevMode &&
|
|
13720
|
+
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
13721
|
+
const oldValue = lView[bindingIndex];
|
|
13722
|
+
if (Object.is(oldValue, value)) {
|
|
13723
|
+
return false;
|
|
13838
13724
|
}
|
|
13839
|
-
|
|
13840
|
-
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
13848
|
-
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
13849
|
-
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
13850
|
-
const w = _global;
|
|
13851
|
-
ngDevMode && assertDefined(fn, 'function not defined');
|
|
13852
|
-
if (w) {
|
|
13853
|
-
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
13854
|
-
if (!container) {
|
|
13855
|
-
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
13725
|
+
else {
|
|
13726
|
+
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
13727
|
+
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
13728
|
+
// (before the change detection was run).
|
|
13729
|
+
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
13730
|
+
if (!devModeEqual(oldValueToCompare, value)) {
|
|
13731
|
+
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
13732
|
+
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
13856
13733
|
}
|
|
13857
|
-
|
|
13734
|
+
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
13735
|
+
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
13736
|
+
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
13737
|
+
// as change on next CD.)
|
|
13738
|
+
return false;
|
|
13858
13739
|
}
|
|
13740
|
+
lView[bindingIndex] = value;
|
|
13741
|
+
return true;
|
|
13859
13742
|
}
|
|
13860
13743
|
}
|
|
13744
|
+
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
13745
|
+
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
13746
|
+
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
13747
|
+
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
13748
|
+
}
|
|
13749
|
+
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
13750
|
+
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
13751
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13752
|
+
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
13753
|
+
}
|
|
13754
|
+
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
13755
|
+
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
13756
|
+
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
13757
|
+
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
13758
|
+
}
|
|
13861
13759
|
|
|
13862
13760
|
/**
|
|
13863
13761
|
* @license
|
|
@@ -13866,980 +13764,377 @@ function publishGlobalUtil(name, fn) {
|
|
|
13866
13764
|
* Use of this source code is governed by an MIT-style license that can be
|
|
13867
13765
|
* found in the LICENSE file at https://angular.io/license
|
|
13868
13766
|
*/
|
|
13869
|
-
// TODO: A hack to not pull in the NullInjector from @angular/core.
|
|
13870
|
-
const NULL_INJECTOR = {
|
|
13871
|
-
get: (token, notFoundValue) => {
|
|
13872
|
-
throwProviderNotFoundError(token, 'NullInjector');
|
|
13873
|
-
}
|
|
13874
|
-
};
|
|
13875
13767
|
/**
|
|
13876
|
-
*
|
|
13877
|
-
*
|
|
13768
|
+
* Updates the value of or removes a bound attribute on an Element.
|
|
13769
|
+
*
|
|
13770
|
+
* Used in the case of `[attr.title]="value"`
|
|
13878
13771
|
*
|
|
13879
|
-
*
|
|
13880
|
-
*
|
|
13881
|
-
*
|
|
13882
|
-
*
|
|
13883
|
-
*
|
|
13772
|
+
* @param name name The name of the attribute.
|
|
13773
|
+
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
13774
|
+
* Otherwise the attribute value is set to the stringified value.
|
|
13775
|
+
* @param sanitizer An optional function used to sanitize the value.
|
|
13776
|
+
* @param namespace Optional namespace to use when setting the attribute.
|
|
13884
13777
|
*
|
|
13885
|
-
* @
|
|
13886
|
-
* @param options Optional parameters which control bootstrapping
|
|
13778
|
+
* @codeGenApi
|
|
13887
13779
|
*/
|
|
13888
|
-
function
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
// The first index of the first selector is the tag name.
|
|
13897
|
-
const componentTag = componentDef.selectors[0][0];
|
|
13898
|
-
const hostRenderer = rendererFactory.createRenderer(null, null);
|
|
13899
|
-
const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
|
|
13900
|
-
const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
|
|
13901
|
-
16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
|
|
13902
|
-
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
13903
|
-
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
13904
|
-
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
13905
|
-
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
13906
|
-
enterView(rootView);
|
|
13907
|
-
let component;
|
|
13908
|
-
try {
|
|
13909
|
-
if (rendererFactory.begin)
|
|
13910
|
-
rendererFactory.begin();
|
|
13911
|
-
const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
|
|
13912
|
-
component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
|
|
13913
|
-
// create mode pass
|
|
13914
|
-
renderView(rootTView, rootView, null);
|
|
13915
|
-
// update mode pass
|
|
13916
|
-
refreshView(rootTView, rootView, null, null);
|
|
13917
|
-
}
|
|
13918
|
-
finally {
|
|
13919
|
-
leaveView();
|
|
13920
|
-
if (rendererFactory.end)
|
|
13921
|
-
rendererFactory.end();
|
|
13780
|
+
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
13781
|
+
const lView = getLView();
|
|
13782
|
+
const bindingIndex = nextBindingIndex();
|
|
13783
|
+
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
13784
|
+
const tView = getTView();
|
|
13785
|
+
const tNode = getSelectedTNode();
|
|
13786
|
+
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
13787
|
+
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
13922
13788
|
}
|
|
13923
|
-
return
|
|
13789
|
+
return ɵɵattribute;
|
|
13924
13790
|
}
|
|
13791
|
+
|
|
13925
13792
|
/**
|
|
13926
|
-
*
|
|
13927
|
-
*
|
|
13928
|
-
* @param rNode Render host element.
|
|
13929
|
-
* @param def ComponentDef
|
|
13930
|
-
* @param rootView The parent view where the host node is stored
|
|
13931
|
-
* @param rendererFactory Factory to be used for creating child renderers.
|
|
13932
|
-
* @param hostRenderer The current renderer
|
|
13933
|
-
* @param sanitizer The sanitizer, if provided
|
|
13793
|
+
* @license
|
|
13794
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13934
13795
|
*
|
|
13935
|
-
*
|
|
13796
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13797
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13936
13798
|
*/
|
|
13937
|
-
function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
|
|
13938
|
-
const tView = rootView[TVIEW];
|
|
13939
|
-
const index = HEADER_OFFSET;
|
|
13940
|
-
ngDevMode && assertIndexInRange(rootView, index);
|
|
13941
|
-
rootView[index] = rNode;
|
|
13942
|
-
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
13943
|
-
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
13944
|
-
// representing a host element.
|
|
13945
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
13946
|
-
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
13947
|
-
if (mergedAttrs !== null) {
|
|
13948
|
-
computeStaticStyling(tNode, mergedAttrs, true);
|
|
13949
|
-
if (rNode !== null) {
|
|
13950
|
-
setUpAttributes(hostRenderer, rNode, mergedAttrs);
|
|
13951
|
-
if (tNode.classes !== null) {
|
|
13952
|
-
writeDirectClass(hostRenderer, rNode, tNode.classes);
|
|
13953
|
-
}
|
|
13954
|
-
if (tNode.styles !== null) {
|
|
13955
|
-
writeDirectStyle(hostRenderer, rNode, tNode.styles);
|
|
13956
|
-
}
|
|
13957
|
-
}
|
|
13958
|
-
}
|
|
13959
|
-
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
13960
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
13961
|
-
if (tView.firstCreatePass) {
|
|
13962
|
-
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
13963
|
-
markAsComponentHost(tView, tNode);
|
|
13964
|
-
initTNodeFlags(tNode, rootView.length, 1);
|
|
13965
|
-
}
|
|
13966
|
-
addToViewTree(rootView, componentView);
|
|
13967
|
-
// Store component view at node index, with node as the HOST
|
|
13968
|
-
return rootView[index] = componentView;
|
|
13969
|
-
}
|
|
13970
13799
|
/**
|
|
13971
|
-
*
|
|
13972
|
-
*
|
|
13800
|
+
* Create interpolation bindings with a variable number of expressions.
|
|
13801
|
+
*
|
|
13802
|
+
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
13803
|
+
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
13804
|
+
*
|
|
13805
|
+
* `values`:
|
|
13806
|
+
* - has static text at even indexes,
|
|
13807
|
+
* - has evaluated expressions at odd indexes.
|
|
13808
|
+
*
|
|
13809
|
+
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
13973
13810
|
*/
|
|
13974
|
-
function
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
feature(component, componentDef);
|
|
13983
|
-
}
|
|
13811
|
+
function interpolationV(lView, values) {
|
|
13812
|
+
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
13813
|
+
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
13814
|
+
let isBindingUpdated = false;
|
|
13815
|
+
let bindingIndex = getBindingIndex();
|
|
13816
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13817
|
+
// Check if bindings (odd indexes) have changed
|
|
13818
|
+
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
13984
13819
|
}
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
const tNode = getCurrentTNode();
|
|
13989
|
-
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
13990
|
-
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
13820
|
+
setBindingIndex(bindingIndex);
|
|
13821
|
+
if (!isBindingUpdated) {
|
|
13822
|
+
return NO_CHANGE;
|
|
13991
13823
|
}
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
setSelectedIndex(rootTNode.index);
|
|
13997
|
-
const rootTView = rootLView[TVIEW];
|
|
13998
|
-
registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
|
|
13999
|
-
invokeHostBindingsInCreationMode(componentDef, component);
|
|
13824
|
+
// Build the updated content
|
|
13825
|
+
let content = values[0];
|
|
13826
|
+
for (let i = 1; i < values.length; i += 2) {
|
|
13827
|
+
content += renderStringify(values[i]) + values[i + 1];
|
|
14000
13828
|
}
|
|
14001
|
-
return
|
|
14002
|
-
}
|
|
14003
|
-
function createRootContext(scheduler, playerHandler) {
|
|
14004
|
-
return {
|
|
14005
|
-
components: [],
|
|
14006
|
-
scheduler: scheduler || defaultScheduler,
|
|
14007
|
-
clean: CLEAN_PROMISE,
|
|
14008
|
-
playerHandler: playerHandler || null,
|
|
14009
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
14010
|
-
};
|
|
13829
|
+
return content;
|
|
14011
13830
|
}
|
|
14012
13831
|
/**
|
|
14013
|
-
*
|
|
14014
|
-
*
|
|
14015
|
-
* Include this feature when calling `renderComponent` if the root component
|
|
14016
|
-
* you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
|
|
14017
|
-
* be called properly.
|
|
14018
|
-
*
|
|
14019
|
-
* Example:
|
|
13832
|
+
* Creates an interpolation binding with 1 expression.
|
|
14020
13833
|
*
|
|
14021
|
-
*
|
|
14022
|
-
*
|
|
14023
|
-
*
|
|
13834
|
+
* @param prefix static value used for concatenation only.
|
|
13835
|
+
* @param v0 value checked for change.
|
|
13836
|
+
* @param suffix static value used for concatenation only.
|
|
14024
13837
|
*/
|
|
14025
|
-
function
|
|
14026
|
-
const
|
|
14027
|
-
|
|
14028
|
-
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
13838
|
+
function interpolation1(lView, prefix, v0, suffix) {
|
|
13839
|
+
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
13840
|
+
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14029
13841
|
}
|
|
14030
13842
|
/**
|
|
14031
|
-
*
|
|
14032
|
-
*
|
|
14033
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14034
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14035
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14036
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14037
|
-
*
|
|
14038
|
-
* Example:
|
|
14039
|
-
* ```
|
|
14040
|
-
* await whenRendered(myComponent);
|
|
14041
|
-
* ```
|
|
14042
|
-
*
|
|
14043
|
-
* @param component Component to wait upon
|
|
14044
|
-
* @returns Promise which resolves when the component is rendered.
|
|
13843
|
+
* Creates an interpolation binding with 2 expressions.
|
|
14045
13844
|
*/
|
|
14046
|
-
function
|
|
14047
|
-
|
|
13845
|
+
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
13846
|
+
const bindingIndex = getBindingIndex();
|
|
13847
|
+
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
13848
|
+
incrementBindingIndex(2);
|
|
13849
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14048
13850
|
}
|
|
14049
|
-
|
|
14050
13851
|
/**
|
|
14051
|
-
*
|
|
14052
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14053
|
-
*
|
|
14054
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14055
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13852
|
+
* Creates an interpolation binding with 3 expressions.
|
|
14056
13853
|
*/
|
|
14057
|
-
function
|
|
14058
|
-
|
|
13854
|
+
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
13855
|
+
const bindingIndex = getBindingIndex();
|
|
13856
|
+
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
13857
|
+
incrementBindingIndex(3);
|
|
13858
|
+
return different ?
|
|
13859
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
13860
|
+
NO_CHANGE;
|
|
14059
13861
|
}
|
|
14060
13862
|
/**
|
|
14061
|
-
*
|
|
14062
|
-
* @param definition The definition that is a SubClass of another directive of component
|
|
14063
|
-
*
|
|
14064
|
-
* @codeGenApi
|
|
13863
|
+
* Create an interpolation binding with 4 expressions.
|
|
14065
13864
|
*/
|
|
14066
|
-
function
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
|
|
14072
|
-
|
|
14073
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14074
|
-
superDef = superType.ɵcmp || superType.ɵdir;
|
|
14075
|
-
}
|
|
14076
|
-
else {
|
|
14077
|
-
if (superType.ɵcmp) {
|
|
14078
|
-
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
14079
|
-
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
14080
|
-
}
|
|
14081
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14082
|
-
superDef = superType.ɵdir;
|
|
14083
|
-
}
|
|
14084
|
-
if (superDef) {
|
|
14085
|
-
if (shouldInheritFields) {
|
|
14086
|
-
inheritanceChain.push(superDef);
|
|
14087
|
-
// Some fields in the definition may be empty, if there were no values to put in them that
|
|
14088
|
-
// would've justified object creation. Unwrap them if necessary.
|
|
14089
|
-
const writeableDef = definition;
|
|
14090
|
-
writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
|
|
14091
|
-
writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
|
|
14092
|
-
writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
|
|
14093
|
-
// Merge hostBindings
|
|
14094
|
-
const superHostBindings = superDef.hostBindings;
|
|
14095
|
-
superHostBindings && inheritHostBindings(definition, superHostBindings);
|
|
14096
|
-
// Merge queries
|
|
14097
|
-
const superViewQuery = superDef.viewQuery;
|
|
14098
|
-
const superContentQueries = superDef.contentQueries;
|
|
14099
|
-
superViewQuery && inheritViewQuery(definition, superViewQuery);
|
|
14100
|
-
superContentQueries && inheritContentQueries(definition, superContentQueries);
|
|
14101
|
-
// Merge inputs and outputs
|
|
14102
|
-
fillProperties(definition.inputs, superDef.inputs);
|
|
14103
|
-
fillProperties(definition.declaredInputs, superDef.declaredInputs);
|
|
14104
|
-
fillProperties(definition.outputs, superDef.outputs);
|
|
14105
|
-
// Merge animations metadata.
|
|
14106
|
-
// If `superDef` is a Component, the `data` field is present (defaults to an empty object).
|
|
14107
|
-
if (isComponentDef(superDef) && superDef.data.animation) {
|
|
14108
|
-
// If super def is a Component, the `definition` is also a Component, since Directives can
|
|
14109
|
-
// not inherit Components (we throw an error above and cannot reach this code).
|
|
14110
|
-
const defData = definition.data;
|
|
14111
|
-
defData.animation = (defData.animation || []).concat(superDef.data.animation);
|
|
14112
|
-
}
|
|
14113
|
-
}
|
|
14114
|
-
// Run parent features
|
|
14115
|
-
const features = superDef.features;
|
|
14116
|
-
if (features) {
|
|
14117
|
-
for (let i = 0; i < features.length; i++) {
|
|
14118
|
-
const feature = features[i];
|
|
14119
|
-
if (feature && feature.ngInherit) {
|
|
14120
|
-
feature(definition);
|
|
14121
|
-
}
|
|
14122
|
-
// If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
|
|
14123
|
-
// def already has all the necessary information inherited from its super class(es), so we
|
|
14124
|
-
// can stop merging fields from super classes. However we need to iterate through the
|
|
14125
|
-
// prototype chain to look for classes that might contain other "features" (like
|
|
14126
|
-
// NgOnChanges), which we should invoke for the original `definition`. We set the
|
|
14127
|
-
// `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
|
|
14128
|
-
// logic and only invoking functions from the "features" list.
|
|
14129
|
-
if (feature === ɵɵInheritDefinitionFeature) {
|
|
14130
|
-
shouldInheritFields = false;
|
|
14131
|
-
}
|
|
14132
|
-
}
|
|
14133
|
-
}
|
|
14134
|
-
}
|
|
14135
|
-
superType = Object.getPrototypeOf(superType);
|
|
14136
|
-
}
|
|
14137
|
-
mergeHostAttrsAcrossInheritance(inheritanceChain);
|
|
13865
|
+
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
13866
|
+
const bindingIndex = getBindingIndex();
|
|
13867
|
+
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13868
|
+
incrementBindingIndex(4);
|
|
13869
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13870
|
+
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
13871
|
+
NO_CHANGE;
|
|
14138
13872
|
}
|
|
14139
13873
|
/**
|
|
14140
|
-
*
|
|
14141
|
-
*
|
|
14142
|
-
* @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
|
|
14143
|
-
* sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
|
|
14144
|
-
* type.
|
|
13874
|
+
* Creates an interpolation binding with 5 expressions.
|
|
14145
13875
|
*/
|
|
14146
|
-
function
|
|
14147
|
-
|
|
14148
|
-
let
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
// for each `hostAttrs` we need to merge it with superclass.
|
|
14155
|
-
def.hostAttrs =
|
|
14156
|
-
mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
|
|
14157
|
-
}
|
|
14158
|
-
}
|
|
14159
|
-
function maybeUnwrapEmpty(value) {
|
|
14160
|
-
if (value === EMPTY_OBJ) {
|
|
14161
|
-
return {};
|
|
14162
|
-
}
|
|
14163
|
-
else if (value === EMPTY_ARRAY) {
|
|
14164
|
-
return [];
|
|
14165
|
-
}
|
|
14166
|
-
else {
|
|
14167
|
-
return value;
|
|
14168
|
-
}
|
|
14169
|
-
}
|
|
14170
|
-
function inheritViewQuery(definition, superViewQuery) {
|
|
14171
|
-
const prevViewQuery = definition.viewQuery;
|
|
14172
|
-
if (prevViewQuery) {
|
|
14173
|
-
definition.viewQuery = (rf, ctx) => {
|
|
14174
|
-
superViewQuery(rf, ctx);
|
|
14175
|
-
prevViewQuery(rf, ctx);
|
|
14176
|
-
};
|
|
14177
|
-
}
|
|
14178
|
-
else {
|
|
14179
|
-
definition.viewQuery = superViewQuery;
|
|
14180
|
-
}
|
|
14181
|
-
}
|
|
14182
|
-
function inheritContentQueries(definition, superContentQueries) {
|
|
14183
|
-
const prevContentQueries = definition.contentQueries;
|
|
14184
|
-
if (prevContentQueries) {
|
|
14185
|
-
definition.contentQueries = (rf, ctx, directiveIndex) => {
|
|
14186
|
-
superContentQueries(rf, ctx, directiveIndex);
|
|
14187
|
-
prevContentQueries(rf, ctx, directiveIndex);
|
|
14188
|
-
};
|
|
14189
|
-
}
|
|
14190
|
-
else {
|
|
14191
|
-
definition.contentQueries = superContentQueries;
|
|
14192
|
-
}
|
|
14193
|
-
}
|
|
14194
|
-
function inheritHostBindings(definition, superHostBindings) {
|
|
14195
|
-
const prevHostBindings = definition.hostBindings;
|
|
14196
|
-
if (prevHostBindings) {
|
|
14197
|
-
definition.hostBindings = (rf, ctx) => {
|
|
14198
|
-
superHostBindings(rf, ctx);
|
|
14199
|
-
prevHostBindings(rf, ctx);
|
|
14200
|
-
};
|
|
14201
|
-
}
|
|
14202
|
-
else {
|
|
14203
|
-
definition.hostBindings = superHostBindings;
|
|
14204
|
-
}
|
|
13876
|
+
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
13877
|
+
const bindingIndex = getBindingIndex();
|
|
13878
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13879
|
+
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
13880
|
+
incrementBindingIndex(5);
|
|
13881
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13882
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
13883
|
+
NO_CHANGE;
|
|
14205
13884
|
}
|
|
14206
|
-
|
|
14207
13885
|
/**
|
|
14208
|
-
*
|
|
14209
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14210
|
-
*
|
|
14211
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14212
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13886
|
+
* Creates an interpolation binding with 6 expressions.
|
|
14213
13887
|
*/
|
|
13888
|
+
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
13889
|
+
const bindingIndex = getBindingIndex();
|
|
13890
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13891
|
+
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
13892
|
+
incrementBindingIndex(6);
|
|
13893
|
+
return different ?
|
|
13894
|
+
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
13895
|
+
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
13896
|
+
NO_CHANGE;
|
|
13897
|
+
}
|
|
14214
13898
|
/**
|
|
14215
|
-
*
|
|
14216
|
-
* parent to child classes by the `ɵɵCopyDefinitionFeature`.
|
|
13899
|
+
* Creates an interpolation binding with 7 expressions.
|
|
14217
13900
|
*/
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
|
|
13901
|
+
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
13902
|
+
const bindingIndex = getBindingIndex();
|
|
13903
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13904
|
+
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
13905
|
+
incrementBindingIndex(7);
|
|
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) + suffix :
|
|
13909
|
+
NO_CHANGE;
|
|
13910
|
+
}
|
|
14224
13911
|
/**
|
|
14225
|
-
*
|
|
14226
|
-
* classes by the `ɵɵCopyDefinitionFeature`.
|
|
14227
|
-
*
|
|
14228
|
-
* The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
|
|
14229
|
-
* since those should go in `COPY_DIRECTIVE_FIELDS` above.
|
|
13912
|
+
* Creates an interpolation binding with 8 expressions.
|
|
14230
13913
|
*/
|
|
14231
|
-
|
|
14232
|
-
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
'encapsulation',
|
|
14243
|
-
// The child class should be checked by the runtime in the same way as its parent.
|
|
14244
|
-
'schemas',
|
|
14245
|
-
];
|
|
13914
|
+
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
13915
|
+
const bindingIndex = getBindingIndex();
|
|
13916
|
+
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
13917
|
+
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
13918
|
+
incrementBindingIndex(8);
|
|
13919
|
+
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
13920
|
+
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
13921
|
+
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
13922
|
+
NO_CHANGE;
|
|
13923
|
+
}
|
|
13924
|
+
|
|
14246
13925
|
/**
|
|
14247
|
-
* Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
|
|
14248
|
-
* definition.
|
|
14249
13926
|
*
|
|
14250
|
-
*
|
|
14251
|
-
* entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
|
|
14252
|
-
* generates a skeleton definition on the child class, and applies this feature.
|
|
13927
|
+
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14253
13928
|
*
|
|
14254
|
-
*
|
|
14255
|
-
* including things like the component template function.
|
|
13929
|
+
* Used when the value passed to a property has 1 interpolated value in it:
|
|
14256
13930
|
*
|
|
14257
|
-
*
|
|
14258
|
-
*
|
|
13931
|
+
* ```html
|
|
13932
|
+
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
13933
|
+
* ```
|
|
14259
13934
|
*
|
|
14260
|
-
*
|
|
13935
|
+
* Its compiled representation is::
|
|
13936
|
+
*
|
|
13937
|
+
* ```ts
|
|
13938
|
+
* ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
|
|
13939
|
+
* ```
|
|
13940
|
+
*
|
|
13941
|
+
* @param attrName The name of the attribute to update
|
|
13942
|
+
* @param prefix Static value used for concatenation only.
|
|
13943
|
+
* @param v0 Value checked for change.
|
|
13944
|
+
* @param suffix Static value used for concatenation only.
|
|
13945
|
+
* @param sanitizer An optional sanitizer function
|
|
13946
|
+
* @returns itself, so that it may be chained.
|
|
13947
|
+
* @codeGenApi
|
|
14261
13948
|
*/
|
|
14262
|
-
function
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
if (
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14271
|
-
superDef = superType.ɵdir;
|
|
14272
|
-
}
|
|
14273
|
-
// Needed because `definition` fields are readonly.
|
|
14274
|
-
const defAny = definition;
|
|
14275
|
-
// Copy over any fields that apply to either directives or components.
|
|
14276
|
-
for (const field of COPY_DIRECTIVE_FIELDS) {
|
|
14277
|
-
defAny[field] = superDef[field];
|
|
14278
|
-
}
|
|
14279
|
-
if (isComponentDef(superDef)) {
|
|
14280
|
-
// Copy over any component-specific fields.
|
|
14281
|
-
for (const field of COPY_COMPONENT_FIELDS) {
|
|
14282
|
-
defAny[field] = superDef[field];
|
|
14283
|
-
}
|
|
13949
|
+
function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
|
|
13950
|
+
const lView = getLView();
|
|
13951
|
+
const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
|
|
13952
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13953
|
+
const tNode = getSelectedTNode();
|
|
13954
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13955
|
+
ngDevMode &&
|
|
13956
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
|
|
14284
13957
|
}
|
|
13958
|
+
return ɵɵattributeInterpolate1;
|
|
14285
13959
|
}
|
|
14286
|
-
|
|
14287
13960
|
/**
|
|
14288
|
-
* @license
|
|
14289
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14290
13961
|
*
|
|
14291
|
-
*
|
|
14292
|
-
*
|
|
13962
|
+
* Update an interpolated attribute on an element with 2 bound values surrounded by text.
|
|
13963
|
+
*
|
|
13964
|
+
* Used when the value passed to a property has 2 interpolated values in it:
|
|
13965
|
+
*
|
|
13966
|
+
* ```html
|
|
13967
|
+
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
13968
|
+
* ```
|
|
13969
|
+
*
|
|
13970
|
+
* Its compiled representation is::
|
|
13971
|
+
*
|
|
13972
|
+
* ```ts
|
|
13973
|
+
* ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
|
|
13974
|
+
* ```
|
|
13975
|
+
*
|
|
13976
|
+
* @param attrName The name of the attribute to update
|
|
13977
|
+
* @param prefix Static value used for concatenation only.
|
|
13978
|
+
* @param v0 Value checked for change.
|
|
13979
|
+
* @param i0 Static value used for concatenation only.
|
|
13980
|
+
* @param v1 Value checked for change.
|
|
13981
|
+
* @param suffix Static value used for concatenation only.
|
|
13982
|
+
* @param sanitizer An optional sanitizer function
|
|
13983
|
+
* @returns itself, so that it may be chained.
|
|
13984
|
+
* @codeGenApi
|
|
14293
13985
|
*/
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
// es6-shim specific logic
|
|
14303
|
-
const keys = Object.getOwnPropertyNames(Map.prototype);
|
|
14304
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
14305
|
-
const key = keys[i];
|
|
14306
|
-
if (key !== 'entries' && key !== 'size' &&
|
|
14307
|
-
Map.prototype[key] === Map.prototype['entries']) {
|
|
14308
|
-
_symbolIterator = key;
|
|
14309
|
-
}
|
|
14310
|
-
}
|
|
14311
|
-
}
|
|
13986
|
+
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
13987
|
+
const lView = getLView();
|
|
13988
|
+
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
13989
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
13990
|
+
const tNode = getSelectedTNode();
|
|
13991
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
13992
|
+
ngDevMode &&
|
|
13993
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14312
13994
|
}
|
|
14313
|
-
return
|
|
13995
|
+
return ɵɵattributeInterpolate2;
|
|
14314
13996
|
}
|
|
14315
|
-
|
|
14316
13997
|
/**
|
|
14317
|
-
* @license
|
|
14318
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14319
13998
|
*
|
|
14320
|
-
*
|
|
14321
|
-
*
|
|
13999
|
+
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
14000
|
+
*
|
|
14001
|
+
* Used when the value passed to a property has 3 interpolated values in it:
|
|
14002
|
+
*
|
|
14003
|
+
* ```html
|
|
14004
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
14005
|
+
* ```
|
|
14006
|
+
*
|
|
14007
|
+
* Its compiled representation is::
|
|
14008
|
+
*
|
|
14009
|
+
* ```ts
|
|
14010
|
+
* ɵɵattributeInterpolate3(
|
|
14011
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
14012
|
+
* ```
|
|
14013
|
+
*
|
|
14014
|
+
* @param attrName The name of the attribute to update
|
|
14015
|
+
* @param prefix Static value used for concatenation only.
|
|
14016
|
+
* @param v0 Value checked for change.
|
|
14017
|
+
* @param i0 Static value used for concatenation only.
|
|
14018
|
+
* @param v1 Value checked for change.
|
|
14019
|
+
* @param i1 Static value used for concatenation only.
|
|
14020
|
+
* @param v2 Value checked for change.
|
|
14021
|
+
* @param suffix Static value used for concatenation only.
|
|
14022
|
+
* @param sanitizer An optional sanitizer function
|
|
14023
|
+
* @returns itself, so that it may be chained.
|
|
14024
|
+
* @codeGenApi
|
|
14322
14025
|
*/
|
|
14323
|
-
function
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
|
|
14332
|
-
}
|
|
14333
|
-
function areIterablesEqual(a, b, comparator) {
|
|
14334
|
-
const iterator1 = a[getSymbolIterator()]();
|
|
14335
|
-
const iterator2 = b[getSymbolIterator()]();
|
|
14336
|
-
while (true) {
|
|
14337
|
-
const item1 = iterator1.next();
|
|
14338
|
-
const item2 = iterator2.next();
|
|
14339
|
-
if (item1.done && item2.done)
|
|
14340
|
-
return true;
|
|
14341
|
-
if (item1.done || item2.done)
|
|
14342
|
-
return false;
|
|
14343
|
-
if (!comparator(item1.value, item2.value))
|
|
14344
|
-
return false;
|
|
14345
|
-
}
|
|
14346
|
-
}
|
|
14347
|
-
function iterateListLike(obj, fn) {
|
|
14348
|
-
if (Array.isArray(obj)) {
|
|
14349
|
-
for (let i = 0; i < obj.length; i++) {
|
|
14350
|
-
fn(obj[i]);
|
|
14351
|
-
}
|
|
14352
|
-
}
|
|
14353
|
-
else {
|
|
14354
|
-
const iterator = obj[getSymbolIterator()]();
|
|
14355
|
-
let item;
|
|
14356
|
-
while (!((item = iterator.next()).done)) {
|
|
14357
|
-
fn(item.value);
|
|
14358
|
-
}
|
|
14026
|
+
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14027
|
+
const lView = getLView();
|
|
14028
|
+
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14029
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
14030
|
+
const tNode = getSelectedTNode();
|
|
14031
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14032
|
+
ngDevMode &&
|
|
14033
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14359
14034
|
}
|
|
14035
|
+
return ɵɵattributeInterpolate3;
|
|
14360
14036
|
}
|
|
14361
|
-
function isJsObject(o) {
|
|
14362
|
-
return o !== null && (typeof o === 'function' || typeof o === 'object');
|
|
14363
|
-
}
|
|
14364
|
-
|
|
14365
14037
|
/**
|
|
14366
|
-
* @license
|
|
14367
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14368
14038
|
*
|
|
14369
|
-
*
|
|
14370
|
-
*
|
|
14039
|
+
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14040
|
+
*
|
|
14041
|
+
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14042
|
+
*
|
|
14043
|
+
* ```html
|
|
14044
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14045
|
+
* ```
|
|
14046
|
+
*
|
|
14047
|
+
* Its compiled representation is::
|
|
14048
|
+
*
|
|
14049
|
+
* ```ts
|
|
14050
|
+
* ɵɵattributeInterpolate4(
|
|
14051
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14052
|
+
* ```
|
|
14053
|
+
*
|
|
14054
|
+
* @param attrName The name of the attribute to update
|
|
14055
|
+
* @param prefix Static value used for concatenation only.
|
|
14056
|
+
* @param v0 Value checked for change.
|
|
14057
|
+
* @param i0 Static value used for concatenation only.
|
|
14058
|
+
* @param v1 Value checked for change.
|
|
14059
|
+
* @param i1 Static value used for concatenation only.
|
|
14060
|
+
* @param v2 Value checked for change.
|
|
14061
|
+
* @param i2 Static value used for concatenation only.
|
|
14062
|
+
* @param v3 Value checked for change.
|
|
14063
|
+
* @param suffix Static value used for concatenation only.
|
|
14064
|
+
* @param sanitizer An optional sanitizer function
|
|
14065
|
+
* @returns itself, so that it may be chained.
|
|
14066
|
+
* @codeGenApi
|
|
14371
14067
|
*/
|
|
14372
|
-
function
|
|
14373
|
-
const
|
|
14374
|
-
const
|
|
14375
|
-
if (
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
14381
|
-
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
14382
|
-
return true;
|
|
14383
|
-
}
|
|
14384
|
-
else {
|
|
14385
|
-
return Object.is(a, b);
|
|
14386
|
-
}
|
|
14068
|
+
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14069
|
+
const lView = getLView();
|
|
14070
|
+
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14071
|
+
if (interpolatedValue !== NO_CHANGE) {
|
|
14072
|
+
const tNode = getSelectedTNode();
|
|
14073
|
+
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14074
|
+
ngDevMode &&
|
|
14075
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14387
14076
|
}
|
|
14077
|
+
return ɵɵattributeInterpolate4;
|
|
14388
14078
|
}
|
|
14389
|
-
|
|
14390
14079
|
/**
|
|
14391
|
-
* @license
|
|
14392
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14393
14080
|
*
|
|
14394
|
-
*
|
|
14395
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14396
|
-
*/
|
|
14397
|
-
// TODO(misko): consider inlining
|
|
14398
|
-
/** Updates binding and returns the value. */
|
|
14399
|
-
function updateBinding(lView, bindingIndex, value) {
|
|
14400
|
-
return lView[bindingIndex] = value;
|
|
14401
|
-
}
|
|
14402
|
-
/** Gets the current binding value. */
|
|
14403
|
-
function getBinding(lView, bindingIndex) {
|
|
14404
|
-
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
14405
|
-
ngDevMode &&
|
|
14406
|
-
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
14407
|
-
return lView[bindingIndex];
|
|
14408
|
-
}
|
|
14409
|
-
/**
|
|
14410
|
-
* Updates binding if changed, then returns whether it was updated.
|
|
14411
|
-
*
|
|
14412
|
-
* This function also checks the `CheckNoChangesMode` and throws if changes are made.
|
|
14413
|
-
* Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
|
|
14414
|
-
* behavior.
|
|
14415
|
-
*
|
|
14416
|
-
* @param lView current `LView`
|
|
14417
|
-
* @param bindingIndex The binding in the `LView` to check
|
|
14418
|
-
* @param value New value to check against `lView[bindingIndex]`
|
|
14419
|
-
* @returns `true` if the bindings has changed. (Throws if binding has changed during
|
|
14420
|
-
* `CheckNoChangesMode`)
|
|
14421
|
-
*/
|
|
14422
|
-
function bindingUpdated(lView, bindingIndex, value) {
|
|
14423
|
-
ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
14424
|
-
ngDevMode &&
|
|
14425
|
-
assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
|
|
14426
|
-
const oldValue = lView[bindingIndex];
|
|
14427
|
-
if (Object.is(oldValue, value)) {
|
|
14428
|
-
return false;
|
|
14429
|
-
}
|
|
14430
|
-
else {
|
|
14431
|
-
if (ngDevMode && isInCheckNoChangesMode()) {
|
|
14432
|
-
// View engine didn't report undefined values as changed on the first checkNoChanges pass
|
|
14433
|
-
// (before the change detection was run).
|
|
14434
|
-
const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
|
|
14435
|
-
if (!devModeEqual(oldValueToCompare, value)) {
|
|
14436
|
-
const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
|
|
14437
|
-
throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
|
|
14438
|
-
}
|
|
14439
|
-
// There was a change, but the `devModeEqual` decided that the change is exempt from an error.
|
|
14440
|
-
// For this reason we exit as if no change. The early exit is needed to prevent the changed
|
|
14441
|
-
// value to be written into `LView` (If we would write the new value that we would not see it
|
|
14442
|
-
// as change on next CD.)
|
|
14443
|
-
return false;
|
|
14444
|
-
}
|
|
14445
|
-
lView[bindingIndex] = value;
|
|
14446
|
-
return true;
|
|
14447
|
-
}
|
|
14448
|
-
}
|
|
14449
|
-
/** Updates 2 bindings if changed, then returns whether either was updated. */
|
|
14450
|
-
function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
|
|
14451
|
-
const different = bindingUpdated(lView, bindingIndex, exp1);
|
|
14452
|
-
return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
|
|
14453
|
-
}
|
|
14454
|
-
/** Updates 3 bindings if changed, then returns whether any was updated. */
|
|
14455
|
-
function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
|
|
14456
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14457
|
-
return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
|
|
14458
|
-
}
|
|
14459
|
-
/** Updates 4 bindings if changed, then returns whether any was updated. */
|
|
14460
|
-
function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
|
|
14461
|
-
const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
|
|
14462
|
-
return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
|
|
14463
|
-
}
|
|
14464
|
-
|
|
14465
|
-
/**
|
|
14466
|
-
* @license
|
|
14467
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14468
|
-
*
|
|
14469
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14470
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14471
|
-
*/
|
|
14472
|
-
/**
|
|
14473
|
-
* Updates the value of or removes a bound attribute on an Element.
|
|
14474
|
-
*
|
|
14475
|
-
* Used in the case of `[attr.title]="value"`
|
|
14476
|
-
*
|
|
14477
|
-
* @param name name The name of the attribute.
|
|
14478
|
-
* @param value value The attribute is removed when value is `null` or `undefined`.
|
|
14479
|
-
* Otherwise the attribute value is set to the stringified value.
|
|
14480
|
-
* @param sanitizer An optional function used to sanitize the value.
|
|
14481
|
-
* @param namespace Optional namespace to use when setting the attribute.
|
|
14482
|
-
*
|
|
14483
|
-
* @codeGenApi
|
|
14484
|
-
*/
|
|
14485
|
-
function ɵɵattribute(name, value, sanitizer, namespace) {
|
|
14486
|
-
const lView = getLView();
|
|
14487
|
-
const bindingIndex = nextBindingIndex();
|
|
14488
|
-
if (bindingUpdated(lView, bindingIndex, value)) {
|
|
14489
|
-
const tView = getTView();
|
|
14490
|
-
const tNode = getSelectedTNode();
|
|
14491
|
-
elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
|
|
14492
|
-
ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
|
|
14493
|
-
}
|
|
14494
|
-
return ɵɵattribute;
|
|
14495
|
-
}
|
|
14496
|
-
|
|
14497
|
-
/**
|
|
14498
|
-
* @license
|
|
14499
|
-
* Copyright Google LLC All Rights Reserved.
|
|
14500
|
-
*
|
|
14501
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
14502
|
-
* found in the LICENSE file at https://angular.io/license
|
|
14503
|
-
*/
|
|
14504
|
-
/**
|
|
14505
|
-
* Create interpolation bindings with a variable number of expressions.
|
|
14506
|
-
*
|
|
14507
|
-
* If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
|
|
14508
|
-
* Those are faster because there is no need to create an array of expressions and iterate over it.
|
|
14509
|
-
*
|
|
14510
|
-
* `values`:
|
|
14511
|
-
* - has static text at even indexes,
|
|
14512
|
-
* - has evaluated expressions at odd indexes.
|
|
14513
|
-
*
|
|
14514
|
-
* Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
|
|
14515
|
-
*/
|
|
14516
|
-
function interpolationV(lView, values) {
|
|
14517
|
-
ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
|
|
14518
|
-
ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
|
|
14519
|
-
let isBindingUpdated = false;
|
|
14520
|
-
let bindingIndex = getBindingIndex();
|
|
14521
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14522
|
-
// Check if bindings (odd indexes) have changed
|
|
14523
|
-
isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
|
|
14524
|
-
}
|
|
14525
|
-
setBindingIndex(bindingIndex);
|
|
14526
|
-
if (!isBindingUpdated) {
|
|
14527
|
-
return NO_CHANGE;
|
|
14528
|
-
}
|
|
14529
|
-
// Build the updated content
|
|
14530
|
-
let content = values[0];
|
|
14531
|
-
for (let i = 1; i < values.length; i += 2) {
|
|
14532
|
-
content += renderStringify(values[i]) + values[i + 1];
|
|
14533
|
-
}
|
|
14534
|
-
return content;
|
|
14535
|
-
}
|
|
14536
|
-
/**
|
|
14537
|
-
* Creates an interpolation binding with 1 expression.
|
|
14538
|
-
*
|
|
14539
|
-
* @param prefix static value used for concatenation only.
|
|
14540
|
-
* @param v0 value checked for change.
|
|
14541
|
-
* @param suffix static value used for concatenation only.
|
|
14542
|
-
*/
|
|
14543
|
-
function interpolation1(lView, prefix, v0, suffix) {
|
|
14544
|
-
const different = bindingUpdated(lView, nextBindingIndex(), v0);
|
|
14545
|
-
return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
|
|
14546
|
-
}
|
|
14547
|
-
/**
|
|
14548
|
-
* Creates an interpolation binding with 2 expressions.
|
|
14549
|
-
*/
|
|
14550
|
-
function interpolation2(lView, prefix, v0, i0, v1, suffix) {
|
|
14551
|
-
const bindingIndex = getBindingIndex();
|
|
14552
|
-
const different = bindingUpdated2(lView, bindingIndex, v0, v1);
|
|
14553
|
-
incrementBindingIndex(2);
|
|
14554
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
|
|
14555
|
-
}
|
|
14556
|
-
/**
|
|
14557
|
-
* Creates an interpolation binding with 3 expressions.
|
|
14558
|
-
*/
|
|
14559
|
-
function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
|
|
14560
|
-
const bindingIndex = getBindingIndex();
|
|
14561
|
-
const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
|
|
14562
|
-
incrementBindingIndex(3);
|
|
14563
|
-
return different ?
|
|
14564
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
|
|
14565
|
-
NO_CHANGE;
|
|
14566
|
-
}
|
|
14567
|
-
/**
|
|
14568
|
-
* Create an interpolation binding with 4 expressions.
|
|
14569
|
-
*/
|
|
14570
|
-
function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
|
|
14571
|
-
const bindingIndex = getBindingIndex();
|
|
14572
|
-
const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14573
|
-
incrementBindingIndex(4);
|
|
14574
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14575
|
-
renderStringify(v2) + i2 + renderStringify(v3) + suffix :
|
|
14576
|
-
NO_CHANGE;
|
|
14577
|
-
}
|
|
14578
|
-
/**
|
|
14579
|
-
* Creates an interpolation binding with 5 expressions.
|
|
14580
|
-
*/
|
|
14581
|
-
function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
|
|
14582
|
-
const bindingIndex = getBindingIndex();
|
|
14583
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14584
|
-
different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
|
|
14585
|
-
incrementBindingIndex(5);
|
|
14586
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14587
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
|
|
14588
|
-
NO_CHANGE;
|
|
14589
|
-
}
|
|
14590
|
-
/**
|
|
14591
|
-
* Creates an interpolation binding with 6 expressions.
|
|
14592
|
-
*/
|
|
14593
|
-
function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
|
|
14594
|
-
const bindingIndex = getBindingIndex();
|
|
14595
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14596
|
-
different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
|
|
14597
|
-
incrementBindingIndex(6);
|
|
14598
|
-
return different ?
|
|
14599
|
-
prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
|
|
14600
|
-
renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
|
|
14601
|
-
NO_CHANGE;
|
|
14602
|
-
}
|
|
14603
|
-
/**
|
|
14604
|
-
* Creates an interpolation binding with 7 expressions.
|
|
14605
|
-
*/
|
|
14606
|
-
function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
|
|
14607
|
-
const bindingIndex = getBindingIndex();
|
|
14608
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14609
|
-
different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
|
|
14610
|
-
incrementBindingIndex(7);
|
|
14611
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14612
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14613
|
-
renderStringify(v5) + i5 + renderStringify(v6) + suffix :
|
|
14614
|
-
NO_CHANGE;
|
|
14615
|
-
}
|
|
14616
|
-
/**
|
|
14617
|
-
* Creates an interpolation binding with 8 expressions.
|
|
14618
|
-
*/
|
|
14619
|
-
function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
|
|
14620
|
-
const bindingIndex = getBindingIndex();
|
|
14621
|
-
let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
|
|
14622
|
-
different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
|
|
14623
|
-
incrementBindingIndex(8);
|
|
14624
|
-
return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
|
|
14625
|
-
renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
|
|
14626
|
-
renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
|
|
14627
|
-
NO_CHANGE;
|
|
14628
|
-
}
|
|
14629
|
-
|
|
14630
|
-
/**
|
|
14631
|
-
*
|
|
14632
|
-
* Update an interpolated attribute on an element with single bound value surrounded by text.
|
|
14081
|
+
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14633
14082
|
*
|
|
14634
|
-
* Used when the value passed to a property has
|
|
14083
|
+
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14635
14084
|
*
|
|
14636
14085
|
* ```html
|
|
14637
|
-
* <div attr.title="prefix{{v0}}suffix"></div>
|
|
14086
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14638
14087
|
* ```
|
|
14639
14088
|
*
|
|
14640
14089
|
* Its compiled representation is::
|
|
14641
14090
|
*
|
|
14642
14091
|
* ```ts
|
|
14643
|
-
* ɵɵ
|
|
14092
|
+
* ɵɵattributeInterpolate5(
|
|
14093
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14644
14094
|
* ```
|
|
14645
14095
|
*
|
|
14646
14096
|
* @param attrName The name of the attribute to update
|
|
14647
14097
|
* @param prefix Static value used for concatenation only.
|
|
14648
14098
|
* @param v0 Value checked for change.
|
|
14099
|
+
* @param i0 Static value used for concatenation only.
|
|
14100
|
+
* @param v1 Value checked for change.
|
|
14101
|
+
* @param i1 Static value used for concatenation only.
|
|
14102
|
+
* @param v2 Value checked for change.
|
|
14103
|
+
* @param i2 Static value used for concatenation only.
|
|
14104
|
+
* @param v3 Value checked for change.
|
|
14105
|
+
* @param i3 Static value used for concatenation only.
|
|
14106
|
+
* @param v4 Value checked for change.
|
|
14649
14107
|
* @param suffix Static value used for concatenation only.
|
|
14650
14108
|
* @param sanitizer An optional sanitizer function
|
|
14651
14109
|
* @returns itself, so that it may be chained.
|
|
14652
14110
|
* @codeGenApi
|
|
14653
14111
|
*/
|
|
14654
|
-
function ɵɵ
|
|
14112
|
+
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14655
14113
|
const lView = getLView();
|
|
14656
|
-
const interpolatedValue =
|
|
14114
|
+
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14657
14115
|
if (interpolatedValue !== NO_CHANGE) {
|
|
14658
14116
|
const tNode = getSelectedTNode();
|
|
14659
14117
|
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14660
14118
|
ngDevMode &&
|
|
14661
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() -
|
|
14119
|
+
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14662
14120
|
}
|
|
14663
|
-
return ɵɵ
|
|
14121
|
+
return ɵɵattributeInterpolate5;
|
|
14664
14122
|
}
|
|
14665
14123
|
/**
|
|
14666
14124
|
*
|
|
14667
|
-
* Update an interpolated attribute on an element with
|
|
14125
|
+
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14668
14126
|
*
|
|
14669
|
-
* Used when the value passed to a property has
|
|
14127
|
+
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14670
14128
|
*
|
|
14671
14129
|
* ```html
|
|
14672
|
-
* <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
|
|
14130
|
+
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14673
14131
|
* ```
|
|
14674
14132
|
*
|
|
14675
14133
|
* Its compiled representation is::
|
|
14676
14134
|
*
|
|
14677
14135
|
* ```ts
|
|
14678
|
-
* ɵɵ
|
|
14679
|
-
*
|
|
14680
|
-
*
|
|
14681
|
-
* @param attrName The name of the attribute to update
|
|
14682
|
-
* @param prefix Static value used for concatenation only.
|
|
14683
|
-
* @param v0 Value checked for change.
|
|
14684
|
-
* @param i0 Static value used for concatenation only.
|
|
14685
|
-
* @param v1 Value checked for change.
|
|
14686
|
-
* @param suffix Static value used for concatenation only.
|
|
14687
|
-
* @param sanitizer An optional sanitizer function
|
|
14688
|
-
* @returns itself, so that it may be chained.
|
|
14689
|
-
* @codeGenApi
|
|
14690
|
-
*/
|
|
14691
|
-
function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
|
|
14692
|
-
const lView = getLView();
|
|
14693
|
-
const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
|
|
14694
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14695
|
-
const tNode = getSelectedTNode();
|
|
14696
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14697
|
-
ngDevMode &&
|
|
14698
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
|
|
14699
|
-
}
|
|
14700
|
-
return ɵɵattributeInterpolate2;
|
|
14701
|
-
}
|
|
14702
|
-
/**
|
|
14703
|
-
*
|
|
14704
|
-
* Update an interpolated attribute on an element with 3 bound values surrounded by text.
|
|
14705
|
-
*
|
|
14706
|
-
* Used when the value passed to a property has 3 interpolated values in it:
|
|
14707
|
-
*
|
|
14708
|
-
* ```html
|
|
14709
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
|
|
14710
|
-
* ```
|
|
14711
|
-
*
|
|
14712
|
-
* Its compiled representation is::
|
|
14713
|
-
*
|
|
14714
|
-
* ```ts
|
|
14715
|
-
* ɵɵattributeInterpolate3(
|
|
14716
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
|
|
14717
|
-
* ```
|
|
14718
|
-
*
|
|
14719
|
-
* @param attrName The name of the attribute to update
|
|
14720
|
-
* @param prefix Static value used for concatenation only.
|
|
14721
|
-
* @param v0 Value checked for change.
|
|
14722
|
-
* @param i0 Static value used for concatenation only.
|
|
14723
|
-
* @param v1 Value checked for change.
|
|
14724
|
-
* @param i1 Static value used for concatenation only.
|
|
14725
|
-
* @param v2 Value checked for change.
|
|
14726
|
-
* @param suffix Static value used for concatenation only.
|
|
14727
|
-
* @param sanitizer An optional sanitizer function
|
|
14728
|
-
* @returns itself, so that it may be chained.
|
|
14729
|
-
* @codeGenApi
|
|
14730
|
-
*/
|
|
14731
|
-
function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
|
|
14732
|
-
const lView = getLView();
|
|
14733
|
-
const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
|
|
14734
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14735
|
-
const tNode = getSelectedTNode();
|
|
14736
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14737
|
-
ngDevMode &&
|
|
14738
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
|
|
14739
|
-
}
|
|
14740
|
-
return ɵɵattributeInterpolate3;
|
|
14741
|
-
}
|
|
14742
|
-
/**
|
|
14743
|
-
*
|
|
14744
|
-
* Update an interpolated attribute on an element with 4 bound values surrounded by text.
|
|
14745
|
-
*
|
|
14746
|
-
* Used when the value passed to a property has 4 interpolated values in it:
|
|
14747
|
-
*
|
|
14748
|
-
* ```html
|
|
14749
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
|
|
14750
|
-
* ```
|
|
14751
|
-
*
|
|
14752
|
-
* Its compiled representation is::
|
|
14753
|
-
*
|
|
14754
|
-
* ```ts
|
|
14755
|
-
* ɵɵattributeInterpolate4(
|
|
14756
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
|
|
14757
|
-
* ```
|
|
14758
|
-
*
|
|
14759
|
-
* @param attrName The name of the attribute to update
|
|
14760
|
-
* @param prefix Static value used for concatenation only.
|
|
14761
|
-
* @param v0 Value checked for change.
|
|
14762
|
-
* @param i0 Static value used for concatenation only.
|
|
14763
|
-
* @param v1 Value checked for change.
|
|
14764
|
-
* @param i1 Static value used for concatenation only.
|
|
14765
|
-
* @param v2 Value checked for change.
|
|
14766
|
-
* @param i2 Static value used for concatenation only.
|
|
14767
|
-
* @param v3 Value checked for change.
|
|
14768
|
-
* @param suffix Static value used for concatenation only.
|
|
14769
|
-
* @param sanitizer An optional sanitizer function
|
|
14770
|
-
* @returns itself, so that it may be chained.
|
|
14771
|
-
* @codeGenApi
|
|
14772
|
-
*/
|
|
14773
|
-
function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
|
|
14774
|
-
const lView = getLView();
|
|
14775
|
-
const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
|
14776
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14777
|
-
const tNode = getSelectedTNode();
|
|
14778
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14779
|
-
ngDevMode &&
|
|
14780
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
|
|
14781
|
-
}
|
|
14782
|
-
return ɵɵattributeInterpolate4;
|
|
14783
|
-
}
|
|
14784
|
-
/**
|
|
14785
|
-
*
|
|
14786
|
-
* Update an interpolated attribute on an element with 5 bound values surrounded by text.
|
|
14787
|
-
*
|
|
14788
|
-
* Used when the value passed to a property has 5 interpolated values in it:
|
|
14789
|
-
*
|
|
14790
|
-
* ```html
|
|
14791
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
|
|
14792
|
-
* ```
|
|
14793
|
-
*
|
|
14794
|
-
* Its compiled representation is::
|
|
14795
|
-
*
|
|
14796
|
-
* ```ts
|
|
14797
|
-
* ɵɵattributeInterpolate5(
|
|
14798
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
|
|
14799
|
-
* ```
|
|
14800
|
-
*
|
|
14801
|
-
* @param attrName The name of the attribute to update
|
|
14802
|
-
* @param prefix Static value used for concatenation only.
|
|
14803
|
-
* @param v0 Value checked for change.
|
|
14804
|
-
* @param i0 Static value used for concatenation only.
|
|
14805
|
-
* @param v1 Value checked for change.
|
|
14806
|
-
* @param i1 Static value used for concatenation only.
|
|
14807
|
-
* @param v2 Value checked for change.
|
|
14808
|
-
* @param i2 Static value used for concatenation only.
|
|
14809
|
-
* @param v3 Value checked for change.
|
|
14810
|
-
* @param i3 Static value used for concatenation only.
|
|
14811
|
-
* @param v4 Value checked for change.
|
|
14812
|
-
* @param suffix Static value used for concatenation only.
|
|
14813
|
-
* @param sanitizer An optional sanitizer function
|
|
14814
|
-
* @returns itself, so that it may be chained.
|
|
14815
|
-
* @codeGenApi
|
|
14816
|
-
*/
|
|
14817
|
-
function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
|
|
14818
|
-
const lView = getLView();
|
|
14819
|
-
const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
|
14820
|
-
if (interpolatedValue !== NO_CHANGE) {
|
|
14821
|
-
const tNode = getSelectedTNode();
|
|
14822
|
-
elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
|
|
14823
|
-
ngDevMode &&
|
|
14824
|
-
storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
|
|
14825
|
-
}
|
|
14826
|
-
return ɵɵattributeInterpolate5;
|
|
14827
|
-
}
|
|
14828
|
-
/**
|
|
14829
|
-
*
|
|
14830
|
-
* Update an interpolated attribute on an element with 6 bound values surrounded by text.
|
|
14831
|
-
*
|
|
14832
|
-
* Used when the value passed to a property has 6 interpolated values in it:
|
|
14833
|
-
*
|
|
14834
|
-
* ```html
|
|
14835
|
-
* <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
|
|
14836
|
-
* ```
|
|
14837
|
-
*
|
|
14838
|
-
* Its compiled representation is::
|
|
14839
|
-
*
|
|
14840
|
-
* ```ts
|
|
14841
|
-
* ɵɵattributeInterpolate6(
|
|
14842
|
-
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14136
|
+
* ɵɵattributeInterpolate6(
|
|
14137
|
+
* 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
|
|
14843
14138
|
* ```
|
|
14844
14139
|
*
|
|
14845
14140
|
* @param attrName The name of the attribute to update
|
|
@@ -15012,6 +14307,40 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
|
|
|
15012
14307
|
return ɵɵattributeInterpolateV;
|
|
15013
14308
|
}
|
|
15014
14309
|
|
|
14310
|
+
/**
|
|
14311
|
+
* @license
|
|
14312
|
+
* Copyright Google LLC All Rights Reserved.
|
|
14313
|
+
*
|
|
14314
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
14315
|
+
* found in the LICENSE file at https://angular.io/license
|
|
14316
|
+
*/
|
|
14317
|
+
/**
|
|
14318
|
+
* Synchronously perform change detection on a component (and possibly its sub-components).
|
|
14319
|
+
*
|
|
14320
|
+
* This function triggers change detection in a synchronous way on a component.
|
|
14321
|
+
*
|
|
14322
|
+
* @param component The component which the change detection should be performed on.
|
|
14323
|
+
*/
|
|
14324
|
+
function detectChanges(component) {
|
|
14325
|
+
const view = getComponentViewByInstance(component);
|
|
14326
|
+
detectChangesInternal(view[TVIEW], view, component);
|
|
14327
|
+
}
|
|
14328
|
+
/**
|
|
14329
|
+
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
14330
|
+
* schedule a change detection on it at some point in the future.
|
|
14331
|
+
*
|
|
14332
|
+
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
14333
|
+
* detection can be scheduled per component tree.
|
|
14334
|
+
*
|
|
14335
|
+
* @param component Component to mark as dirty.
|
|
14336
|
+
*/
|
|
14337
|
+
function markDirty(component) {
|
|
14338
|
+
ngDevMode && assertDefined(component, 'component');
|
|
14339
|
+
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
14340
|
+
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
14341
|
+
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
14342
|
+
}
|
|
14343
|
+
|
|
15015
14344
|
/**
|
|
15016
14345
|
* @license
|
|
15017
14346
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -15556,51 +14885,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15556
14885
|
tNode.index;
|
|
15557
14886
|
// In order to match current behavior, native DOM event listeners must be added for all
|
|
15558
14887
|
// events (including outputs).
|
|
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
|
-
|
|
15588
|
-
processOutputs = false;
|
|
15589
|
-
}
|
|
15590
|
-
else {
|
|
15591
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
15592
|
-
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15593
|
-
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15594
|
-
lCleanup.push(listenerFn, cleanupFn);
|
|
15595
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15596
|
-
}
|
|
14888
|
+
// There might be cases where multiple directives on the same element try to register an event
|
|
14889
|
+
// handler function for the same event. In this situation we want to avoid registration of
|
|
14890
|
+
// several native listeners as each registration would be intercepted by NgZone and
|
|
14891
|
+
// trigger change detection. This would mean that a single user action would result in several
|
|
14892
|
+
// change detections being invoked. To avoid this situation we want to have only one call to
|
|
14893
|
+
// native handler registration (for the same element and same type of event).
|
|
14894
|
+
//
|
|
14895
|
+
// In order to have just one native event handler in presence of multiple handler functions,
|
|
14896
|
+
// we just register a first handler function as a native event listener and then chain
|
|
14897
|
+
// (coalesce) other handler functions on top of the first native handler function.
|
|
14898
|
+
let existingListener = null;
|
|
14899
|
+
// Please note that the coalescing described here doesn't happen for events specifying an
|
|
14900
|
+
// alternative target (ex. (document:click)) - this is to keep backward compatibility with the
|
|
14901
|
+
// view engine.
|
|
14902
|
+
// Also, we don't have to search for existing listeners is there are no directives
|
|
14903
|
+
// matching on a given node as we can't register multiple event handlers for the same event in
|
|
14904
|
+
// a template (this would mean having duplicate attributes).
|
|
14905
|
+
if (!eventTargetResolver && isTNodeDirectiveHost) {
|
|
14906
|
+
existingListener = findExistingListener(tView, lView, eventName, tNode.index);
|
|
14907
|
+
}
|
|
14908
|
+
if (existingListener !== null) {
|
|
14909
|
+
// Attach a new listener to coalesced listeners list, maintaining the order in which
|
|
14910
|
+
// listeners are registered. For performance reasons, we keep a reference to the last
|
|
14911
|
+
// listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
|
|
14912
|
+
// the entire set each time we need to add a new listener.
|
|
14913
|
+
const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
|
|
14914
|
+
lastListenerFn.__ngNextListenerFn__ = listenerFn;
|
|
14915
|
+
existingListener.__ngLastListenerFn__ = listenerFn;
|
|
14916
|
+
processOutputs = false;
|
|
15597
14917
|
}
|
|
15598
14918
|
else {
|
|
15599
|
-
listenerFn = wrapListener(tNode, lView, context, listenerFn,
|
|
15600
|
-
|
|
14919
|
+
listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
|
|
14920
|
+
const cleanupFn = renderer.listen(target, eventName, listenerFn);
|
|
15601
14921
|
ngDevMode && ngDevMode.rendererAddEventListener++;
|
|
15602
|
-
lCleanup.push(listenerFn);
|
|
15603
|
-
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex,
|
|
14922
|
+
lCleanup.push(listenerFn, cleanupFn);
|
|
14923
|
+
tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
|
|
15604
14924
|
}
|
|
15605
14925
|
}
|
|
15606
14926
|
else {
|
|
@@ -16269,7 +15589,7 @@ function ɵɵpropertyInterpolate8(propName, prefix, v0, i0, v1, i1, v2, i2, v3,
|
|
|
16269
15589
|
* be conducted at runtime so child components that add new `@Inputs` don't have to be re-compiled.
|
|
16270
15590
|
*
|
|
16271
15591
|
* @param propName The name of the property to update.
|
|
16272
|
-
* @param values The collection of values and the strings
|
|
15592
|
+
* @param values The collection of values and the strings in between those values, beginning with a
|
|
16273
15593
|
* string prefix and ending with a string suffix.
|
|
16274
15594
|
* (e.g. `['prefix', value0, '-', value1, '-', value2, ..., value99, 'suffix']`)
|
|
16275
15595
|
* @param sanitizer An optional sanitizer function
|
|
@@ -17674,7 +16994,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
|
|
|
17674
16994
|
valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
|
|
17675
16995
|
}
|
|
17676
16996
|
let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
|
|
17677
|
-
key === prop ? valueAtLViewIndex : undefined;
|
|
16997
|
+
(key === prop ? valueAtLViewIndex : undefined);
|
|
17678
16998
|
if (containsStatics && !isStylingValuePresent(currentValue)) {
|
|
17679
16999
|
currentValue = keyValueArrayGet(rawKey, prop);
|
|
17680
17000
|
}
|
|
@@ -19197,7 +18517,7 @@ function findLocaleData(locale) {
|
|
|
19197
18517
|
if (parentLocale === 'en') {
|
|
19198
18518
|
return localeEn;
|
|
19199
18519
|
}
|
|
19200
|
-
throw new
|
|
18520
|
+
throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
|
|
19201
18521
|
}
|
|
19202
18522
|
/**
|
|
19203
18523
|
* Retrieves the default currency code for the given locale.
|
|
@@ -19336,7 +18656,7 @@ var I18nCreateOpCode;
|
|
|
19336
18656
|
*/
|
|
19337
18657
|
I18nCreateOpCode[I18nCreateOpCode["SHIFT"] = 2] = "SHIFT";
|
|
19338
18658
|
/**
|
|
19339
|
-
* Should the node be appended to parent
|
|
18659
|
+
* Should the node be appended to parent immediately after creation.
|
|
19340
18660
|
*/
|
|
19341
18661
|
I18nCreateOpCode[I18nCreateOpCode["APPEND_EAGERLY"] = 1] = "APPEND_EAGERLY";
|
|
19342
18662
|
/**
|
|
@@ -21527,7 +20847,7 @@ function noComponentFactoryError(component) {
|
|
|
21527
20847
|
return error;
|
|
21528
20848
|
}
|
|
21529
20849
|
const ERROR_COMPONENT = 'ngComponent';
|
|
21530
|
-
function getComponent(error) {
|
|
20850
|
+
function getComponent$1(error) {
|
|
21531
20851
|
return error[ERROR_COMPONENT];
|
|
21532
20852
|
}
|
|
21533
20853
|
class _NullComponentFactoryResolver {
|
|
@@ -21577,7 +20897,7 @@ class NgModuleRef$1 {
|
|
|
21577
20897
|
* JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
|
|
21578
20898
|
* for additional context. Angular provides APIs that accept NgModule classes directly (such as
|
|
21579
20899
|
* [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
|
|
21580
|
-
* [
|
|
20900
|
+
* [createNgModule](api/core/createNgModule)), consider switching to those APIs instead of
|
|
21581
20901
|
* using factory-based ones.
|
|
21582
20902
|
*/
|
|
21583
20903
|
class NgModuleFactory$1 {
|
|
@@ -21711,14 +21031,6 @@ class Renderer2 {
|
|
|
21711
21031
|
* @nocollapse
|
|
21712
21032
|
*/
|
|
21713
21033
|
Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
|
|
21714
|
-
/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
|
|
21715
|
-
function getOrCreateRenderer2(lView) {
|
|
21716
|
-
const renderer = lView[RENDERER];
|
|
21717
|
-
if (ngDevMode && !isProceduralRenderer(renderer)) {
|
|
21718
|
-
throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
|
|
21719
|
-
}
|
|
21720
|
-
return renderer;
|
|
21721
|
-
}
|
|
21722
21034
|
/** Injects a Renderer2 for the current component. */
|
|
21723
21035
|
function injectRenderer2() {
|
|
21724
21036
|
// We need the Renderer to be based on the component that it's being injected into, however since
|
|
@@ -21726,7 +21038,7 @@ function injectRenderer2() {
|
|
|
21726
21038
|
const lView = getLView();
|
|
21727
21039
|
const tNode = getCurrentTNode();
|
|
21728
21040
|
const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
|
|
21729
|
-
return
|
|
21041
|
+
return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
|
|
21730
21042
|
}
|
|
21731
21043
|
|
|
21732
21044
|
/**
|
|
@@ -21773,7 +21085,7 @@ class Version {
|
|
|
21773
21085
|
/**
|
|
21774
21086
|
* @publicApi
|
|
21775
21087
|
*/
|
|
21776
|
-
const VERSION = new Version('14.1.0-
|
|
21088
|
+
const VERSION = new Version('14.1.0-rc.0');
|
|
21777
21089
|
|
|
21778
21090
|
/**
|
|
21779
21091
|
* @license
|
|
@@ -22237,7 +21549,13 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
22237
21549
|
realEnvironmentInjector;
|
|
22238
21550
|
}
|
|
22239
21551
|
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
|
|
22240
|
-
const rendererFactory = rootViewInjector.get(RendererFactory2,
|
|
21552
|
+
const rendererFactory = rootViewInjector.get(RendererFactory2, null);
|
|
21553
|
+
if (rendererFactory === null) {
|
|
21554
|
+
throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
|
|
21555
|
+
'Angular was not able to inject a renderer (RendererFactory2). ' +
|
|
21556
|
+
'Likely this is due to a broken DI hierarchy. ' +
|
|
21557
|
+
'Make sure that any injector used to create this component has a correct parent.');
|
|
21558
|
+
}
|
|
22241
21559
|
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
22242
21560
|
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
22243
21561
|
// Determine a tag name used for creating host elements when this component is created
|
|
@@ -22304,223 +21622,663 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
22304
21622
|
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
22305
21623
|
}
|
|
22306
21624
|
}
|
|
22307
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21625
|
+
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
21626
|
+
/**
|
|
21627
|
+
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
21628
|
+
* ComponentFactoryResolver
|
|
21629
|
+
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
21630
|
+
*
|
|
21631
|
+
* @returns The ComponentFactoryResolver instance to use
|
|
21632
|
+
*/
|
|
21633
|
+
function injectComponentFactoryResolver() {
|
|
21634
|
+
return componentFactoryResolver;
|
|
21635
|
+
}
|
|
21636
|
+
/**
|
|
21637
|
+
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
21638
|
+
*
|
|
21639
|
+
* `ComponentRef` provides access to the Component Instance as well other objects related to this
|
|
21640
|
+
* Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
|
|
21641
|
+
* method.
|
|
21642
|
+
*
|
|
21643
|
+
*/
|
|
21644
|
+
class ComponentRef extends ComponentRef$1 {
|
|
21645
|
+
constructor(componentType, instance, location, _rootLView, _tNode) {
|
|
21646
|
+
super();
|
|
21647
|
+
this.location = location;
|
|
21648
|
+
this._rootLView = _rootLView;
|
|
21649
|
+
this._tNode = _tNode;
|
|
21650
|
+
this.instance = instance;
|
|
21651
|
+
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
21652
|
+
this.componentType = componentType;
|
|
21653
|
+
}
|
|
21654
|
+
setInput(name, value) {
|
|
21655
|
+
const inputData = this._tNode.inputs;
|
|
21656
|
+
let dataValue;
|
|
21657
|
+
if (inputData !== null && (dataValue = inputData[name])) {
|
|
21658
|
+
const lView = this._rootLView;
|
|
21659
|
+
setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
|
|
21660
|
+
markDirtyIfOnPush(lView, this._tNode.index);
|
|
21661
|
+
}
|
|
21662
|
+
else {
|
|
21663
|
+
if (ngDevMode) {
|
|
21664
|
+
const cmpNameForError = stringifyForError(this.componentType);
|
|
21665
|
+
let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
|
|
21666
|
+
message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
|
|
21667
|
+
reportUnknownPropertyError(message);
|
|
21668
|
+
}
|
|
21669
|
+
}
|
|
21670
|
+
}
|
|
21671
|
+
get injector() {
|
|
21672
|
+
return new NodeInjector(this._tNode, this._rootLView);
|
|
21673
|
+
}
|
|
21674
|
+
destroy() {
|
|
21675
|
+
this.hostView.destroy();
|
|
21676
|
+
}
|
|
21677
|
+
onDestroy(callback) {
|
|
21678
|
+
this.hostView.onDestroy(callback);
|
|
21679
|
+
}
|
|
21680
|
+
}
|
|
21681
|
+
|
|
21682
|
+
/**
|
|
21683
|
+
* @license
|
|
21684
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21685
|
+
*
|
|
21686
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21687
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21688
|
+
*/
|
|
21689
|
+
/**
|
|
21690
|
+
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
21691
|
+
*
|
|
21692
|
+
* @param ngModule NgModule class.
|
|
21693
|
+
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
21694
|
+
* not provided, `NullInjector` will be used instead.
|
|
21695
|
+
* @returns NgModuleRef that represents an NgModule instance.
|
|
21696
|
+
*
|
|
21697
|
+
* @publicApi
|
|
21698
|
+
*/
|
|
21699
|
+
function createNgModule(ngModule, parentInjector) {
|
|
21700
|
+
return new NgModuleRef(ngModule, parentInjector ?? null);
|
|
21701
|
+
}
|
|
21702
|
+
/**
|
|
21703
|
+
* The `createNgModule` function alias for backwards-compatibility.
|
|
21704
|
+
* Please avoid using it directly and use `createNgModule` instead.
|
|
21705
|
+
*
|
|
21706
|
+
* @deprecated Use `createNgModule` instead.
|
|
21707
|
+
*/
|
|
21708
|
+
const createNgModuleRef = createNgModule;
|
|
21709
|
+
class NgModuleRef extends NgModuleRef$1 {
|
|
21710
|
+
constructor(ngModuleType, _parent) {
|
|
21711
|
+
super();
|
|
21712
|
+
this._parent = _parent;
|
|
21713
|
+
// tslint:disable-next-line:require-internal-with-underscore
|
|
21714
|
+
this._bootstrapComponents = [];
|
|
21715
|
+
this.injector = this;
|
|
21716
|
+
this.destroyCbs = [];
|
|
21717
|
+
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
21718
|
+
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
21719
|
+
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
21720
|
+
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
21721
|
+
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
21722
|
+
// and providing it, rather than letting the injector resolve it.
|
|
21723
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21724
|
+
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
21725
|
+
ngDevMode &&
|
|
21726
|
+
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
21727
|
+
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
21728
|
+
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
21729
|
+
{ provide: NgModuleRef$1, useValue: this }, {
|
|
21730
|
+
provide: ComponentFactoryResolver$1,
|
|
21731
|
+
useValue: this.componentFactoryResolver
|
|
21732
|
+
}
|
|
21733
|
+
], stringify(ngModuleType), new Set(['environment']));
|
|
21734
|
+
// We need to resolve the injector types separately from the injector creation, because
|
|
21735
|
+
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21736
|
+
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21737
|
+
this._r3Injector.resolveInjectorInitializers();
|
|
21738
|
+
this.instance = this.get(ngModuleType);
|
|
21739
|
+
}
|
|
21740
|
+
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
21741
|
+
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
21742
|
+
return this;
|
|
21743
|
+
}
|
|
21744
|
+
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
21745
|
+
}
|
|
21746
|
+
runInContext(fn) {
|
|
21747
|
+
return this.injector.runInContext(fn);
|
|
21748
|
+
}
|
|
21749
|
+
destroy() {
|
|
21750
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21751
|
+
const injector = this._r3Injector;
|
|
21752
|
+
!injector.destroyed && injector.destroy();
|
|
21753
|
+
this.destroyCbs.forEach(fn => fn());
|
|
21754
|
+
this.destroyCbs = null;
|
|
21755
|
+
}
|
|
21756
|
+
onDestroy(callback) {
|
|
21757
|
+
ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
|
|
21758
|
+
this.destroyCbs.push(callback);
|
|
21759
|
+
}
|
|
21760
|
+
}
|
|
21761
|
+
class NgModuleFactory extends NgModuleFactory$1 {
|
|
21762
|
+
constructor(moduleType) {
|
|
21763
|
+
super();
|
|
21764
|
+
this.moduleType = moduleType;
|
|
21765
|
+
}
|
|
21766
|
+
create(parentInjector) {
|
|
21767
|
+
return new NgModuleRef(this.moduleType, parentInjector);
|
|
21768
|
+
}
|
|
21769
|
+
}
|
|
21770
|
+
class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
21771
|
+
constructor(providers, parent, source) {
|
|
21772
|
+
super();
|
|
21773
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
21774
|
+
this.instance = null;
|
|
21775
|
+
const injector = new R3Injector([
|
|
21776
|
+
...providers,
|
|
21777
|
+
{ provide: NgModuleRef$1, useValue: this },
|
|
21778
|
+
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
21779
|
+
], parent || getNullInjector(), source, new Set(['environment']));
|
|
21780
|
+
this.injector = injector;
|
|
21781
|
+
injector.resolveInjectorInitializers();
|
|
21782
|
+
}
|
|
21783
|
+
destroy() {
|
|
21784
|
+
this.injector.destroy();
|
|
21785
|
+
}
|
|
21786
|
+
onDestroy(callback) {
|
|
21787
|
+
this.injector.onDestroy(callback);
|
|
21788
|
+
}
|
|
21789
|
+
}
|
|
21790
|
+
/**
|
|
21791
|
+
* Create a new environment injector.
|
|
21792
|
+
*
|
|
21793
|
+
* Learn more about environment injectors in
|
|
21794
|
+
* [this guide](guide/standalone-components#environment-injectors).
|
|
21795
|
+
*
|
|
21796
|
+
* @param providers An array of providers.
|
|
21797
|
+
* @param parent A parent environment injector.
|
|
21798
|
+
* @param debugName An optional name for this injector instance, which will be used in error
|
|
21799
|
+
* messages.
|
|
21800
|
+
*
|
|
21801
|
+
* @publicApi
|
|
21802
|
+
* @developerPreview
|
|
21803
|
+
*/
|
|
21804
|
+
function createEnvironmentInjector(providers, parent, debugName = null) {
|
|
21805
|
+
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
21806
|
+
return adapter.injector;
|
|
21807
|
+
}
|
|
21808
|
+
|
|
21809
|
+
/**
|
|
21810
|
+
* @license
|
|
21811
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21812
|
+
*
|
|
21813
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21814
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21815
|
+
*/
|
|
21816
|
+
/**
|
|
21817
|
+
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
21818
|
+
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
21819
|
+
* collected from the imports graph rooted at a given standalone component.
|
|
21820
|
+
*/
|
|
21821
|
+
class StandaloneService {
|
|
21822
|
+
constructor(_injector) {
|
|
21823
|
+
this._injector = _injector;
|
|
21824
|
+
this.cachedInjectors = new Map();
|
|
21825
|
+
}
|
|
21826
|
+
getOrCreateStandaloneInjector(componentDef) {
|
|
21827
|
+
if (!componentDef.standalone) {
|
|
21828
|
+
return null;
|
|
21829
|
+
}
|
|
21830
|
+
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
21831
|
+
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
21832
|
+
const standaloneInjector = providers.length > 0 ?
|
|
21833
|
+
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
21834
|
+
null;
|
|
21835
|
+
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
21836
|
+
}
|
|
21837
|
+
return this.cachedInjectors.get(componentDef.id);
|
|
21838
|
+
}
|
|
21839
|
+
ngOnDestroy() {
|
|
21840
|
+
try {
|
|
21841
|
+
for (const injector of this.cachedInjectors.values()) {
|
|
21842
|
+
if (injector !== null) {
|
|
21843
|
+
injector.destroy();
|
|
21844
|
+
}
|
|
21845
|
+
}
|
|
21846
|
+
}
|
|
21847
|
+
finally {
|
|
21848
|
+
this.cachedInjectors.clear();
|
|
21849
|
+
}
|
|
21850
|
+
}
|
|
21851
|
+
}
|
|
21852
|
+
/** @nocollapse */
|
|
21853
|
+
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
21854
|
+
token: StandaloneService,
|
|
21855
|
+
providedIn: 'environment',
|
|
21856
|
+
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
21857
|
+
});
|
|
21858
|
+
/**
|
|
21859
|
+
* A feature that acts as a setup code for the {@link StandaloneService}.
|
|
21860
|
+
*
|
|
21861
|
+
* The most important responsibility of this feature is to expose the "getStandaloneInjector"
|
|
21862
|
+
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
21863
|
+
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
21864
|
+
* is tree-shakable and not included in applications that don't use standalone components.
|
|
21865
|
+
*
|
|
21866
|
+
* @codeGenApi
|
|
21867
|
+
*/
|
|
21868
|
+
function ɵɵStandaloneFeature(definition) {
|
|
21869
|
+
definition.getStandaloneInjector = (parentInjector) => {
|
|
21870
|
+
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
|
|
21871
|
+
};
|
|
21872
|
+
}
|
|
21873
|
+
|
|
21874
|
+
/**
|
|
21875
|
+
* @license
|
|
21876
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21877
|
+
*
|
|
21878
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21879
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21880
|
+
*/
|
|
21881
|
+
/**
|
|
21882
|
+
* Retrieves the component instance associated with a given DOM element.
|
|
21883
|
+
*
|
|
21884
|
+
* @usageNotes
|
|
21885
|
+
* Given the following DOM structure:
|
|
21886
|
+
*
|
|
21887
|
+
* ```html
|
|
21888
|
+
* <app-root>
|
|
21889
|
+
* <div>
|
|
21890
|
+
* <child-comp></child-comp>
|
|
21891
|
+
* </div>
|
|
21892
|
+
* </app-root>
|
|
21893
|
+
* ```
|
|
21894
|
+
*
|
|
21895
|
+
* Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
|
|
21896
|
+
* associated with this DOM element.
|
|
21897
|
+
*
|
|
21898
|
+
* Calling the function on `<app-root>` will return the `MyApp` instance.
|
|
21899
|
+
*
|
|
21900
|
+
*
|
|
21901
|
+
* @param element DOM element from which the component should be retrieved.
|
|
21902
|
+
* @returns Component instance associated with the element or `null` if there
|
|
21903
|
+
* is no component associated with it.
|
|
21904
|
+
*
|
|
21905
|
+
* @publicApi
|
|
21906
|
+
* @globalApi ng
|
|
21907
|
+
*/
|
|
21908
|
+
function getComponent(element) {
|
|
21909
|
+
ngDevMode && assertDomElement(element);
|
|
21910
|
+
const context = getLContext(element);
|
|
21911
|
+
if (context === null)
|
|
21912
|
+
return null;
|
|
21913
|
+
if (context.component === undefined) {
|
|
21914
|
+
const lView = context.lView;
|
|
21915
|
+
if (lView === null) {
|
|
21916
|
+
return null;
|
|
21917
|
+
}
|
|
21918
|
+
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
21919
|
+
}
|
|
21920
|
+
return context.component;
|
|
21921
|
+
}
|
|
21922
|
+
/**
|
|
21923
|
+
* If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
|
|
21924
|
+
* view that the element is part of. Otherwise retrieves the instance of the component whose view
|
|
21925
|
+
* owns the element (in this case, the result is the same as calling `getOwningComponent`).
|
|
21926
|
+
*
|
|
21927
|
+
* @param element Element for which to get the surrounding component instance.
|
|
21928
|
+
* @returns Instance of the component that is around the element or null if the element isn't
|
|
21929
|
+
* inside any component.
|
|
21930
|
+
*
|
|
21931
|
+
* @publicApi
|
|
21932
|
+
* @globalApi ng
|
|
21933
|
+
*/
|
|
21934
|
+
function getContext(element) {
|
|
21935
|
+
assertDomElement(element);
|
|
21936
|
+
const context = getLContext(element);
|
|
21937
|
+
const lView = context ? context.lView : null;
|
|
21938
|
+
return lView === null ? null : lView[CONTEXT];
|
|
21939
|
+
}
|
|
21940
|
+
/**
|
|
21941
|
+
* Retrieves the component instance whose view contains the DOM element.
|
|
21942
|
+
*
|
|
21943
|
+
* For example, if `<child-comp>` is used in the template of `<app-comp>`
|
|
21944
|
+
* (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
|
|
21945
|
+
* would return `<app-comp>`.
|
|
21946
|
+
*
|
|
21947
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21948
|
+
* for which to retrieve the root components.
|
|
21949
|
+
* @returns Component instance whose view owns the DOM element or null if the element is not
|
|
21950
|
+
* part of a component view.
|
|
21951
|
+
*
|
|
21952
|
+
* @publicApi
|
|
21953
|
+
* @globalApi ng
|
|
21954
|
+
*/
|
|
21955
|
+
function getOwningComponent(elementOrDir) {
|
|
21956
|
+
const context = getLContext(elementOrDir);
|
|
21957
|
+
let lView = context ? context.lView : null;
|
|
21958
|
+
if (lView === null)
|
|
21959
|
+
return null;
|
|
21960
|
+
let parent;
|
|
21961
|
+
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
21962
|
+
lView = parent;
|
|
21963
|
+
}
|
|
21964
|
+
return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
21965
|
+
}
|
|
21966
|
+
/**
|
|
21967
|
+
* Retrieves all root components associated with a DOM element, directive or component instance.
|
|
21968
|
+
* Root components are those which have been bootstrapped by Angular.
|
|
21969
|
+
*
|
|
21970
|
+
* @param elementOrDir DOM element, component or directive instance
|
|
21971
|
+
* for which to retrieve the root components.
|
|
21972
|
+
* @returns Root components associated with the target object.
|
|
21973
|
+
*
|
|
21974
|
+
* @publicApi
|
|
21975
|
+
* @globalApi ng
|
|
21976
|
+
*/
|
|
21977
|
+
function getRootComponents(elementOrDir) {
|
|
21978
|
+
const lView = readPatchedLView(elementOrDir);
|
|
21979
|
+
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
21980
|
+
}
|
|
21981
|
+
/**
|
|
21982
|
+
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
21983
|
+
*
|
|
21984
|
+
* @param elementOrDir DOM element, component or directive instance for which to
|
|
21985
|
+
* retrieve the injector.
|
|
21986
|
+
* @returns Injector associated with the element, component or directive instance.
|
|
21987
|
+
*
|
|
21988
|
+
* @publicApi
|
|
21989
|
+
* @globalApi ng
|
|
21990
|
+
*/
|
|
21991
|
+
function getInjector(elementOrDir) {
|
|
21992
|
+
const context = getLContext(elementOrDir);
|
|
21993
|
+
const lView = context ? context.lView : null;
|
|
21994
|
+
if (lView === null)
|
|
21995
|
+
return Injector.NULL;
|
|
21996
|
+
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
21997
|
+
return new NodeInjector(tNode, lView);
|
|
21998
|
+
}
|
|
22308
21999
|
/**
|
|
22309
|
-
*
|
|
22310
|
-
* ComponentFactoryResolver
|
|
22311
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
22000
|
+
* Retrieve a set of injection tokens at a given DOM node.
|
|
22312
22001
|
*
|
|
22313
|
-
* @
|
|
22002
|
+
* @param element Element for which the injection tokens should be retrieved.
|
|
22314
22003
|
*/
|
|
22315
|
-
function
|
|
22316
|
-
|
|
22004
|
+
function getInjectionTokens(element) {
|
|
22005
|
+
const context = getLContext(element);
|
|
22006
|
+
const lView = context ? context.lView : null;
|
|
22007
|
+
if (lView === null)
|
|
22008
|
+
return [];
|
|
22009
|
+
const tView = lView[TVIEW];
|
|
22010
|
+
const tNode = tView.data[context.nodeIndex];
|
|
22011
|
+
const providerTokens = [];
|
|
22012
|
+
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
22013
|
+
const endIndex = tNode.directiveEnd;
|
|
22014
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
22015
|
+
let value = tView.data[i];
|
|
22016
|
+
if (isDirectiveDefHack(value)) {
|
|
22017
|
+
// The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
|
|
22018
|
+
// design flaw. We should always store same type so that we can be monomorphic. The issue
|
|
22019
|
+
// is that for Components/Directives we store the def instead the type. The correct behavior
|
|
22020
|
+
// is that we should always be storing injectable type in this location.
|
|
22021
|
+
value = value.type;
|
|
22022
|
+
}
|
|
22023
|
+
providerTokens.push(value);
|
|
22024
|
+
}
|
|
22025
|
+
return providerTokens;
|
|
22317
22026
|
}
|
|
22318
22027
|
/**
|
|
22319
|
-
*
|
|
22028
|
+
* Retrieves directive instances associated with a given DOM node. Does not include
|
|
22029
|
+
* component instances.
|
|
22320
22030
|
*
|
|
22321
|
-
*
|
|
22322
|
-
*
|
|
22323
|
-
*
|
|
22031
|
+
* @usageNotes
|
|
22032
|
+
* Given the following DOM structure:
|
|
22033
|
+
*
|
|
22034
|
+
* ```html
|
|
22035
|
+
* <app-root>
|
|
22036
|
+
* <button my-button></button>
|
|
22037
|
+
* <my-comp></my-comp>
|
|
22038
|
+
* </app-root>
|
|
22039
|
+
* ```
|
|
22040
|
+
*
|
|
22041
|
+
* Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
|
|
22042
|
+
* directive that is associated with the DOM node.
|
|
22043
|
+
*
|
|
22044
|
+
* Calling `getDirectives` on `<my-comp>` will return an empty array.
|
|
22045
|
+
*
|
|
22046
|
+
* @param node DOM node for which to get the directives.
|
|
22047
|
+
* @returns Array of directives associated with the node.
|
|
22324
22048
|
*
|
|
22049
|
+
* @publicApi
|
|
22050
|
+
* @globalApi ng
|
|
22325
22051
|
*/
|
|
22326
|
-
|
|
22327
|
-
|
|
22328
|
-
|
|
22329
|
-
|
|
22330
|
-
this._rootLView = _rootLView;
|
|
22331
|
-
this._tNode = _tNode;
|
|
22332
|
-
this.instance = instance;
|
|
22333
|
-
this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
|
|
22334
|
-
this.componentType = componentType;
|
|
22052
|
+
function getDirectives(node) {
|
|
22053
|
+
// Skip text nodes because we can't have directives associated with them.
|
|
22054
|
+
if (node instanceof Text) {
|
|
22055
|
+
return [];
|
|
22335
22056
|
}
|
|
22336
|
-
|
|
22337
|
-
|
|
22057
|
+
const context = getLContext(node);
|
|
22058
|
+
const lView = context ? context.lView : null;
|
|
22059
|
+
if (lView === null) {
|
|
22060
|
+
return [];
|
|
22338
22061
|
}
|
|
22339
|
-
|
|
22340
|
-
|
|
22062
|
+
const tView = lView[TVIEW];
|
|
22063
|
+
const nodeIndex = context.nodeIndex;
|
|
22064
|
+
if (!tView?.data[nodeIndex]) {
|
|
22065
|
+
return [];
|
|
22341
22066
|
}
|
|
22342
|
-
|
|
22343
|
-
|
|
22067
|
+
if (context.directives === undefined) {
|
|
22068
|
+
context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
|
|
22344
22069
|
}
|
|
22070
|
+
// The `directives` in this case are a named array called `LComponentView`. Clone the
|
|
22071
|
+
// result so we don't expose an internal data structure in the user's console.
|
|
22072
|
+
return context.directives === null ? [] : [...context.directives];
|
|
22345
22073
|
}
|
|
22346
|
-
|
|
22347
22074
|
/**
|
|
22348
|
-
*
|
|
22349
|
-
*
|
|
22075
|
+
* Returns the debug (partial) metadata for a particular directive or component instance.
|
|
22076
|
+
* The function accepts an instance of a directive or component and returns the corresponding
|
|
22077
|
+
* metadata.
|
|
22078
|
+
*
|
|
22079
|
+
* @param directiveOrComponentInstance Instance of a directive or component
|
|
22080
|
+
* @returns metadata of the passed directive or component
|
|
22350
22081
|
*
|
|
22351
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
22352
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22353
|
-
*/
|
|
22354
|
-
/**
|
|
22355
|
-
* Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
|
|
22356
|
-
* @param ngModule NgModule class.
|
|
22357
|
-
* @param parentInjector Optional injector instance to use as a parent for the module injector. If
|
|
22358
|
-
* not provided, `NullInjector` will be used instead.
|
|
22359
22082
|
* @publicApi
|
|
22083
|
+
* @globalApi ng
|
|
22360
22084
|
*/
|
|
22361
|
-
function
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
constructor(ngModuleType, _parent) {
|
|
22366
|
-
super();
|
|
22367
|
-
this._parent = _parent;
|
|
22368
|
-
// tslint:disable-next-line:require-internal-with-underscore
|
|
22369
|
-
this._bootstrapComponents = [];
|
|
22370
|
-
this.injector = this;
|
|
22371
|
-
this.destroyCbs = [];
|
|
22372
|
-
// When bootstrapping a module we have a dependency graph that looks like this:
|
|
22373
|
-
// ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
|
|
22374
|
-
// module being resolved tries to inject the ComponentFactoryResolver, it'll create a
|
|
22375
|
-
// circular dependency which will result in a runtime error, because the injector doesn't
|
|
22376
|
-
// exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
|
|
22377
|
-
// and providing it, rather than letting the injector resolve it.
|
|
22378
|
-
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
22379
|
-
const ngModuleDef = getNgModuleDef(ngModuleType);
|
|
22380
|
-
ngDevMode &&
|
|
22381
|
-
assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
|
|
22382
|
-
this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
|
|
22383
|
-
this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
|
|
22384
|
-
{ provide: NgModuleRef$1, useValue: this }, {
|
|
22385
|
-
provide: ComponentFactoryResolver$1,
|
|
22386
|
-
useValue: this.componentFactoryResolver
|
|
22387
|
-
}
|
|
22388
|
-
], stringify(ngModuleType), new Set(['environment']));
|
|
22389
|
-
// We need to resolve the injector types separately from the injector creation, because
|
|
22390
|
-
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
22391
|
-
// circular error that will eventually error out, because the injector isn't created yet.
|
|
22392
|
-
this._r3Injector.resolveInjectorInitializers();
|
|
22393
|
-
this.instance = this.get(ngModuleType);
|
|
22394
|
-
}
|
|
22395
|
-
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
22396
|
-
if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
|
|
22397
|
-
return this;
|
|
22398
|
-
}
|
|
22399
|
-
return this._r3Injector.get(token, notFoundValue, injectFlags);
|
|
22085
|
+
function getDirectiveMetadata$1(directiveOrComponentInstance) {
|
|
22086
|
+
const { constructor } = directiveOrComponentInstance;
|
|
22087
|
+
if (!constructor) {
|
|
22088
|
+
throw new Error('Unable to find the instance constructor');
|
|
22400
22089
|
}
|
|
22401
|
-
|
|
22402
|
-
|
|
22403
|
-
|
|
22404
|
-
|
|
22405
|
-
|
|
22406
|
-
|
|
22090
|
+
// In case a component inherits from a directive, we may have component and directive metadata
|
|
22091
|
+
// To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
|
|
22092
|
+
const componentDef = getComponentDef(constructor);
|
|
22093
|
+
if (componentDef) {
|
|
22094
|
+
return {
|
|
22095
|
+
inputs: componentDef.inputs,
|
|
22096
|
+
outputs: componentDef.outputs,
|
|
22097
|
+
encapsulation: componentDef.encapsulation,
|
|
22098
|
+
changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
|
|
22099
|
+
ChangeDetectionStrategy.Default
|
|
22100
|
+
};
|
|
22407
22101
|
}
|
|
22408
|
-
|
|
22409
|
-
|
|
22410
|
-
|
|
22102
|
+
const directiveDef = getDirectiveDef(constructor);
|
|
22103
|
+
if (directiveDef) {
|
|
22104
|
+
return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
|
|
22411
22105
|
}
|
|
22106
|
+
return null;
|
|
22412
22107
|
}
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
|
|
22108
|
+
/**
|
|
22109
|
+
* Retrieve map of local references.
|
|
22110
|
+
*
|
|
22111
|
+
* The references are retrieved as a map of local reference name to element or directive instance.
|
|
22112
|
+
*
|
|
22113
|
+
* @param target DOM element, component or directive instance for which to retrieve
|
|
22114
|
+
* the local references.
|
|
22115
|
+
*/
|
|
22116
|
+
function getLocalRefs(target) {
|
|
22117
|
+
const context = getLContext(target);
|
|
22118
|
+
if (context === null)
|
|
22119
|
+
return {};
|
|
22120
|
+
if (context.localRefs === undefined) {
|
|
22121
|
+
const lView = context.lView;
|
|
22122
|
+
if (lView === null) {
|
|
22123
|
+
return {};
|
|
22124
|
+
}
|
|
22125
|
+
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
22420
22126
|
}
|
|
22127
|
+
return context.localRefs || {};
|
|
22421
22128
|
}
|
|
22422
|
-
|
|
22423
|
-
|
|
22424
|
-
|
|
22425
|
-
|
|
22426
|
-
|
|
22427
|
-
|
|
22428
|
-
|
|
22429
|
-
|
|
22430
|
-
|
|
22431
|
-
|
|
22432
|
-
|
|
22433
|
-
|
|
22434
|
-
|
|
22435
|
-
destroy() {
|
|
22436
|
-
this.injector.destroy();
|
|
22437
|
-
}
|
|
22438
|
-
onDestroy(callback) {
|
|
22439
|
-
this.injector.onDestroy(callback);
|
|
22440
|
-
}
|
|
22129
|
+
/**
|
|
22130
|
+
* Retrieves the host element of a component or directive instance.
|
|
22131
|
+
* The host element is the DOM element that matched the selector of the directive.
|
|
22132
|
+
*
|
|
22133
|
+
* @param componentOrDirective Component or directive instance for which the host
|
|
22134
|
+
* element should be retrieved.
|
|
22135
|
+
* @returns Host element of the target.
|
|
22136
|
+
*
|
|
22137
|
+
* @publicApi
|
|
22138
|
+
* @globalApi ng
|
|
22139
|
+
*/
|
|
22140
|
+
function getHostElement(componentOrDirective) {
|
|
22141
|
+
return getLContext(componentOrDirective).native;
|
|
22441
22142
|
}
|
|
22442
22143
|
/**
|
|
22443
|
-
*
|
|
22144
|
+
* Retrieves the rendered text for a given component.
|
|
22145
|
+
*
|
|
22146
|
+
* This function retrieves the host element of a component and
|
|
22147
|
+
* and then returns the `textContent` for that element. This implies
|
|
22148
|
+
* that the text returned will include re-projected content of
|
|
22149
|
+
* the component as well.
|
|
22150
|
+
*
|
|
22151
|
+
* @param component The component to return the content text for.
|
|
22152
|
+
*/
|
|
22153
|
+
function getRenderedText(component) {
|
|
22154
|
+
const hostElement = getHostElement(component);
|
|
22155
|
+
return hostElement.textContent || '';
|
|
22156
|
+
}
|
|
22157
|
+
/**
|
|
22158
|
+
* Retrieves a list of event listeners associated with a DOM element. The list does include host
|
|
22159
|
+
* listeners, but it does not include event listeners defined outside of the Angular context
|
|
22160
|
+
* (e.g. through `addEventListener`).
|
|
22161
|
+
*
|
|
22162
|
+
* @usageNotes
|
|
22163
|
+
* Given the following DOM structure:
|
|
22164
|
+
*
|
|
22165
|
+
* ```html
|
|
22166
|
+
* <app-root>
|
|
22167
|
+
* <div (click)="doSomething()"></div>
|
|
22168
|
+
* </app-root>
|
|
22169
|
+
* ```
|
|
22444
22170
|
*
|
|
22445
|
-
*
|
|
22446
|
-
* [this guide](guide/standalone-components#environment-injectors).
|
|
22171
|
+
* Calling `getListeners` on `<div>` will return an object that looks as follows:
|
|
22447
22172
|
*
|
|
22448
|
-
*
|
|
22449
|
-
*
|
|
22450
|
-
*
|
|
22451
|
-
*
|
|
22173
|
+
* ```ts
|
|
22174
|
+
* {
|
|
22175
|
+
* name: 'click',
|
|
22176
|
+
* element: <div>,
|
|
22177
|
+
* callback: () => doSomething(),
|
|
22178
|
+
* useCapture: false
|
|
22179
|
+
* }
|
|
22180
|
+
* ```
|
|
22181
|
+
*
|
|
22182
|
+
* @param element Element for which the DOM listeners should be retrieved.
|
|
22183
|
+
* @returns Array of event listeners on the DOM element.
|
|
22452
22184
|
*
|
|
22453
22185
|
* @publicApi
|
|
22454
|
-
* @
|
|
22186
|
+
* @globalApi ng
|
|
22455
22187
|
*/
|
|
22456
|
-
function
|
|
22457
|
-
|
|
22458
|
-
|
|
22188
|
+
function getListeners(element) {
|
|
22189
|
+
ngDevMode && assertDomElement(element);
|
|
22190
|
+
const lContext = getLContext(element);
|
|
22191
|
+
const lView = lContext === null ? null : lContext.lView;
|
|
22192
|
+
if (lView === null)
|
|
22193
|
+
return [];
|
|
22194
|
+
const tView = lView[TVIEW];
|
|
22195
|
+
const lCleanup = lView[CLEANUP];
|
|
22196
|
+
const tCleanup = tView.cleanup;
|
|
22197
|
+
const listeners = [];
|
|
22198
|
+
if (tCleanup && lCleanup) {
|
|
22199
|
+
for (let i = 0; i < tCleanup.length;) {
|
|
22200
|
+
const firstParam = tCleanup[i++];
|
|
22201
|
+
const secondParam = tCleanup[i++];
|
|
22202
|
+
if (typeof firstParam === 'string') {
|
|
22203
|
+
const name = firstParam;
|
|
22204
|
+
const listenerElement = unwrapRNode(lView[secondParam]);
|
|
22205
|
+
const callback = lCleanup[tCleanup[i++]];
|
|
22206
|
+
const useCaptureOrIndx = tCleanup[i++];
|
|
22207
|
+
// if useCaptureOrIndx is boolean then report it as is.
|
|
22208
|
+
// if useCaptureOrIndx is positive number then it in unsubscribe method
|
|
22209
|
+
// if useCaptureOrIndx is negative number then it is a Subscription
|
|
22210
|
+
const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
|
|
22211
|
+
const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
|
|
22212
|
+
if (element == listenerElement) {
|
|
22213
|
+
listeners.push({ element, name, callback, useCapture, type });
|
|
22214
|
+
}
|
|
22215
|
+
}
|
|
22216
|
+
}
|
|
22217
|
+
}
|
|
22218
|
+
listeners.sort(sortListeners);
|
|
22219
|
+
return listeners;
|
|
22220
|
+
}
|
|
22221
|
+
function sortListeners(a, b) {
|
|
22222
|
+
if (a.name == b.name)
|
|
22223
|
+
return 0;
|
|
22224
|
+
return a.name < b.name ? -1 : 1;
|
|
22459
22225
|
}
|
|
22460
|
-
|
|
22461
22226
|
/**
|
|
22462
|
-
*
|
|
22463
|
-
* Copyright Google LLC All Rights Reserved.
|
|
22227
|
+
* This function should not exist because it is megamorphic and only mostly correct.
|
|
22464
22228
|
*
|
|
22465
|
-
*
|
|
22466
|
-
* found in the LICENSE file at https://angular.io/license
|
|
22229
|
+
* See call site for more info.
|
|
22467
22230
|
*/
|
|
22231
|
+
function isDirectiveDefHack(obj) {
|
|
22232
|
+
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22233
|
+
}
|
|
22468
22234
|
/**
|
|
22469
|
-
*
|
|
22470
|
-
*
|
|
22471
|
-
*
|
|
22235
|
+
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22236
|
+
*
|
|
22237
|
+
* @param element DOM element which is owned by an existing component's view.
|
|
22472
22238
|
*/
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
this.cachedInjectors = new Map();
|
|
22239
|
+
function getDebugNode$1(element) {
|
|
22240
|
+
if (ngDevMode && !(element instanceof Node)) {
|
|
22241
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22477
22242
|
}
|
|
22478
|
-
|
|
22479
|
-
|
|
22480
|
-
|
|
22481
|
-
|
|
22482
|
-
if (!this.cachedInjectors.has(componentDef.id)) {
|
|
22483
|
-
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
22484
|
-
const standaloneInjector = providers.length > 0 ?
|
|
22485
|
-
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22486
|
-
null;
|
|
22487
|
-
this.cachedInjectors.set(componentDef.id, standaloneInjector);
|
|
22488
|
-
}
|
|
22489
|
-
return this.cachedInjectors.get(componentDef.id);
|
|
22243
|
+
const lContext = getLContext(element);
|
|
22244
|
+
const lView = lContext ? lContext.lView : null;
|
|
22245
|
+
if (lView === null) {
|
|
22246
|
+
return null;
|
|
22490
22247
|
}
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
this.cachedInjectors.clear();
|
|
22501
|
-
}
|
|
22248
|
+
const nodeIndex = lContext.nodeIndex;
|
|
22249
|
+
if (nodeIndex !== -1) {
|
|
22250
|
+
const valueInLView = lView[nodeIndex];
|
|
22251
|
+
// this means that value in the lView is a component with its own
|
|
22252
|
+
// data. In this situation the TNode is not accessed at the same spot.
|
|
22253
|
+
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22254
|
+
ngDevMode &&
|
|
22255
|
+
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22256
|
+
return buildDebugNode(tNode, lView);
|
|
22502
22257
|
}
|
|
22258
|
+
return null;
|
|
22503
22259
|
}
|
|
22504
|
-
/** @nocollapse */
|
|
22505
|
-
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22506
|
-
token: StandaloneService,
|
|
22507
|
-
providedIn: 'environment',
|
|
22508
|
-
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22509
|
-
});
|
|
22510
22260
|
/**
|
|
22511
|
-
*
|
|
22261
|
+
* Retrieve the component `LView` from component/element.
|
|
22512
22262
|
*
|
|
22513
|
-
*
|
|
22514
|
-
*
|
|
22515
|
-
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
22516
|
-
* is tree-shakable and not included in applications that don't use standalone components.
|
|
22263
|
+
* NOTE: `LView` is a private and should not be leaked outside.
|
|
22264
|
+
* Don't export this method to `ng.*` on window.
|
|
22517
22265
|
*
|
|
22518
|
-
* @
|
|
22266
|
+
* @param target DOM element or component instance for which to retrieve the LView.
|
|
22519
22267
|
*/
|
|
22520
|
-
function
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22268
|
+
function getComponentLView(target) {
|
|
22269
|
+
const lContext = getLContext(target);
|
|
22270
|
+
const nodeIndx = lContext.nodeIndex;
|
|
22271
|
+
const lView = lContext.lView;
|
|
22272
|
+
ngDevMode && assertLView(lView);
|
|
22273
|
+
const componentLView = lView[nodeIndx];
|
|
22274
|
+
ngDevMode && assertLView(componentLView);
|
|
22275
|
+
return componentLView;
|
|
22276
|
+
}
|
|
22277
|
+
/** Asserts that a value is a DOM Element. */
|
|
22278
|
+
function assertDomElement(value) {
|
|
22279
|
+
if (typeof Element !== 'undefined' && !(value instanceof Element)) {
|
|
22280
|
+
throw new Error('Expecting instance of DOM Element');
|
|
22281
|
+
}
|
|
22524
22282
|
}
|
|
22525
22283
|
|
|
22526
22284
|
/**
|
|
@@ -23561,7 +23319,7 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
23561
23319
|
// so that a component can use DI tokens provided in MgModules. For this reason, we can not
|
|
23562
23320
|
// rely on the provided injector, since it might be detached from the DI tree (for example, if
|
|
23563
23321
|
// it was created via `Injector.create` without specifying a parent injector, or if an
|
|
23564
|
-
// injector is retrieved from an `NgModuleRef` created via `
|
|
23322
|
+
// injector is retrieved from an `NgModuleRef` created via `createNgModule` using an
|
|
23565
23323
|
// NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent
|
|
23566
23324
|
// injector, which is normally connected to the DI tree, which includes module injector
|
|
23567
23325
|
// subtree.
|
|
@@ -23740,7 +23498,7 @@ const unusedValueExportToPlacateAjd = 1;
|
|
|
23740
23498
|
* Use of this source code is governed by an MIT-style license that can be
|
|
23741
23499
|
* found in the LICENSE file at https://angular.io/license
|
|
23742
23500
|
*/
|
|
23743
|
-
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$
|
|
23501
|
+
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
|
|
23744
23502
|
class LQuery_ {
|
|
23745
23503
|
constructor(queryList) {
|
|
23746
23504
|
this.queryList = queryList;
|
|
@@ -26174,6 +25932,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
|
|
|
26174
25932
|
class CompilerFactory {
|
|
26175
25933
|
}
|
|
26176
25934
|
|
|
25935
|
+
/**
|
|
25936
|
+
* @license
|
|
25937
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25938
|
+
*
|
|
25939
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25940
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25941
|
+
*/
|
|
25942
|
+
/**
|
|
25943
|
+
* Marks a component for check (in case of OnPush components) and synchronously
|
|
25944
|
+
* performs change detection on the application this component belongs to.
|
|
25945
|
+
*
|
|
25946
|
+
* @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
|
|
25947
|
+
*
|
|
25948
|
+
* @publicApi
|
|
25949
|
+
* @globalApi ng
|
|
25950
|
+
*/
|
|
25951
|
+
function applyChanges(component) {
|
|
25952
|
+
markDirty(component);
|
|
25953
|
+
getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
|
|
25954
|
+
}
|
|
25955
|
+
|
|
25956
|
+
/**
|
|
25957
|
+
* @license
|
|
25958
|
+
* Copyright Google LLC All Rights Reserved.
|
|
25959
|
+
*
|
|
25960
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
25961
|
+
* found in the LICENSE file at https://angular.io/license
|
|
25962
|
+
*/
|
|
25963
|
+
/**
|
|
25964
|
+
* This file introduces series of globally accessible debug tools
|
|
25965
|
+
* to allow for the Angular debugging story to function.
|
|
25966
|
+
*
|
|
25967
|
+
* To see this in action run the following command:
|
|
25968
|
+
*
|
|
25969
|
+
* bazel run //packages/core/test/bundling/todo:devserver
|
|
25970
|
+
*
|
|
25971
|
+
* Then load `localhost:5432` and start using the console tools.
|
|
25972
|
+
*/
|
|
25973
|
+
/**
|
|
25974
|
+
* This value reflects the property on the window where the dev
|
|
25975
|
+
* tools are patched (window.ng).
|
|
25976
|
+
* */
|
|
25977
|
+
const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
|
|
25978
|
+
let _published = false;
|
|
25979
|
+
/**
|
|
25980
|
+
* Publishes a collection of default debug tools onto`window.ng`.
|
|
25981
|
+
*
|
|
25982
|
+
* These functions are available globally when Angular is in development
|
|
25983
|
+
* mode and are automatically stripped away from prod mode is on.
|
|
25984
|
+
*/
|
|
25985
|
+
function publishDefaultGlobalUtils$1() {
|
|
25986
|
+
if (!_published) {
|
|
25987
|
+
_published = true;
|
|
25988
|
+
/**
|
|
25989
|
+
* Warning: this function is *INTERNAL* and should not be relied upon in application's code.
|
|
25990
|
+
* The contract of the function might be changed in any release and/or the function can be
|
|
25991
|
+
* removed completely.
|
|
25992
|
+
*/
|
|
25993
|
+
publishGlobalUtil('ɵsetProfiler', setProfiler);
|
|
25994
|
+
publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
|
|
25995
|
+
publishGlobalUtil('getComponent', getComponent);
|
|
25996
|
+
publishGlobalUtil('getContext', getContext);
|
|
25997
|
+
publishGlobalUtil('getListeners', getListeners);
|
|
25998
|
+
publishGlobalUtil('getOwningComponent', getOwningComponent);
|
|
25999
|
+
publishGlobalUtil('getHostElement', getHostElement);
|
|
26000
|
+
publishGlobalUtil('getInjector', getInjector);
|
|
26001
|
+
publishGlobalUtil('getRootComponents', getRootComponents);
|
|
26002
|
+
publishGlobalUtil('getDirectives', getDirectives);
|
|
26003
|
+
publishGlobalUtil('applyChanges', applyChanges);
|
|
26004
|
+
}
|
|
26005
|
+
}
|
|
26006
|
+
/**
|
|
26007
|
+
* Publishes the given function to `window.ng` so that it can be
|
|
26008
|
+
* used from the browser console when an application is not in production.
|
|
26009
|
+
*/
|
|
26010
|
+
function publishGlobalUtil(name, fn) {
|
|
26011
|
+
if (typeof COMPILED === 'undefined' || !COMPILED) {
|
|
26012
|
+
// Note: we can't export `ng` when using closure enhanced optimization as:
|
|
26013
|
+
// - closure declares globals itself for minified names, which sometimes clobber our `ng` global
|
|
26014
|
+
// - we can't declare a closure extern as the namespace `ng` is already used within Google
|
|
26015
|
+
// for typings for AngularJS (via `goog.provide('ng....')`).
|
|
26016
|
+
const w = _global;
|
|
26017
|
+
ngDevMode && assertDefined(fn, 'function not defined');
|
|
26018
|
+
if (w) {
|
|
26019
|
+
let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
|
|
26020
|
+
if (!container) {
|
|
26021
|
+
container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
|
|
26022
|
+
}
|
|
26023
|
+
container[name] = fn;
|
|
26024
|
+
}
|
|
26025
|
+
}
|
|
26026
|
+
}
|
|
26027
|
+
|
|
26177
26028
|
/**
|
|
26178
26029
|
* @license
|
|
26179
26030
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -26329,12 +26180,16 @@ class NgZone {
|
|
|
26329
26180
|
*/
|
|
26330
26181
|
this.onError = new EventEmitter(false);
|
|
26331
26182
|
if (typeof Zone == 'undefined') {
|
|
26332
|
-
throw new
|
|
26183
|
+
throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
|
|
26333
26184
|
}
|
|
26334
26185
|
Zone.assertZonePatched();
|
|
26335
26186
|
const self = this;
|
|
26336
26187
|
self._nesting = 0;
|
|
26337
26188
|
self._outer = self._inner = Zone.current;
|
|
26189
|
+
if (Zone['AsyncStackTaggingZoneSpec']) {
|
|
26190
|
+
const AsyncStackTaggingZoneSpec = Zone['AsyncStackTaggingZoneSpec'];
|
|
26191
|
+
self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));
|
|
26192
|
+
}
|
|
26338
26193
|
if (Zone['TaskTrackingZoneSpec']) {
|
|
26339
26194
|
self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']);
|
|
26340
26195
|
}
|
|
@@ -26356,12 +26211,12 @@ class NgZone {
|
|
|
26356
26211
|
}
|
|
26357
26212
|
static assertInAngularZone() {
|
|
26358
26213
|
if (!NgZone.isInAngularZone()) {
|
|
26359
|
-
throw new
|
|
26214
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
|
|
26360
26215
|
}
|
|
26361
26216
|
}
|
|
26362
26217
|
static assertNotInAngularZone() {
|
|
26363
26218
|
if (NgZone.isInAngularZone()) {
|
|
26364
|
-
throw new
|
|
26219
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
|
|
26365
26220
|
}
|
|
26366
26221
|
}
|
|
26367
26222
|
/**
|
|
@@ -26925,7 +26780,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
|
26925
26780
|
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26926
26781
|
* entire class tree-shakeable.
|
|
26927
26782
|
*/
|
|
26928
|
-
const
|
|
26783
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
26929
26784
|
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26930
26785
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26931
26786
|
ngDevMode && assertNgModuleType(moduleType);
|
|
@@ -27064,7 +26919,15 @@ function internalBootstrapApplication(config) {
|
|
|
27064
26919
|
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
27065
26920
|
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
27066
26921
|
const appRef = appInjector.get(ApplicationRef);
|
|
27067
|
-
|
|
26922
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
26923
|
+
// for all bootstrapped applications as well.
|
|
26924
|
+
const destroyListener = () => appRef.destroy();
|
|
26925
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
26926
|
+
onPlatformDestroyListeners?.add(destroyListener);
|
|
26927
|
+
appRef.onDestroy(() => {
|
|
26928
|
+
onPlatformDestroyListeners?.delete(destroyListener);
|
|
26929
|
+
onErrorSubscription.unsubscribe();
|
|
26930
|
+
});
|
|
27068
26931
|
appRef.bootstrap(rootComponent);
|
|
27069
26932
|
return appRef;
|
|
27070
26933
|
});
|
|
@@ -27128,7 +26991,7 @@ function createPlatformInjector(providers = [], name) {
|
|
|
27128
26991
|
name,
|
|
27129
26992
|
providers: [
|
|
27130
26993
|
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
27131
|
-
{ provide:
|
|
26994
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
27132
26995
|
...providers
|
|
27133
26996
|
],
|
|
27134
26997
|
});
|
|
@@ -27275,8 +27138,11 @@ class PlatformRef {
|
|
|
27275
27138
|
}
|
|
27276
27139
|
this._modules.slice().forEach(module => module.destroy());
|
|
27277
27140
|
this._destroyListeners.forEach(listener => listener());
|
|
27278
|
-
const
|
|
27279
|
-
|
|
27141
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27142
|
+
if (destroyListeners) {
|
|
27143
|
+
destroyListeners.forEach(listener => listener());
|
|
27144
|
+
destroyListeners.clear();
|
|
27145
|
+
}
|
|
27280
27146
|
this._destroyed = true;
|
|
27281
27147
|
}
|
|
27282
27148
|
/**
|
|
@@ -27434,11 +27300,10 @@ function optionsReducer(dst, objs) {
|
|
|
27434
27300
|
*/
|
|
27435
27301
|
class ApplicationRef {
|
|
27436
27302
|
/** @internal */
|
|
27437
|
-
constructor(_zone, _injector, _exceptionHandler
|
|
27303
|
+
constructor(_zone, _injector, _exceptionHandler) {
|
|
27438
27304
|
this._zone = _zone;
|
|
27439
27305
|
this._injector = _injector;
|
|
27440
27306
|
this._exceptionHandler = _exceptionHandler;
|
|
27441
|
-
this._initStatus = _initStatus;
|
|
27442
27307
|
/** @internal */
|
|
27443
27308
|
this._bootstrapListeners = [];
|
|
27444
27309
|
this._views = [];
|
|
@@ -27511,7 +27376,9 @@ class ApplicationRef {
|
|
|
27511
27376
|
get destroyed() {
|
|
27512
27377
|
return this._destroyed;
|
|
27513
27378
|
}
|
|
27514
|
-
/**
|
|
27379
|
+
/**
|
|
27380
|
+
* The `EnvironmentInjector` used to create this application.
|
|
27381
|
+
*/
|
|
27515
27382
|
get injector() {
|
|
27516
27383
|
return this._injector;
|
|
27517
27384
|
}
|
|
@@ -27555,7 +27422,8 @@ class ApplicationRef {
|
|
|
27555
27422
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27556
27423
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27557
27424
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
27558
|
-
|
|
27425
|
+
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
27426
|
+
if (!initStatus.done) {
|
|
27559
27427
|
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27560
27428
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27561
27429
|
(standalone ? '' :
|
|
@@ -27687,7 +27555,7 @@ class ApplicationRef {
|
|
|
27687
27555
|
}
|
|
27688
27556
|
/**
|
|
27689
27557
|
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
27690
|
-
* will destroy the associated
|
|
27558
|
+
* will destroy the associated environment injectors as well as all the bootstrapped components
|
|
27691
27559
|
* with their views.
|
|
27692
27560
|
*/
|
|
27693
27561
|
destroy() {
|
|
@@ -27714,12 +27582,12 @@ class ApplicationRef {
|
|
|
27714
27582
|
}
|
|
27715
27583
|
}
|
|
27716
27584
|
}
|
|
27717
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(
|
|
27585
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(EnvironmentInjector), ɵɵinject(ErrorHandler)); };
|
|
27718
27586
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
27719
27587
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
27720
27588
|
type: Injectable,
|
|
27721
27589
|
args: [{ providedIn: 'root' }]
|
|
27722
|
-
}], function () { return [{ type: NgZone }, { type:
|
|
27590
|
+
}], function () { return [{ type: NgZone }, { type: EnvironmentInjector }, { type: ErrorHandler }]; }, null); })();
|
|
27723
27591
|
function remove(list, el) {
|
|
27724
27592
|
const index = list.indexOf(el);
|
|
27725
27593
|
if (index > -1) {
|
|
@@ -28066,7 +27934,7 @@ class DebugNode {
|
|
|
28066
27934
|
get componentInstance() {
|
|
28067
27935
|
const nativeElement = this.nativeNode;
|
|
28068
27936
|
return nativeElement &&
|
|
28069
|
-
(getComponent
|
|
27937
|
+
(getComponent(nativeElement) || getOwningComponent(nativeElement));
|
|
28070
27938
|
}
|
|
28071
27939
|
/**
|
|
28072
27940
|
* An object that provides parent context for this element. Often an ancestor component instance
|
|
@@ -28077,7 +27945,7 @@ class DebugNode {
|
|
|
28077
27945
|
* of heroes"`.
|
|
28078
27946
|
*/
|
|
28079
27947
|
get context() {
|
|
28080
|
-
return getComponent
|
|
27948
|
+
return getComponent(this.nativeNode) || getContext(this.nativeNode);
|
|
28081
27949
|
}
|
|
28082
27950
|
/**
|
|
28083
27951
|
* The callbacks attached to the component's @Output properties and/or the element's event
|
|
@@ -28415,10 +28283,9 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28415
28283
|
// Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple
|
|
28416
28284
|
// times. ViewEngine could do it more efficiently, because all the insertions go through
|
|
28417
28285
|
// Renderer2, however that's not the case in Ivy. This approach is being used because:
|
|
28418
|
-
// 1. Matching the ViewEngine behavior would mean potentially introducing a
|
|
28286
|
+
// 1. Matching the ViewEngine behavior would mean potentially introducing a dependency
|
|
28419
28287
|
// from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
|
|
28420
|
-
// 2.
|
|
28421
|
-
// 3. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28288
|
+
// 2. It allows us to capture nodes that were inserted directly via the DOM.
|
|
28422
28289
|
nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
|
|
28423
28290
|
}
|
|
28424
28291
|
// In all cases, if a dynamic container exists for this node, each view inside it has to be
|
|
@@ -29894,5 +29761,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
29894
29761
|
* Generated bundle index. Do not edit.
|
|
29895
29762
|
*/
|
|
29896
29763
|
|
|
29897
|
-
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,
|
|
29764
|
+
export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
|
|
29898
29765
|
//# sourceMappingURL=core.mjs.map
|