@angular/core 16.0.0 → 16.1.0-next.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/esm2022/src/application_ref.mjs +60 -55
- package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
- package/esm2022/src/di/injectable.mjs +2 -1
- package/esm2022/src/di/metadata.mjs +6 -5
- package/esm2022/src/di/metadata_attr.mjs +2 -1
- package/esm2022/src/errors.mjs +1 -1
- package/esm2022/src/hydration/annotate.mjs +1 -1
- package/esm2022/src/hydration/api.mjs +2 -2
- package/esm2022/src/hydration/skip_hydration.mjs +12 -1
- package/esm2022/src/hydration/utils.mjs +9 -3
- package/esm2022/src/linker/element_ref.mjs +1 -1
- package/esm2022/src/linker/template_ref.mjs +6 -3
- package/esm2022/src/linker/view_container_ref.mjs +16 -6
- package/esm2022/src/metadata/di.mjs +5 -4
- package/esm2022/src/metadata/directives.mjs +7 -7
- package/esm2022/src/metadata/ng_module.mjs +2 -1
- package/esm2022/src/render/api.mjs +1 -1
- package/esm2022/src/render3/component.mjs +4 -1
- package/esm2022/src/render3/component_ref.mjs +14 -3
- package/esm2022/src/render3/definition.mjs +9 -3
- package/esm2022/src/render3/di.mjs +2 -2
- package/esm2022/src/render3/hooks.mjs +3 -3
- package/esm2022/src/render3/instructions/change_detection.mjs +37 -53
- package/esm2022/src/render3/instructions/element_validation.mjs +2 -2
- package/esm2022/src/render3/instructions/shared.mjs +15 -4
- package/esm2022/src/render3/interfaces/definition.mjs +1 -1
- package/esm2022/src/render3/interfaces/document.mjs +6 -4
- package/esm2022/src/render3/interfaces/node.mjs +1 -1
- package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
- package/esm2022/src/render3/interfaces/view.mjs +1 -1
- package/esm2022/src/render3/jit/directive.mjs +2 -1
- package/esm2022/src/render3/node_manipulation.mjs +7 -1
- package/esm2022/src/transfer_state.mjs +8 -7
- package/esm2022/src/util/assert.mjs +2 -5
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed.mjs +4 -4
- package/fesm2022/core.mjs +252 -192
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +179 -130
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +54 -35
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +13 -13
- package/schematics/migrations/remove-module-id/bundle.js +14 -14
- package/schematics/ng-generate/standalone-migration/bundle.js +614 -411
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
package/fesm2022/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.0
|
|
2
|
+
* @license Angular v16.1.0-next.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -302,10 +302,7 @@ function throwError(msg, actual, expected, comparison) {
|
|
|
302
302
|
(comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));
|
|
303
303
|
}
|
|
304
304
|
function assertDomNode(node) {
|
|
305
|
-
|
|
306
|
-
if (!(typeof Node !== 'undefined' && node instanceof Node) &&
|
|
307
|
-
!(typeof node === 'object' && node != null &&
|
|
308
|
-
node.constructor.name === 'WebWorkerRenderNode')) {
|
|
305
|
+
if (!(node instanceof Node)) {
|
|
309
306
|
throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);
|
|
310
307
|
}
|
|
311
308
|
}
|
|
@@ -1610,6 +1607,7 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
1610
1607
|
pipeDefs: null,
|
|
1611
1608
|
dependencies: baseDef.standalone && componentDefinition.dependencies || null,
|
|
1612
1609
|
getStandaloneInjector: null,
|
|
1610
|
+
signals: componentDefinition.signals ?? false,
|
|
1613
1611
|
data: componentDefinition.data || {},
|
|
1614
1612
|
encapsulation: componentDefinition.encapsulation || ViewEncapsulation$1.Emulated,
|
|
1615
1613
|
styles: componentDefinition.styles || EMPTY_ARRAY,
|
|
@@ -1852,6 +1850,7 @@ function getNgDirectiveDef(directiveDefinition) {
|
|
|
1852
1850
|
declaredInputs,
|
|
1853
1851
|
exportAs: directiveDefinition.exportAs || null,
|
|
1854
1852
|
standalone: directiveDefinition.standalone === true,
|
|
1853
|
+
signals: directiveDefinition.signals === true,
|
|
1855
1854
|
selectors: directiveDefinition.selectors || EMPTY_ARRAY,
|
|
1856
1855
|
viewQuery: directiveDefinition.viewQuery || null,
|
|
1857
1856
|
features: directiveDefinition.features || null,
|
|
@@ -1893,7 +1892,7 @@ function getComponentId(componentDef) {
|
|
|
1893
1892
|
// Example:
|
|
1894
1893
|
// https://github.com/angular/components/blob/d9f82c8f95309e77a6d82fd574c65871e91354c2/src/material/core/option/option.ts#L248
|
|
1895
1894
|
// https://github.com/angular/components/blob/285f46dc2b4c5b127d356cb7c4714b221f03ce50/src/material/legacy-core/option/option.ts#L32
|
|
1896
|
-
const hashSelectors = [
|
|
1895
|
+
const hashSelectors = JSON.stringify([
|
|
1897
1896
|
componentDef.selectors,
|
|
1898
1897
|
componentDef.ngContentSelectors,
|
|
1899
1898
|
componentDef.hostVars,
|
|
@@ -1903,12 +1902,16 @@ function getComponentId(componentDef) {
|
|
|
1903
1902
|
componentDef.decls,
|
|
1904
1903
|
componentDef.encapsulation,
|
|
1905
1904
|
componentDef.standalone,
|
|
1905
|
+
componentDef.signals,
|
|
1906
|
+
componentDef.exportAs,
|
|
1907
|
+
componentDef.inputs,
|
|
1908
|
+
componentDef.outputs,
|
|
1906
1909
|
// We cannot use 'componentDef.type.name' as the name of the symbol will change and will not
|
|
1907
1910
|
// match in the server and browser bundles.
|
|
1908
1911
|
Object.getOwnPropertyNames(componentDef.type.prototype),
|
|
1909
1912
|
!!componentDef.contentQueries,
|
|
1910
1913
|
!!componentDef.viewQuery,
|
|
1911
|
-
]
|
|
1914
|
+
]);
|
|
1912
1915
|
for (const char of hashSelectors) {
|
|
1913
1916
|
hash = Math.imul(31, hash) + char.charCodeAt(0) << 0;
|
|
1914
1917
|
}
|
|
@@ -3741,7 +3744,7 @@ function incrementInitPhaseFlags(lView, initPhase) {
|
|
|
3741
3744
|
assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
3742
3745
|
let flags = lView[FLAGS];
|
|
3743
3746
|
if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {
|
|
3744
|
-
flags &=
|
|
3747
|
+
flags &= 8191 /* LViewFlags.IndexWithinInitPhaseReset */;
|
|
3745
3748
|
flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;
|
|
3746
3749
|
lView[FLAGS] = flags;
|
|
3747
3750
|
}
|
|
@@ -3822,12 +3825,12 @@ function callHook(currentView, initPhase, arr, i) {
|
|
|
3822
3825
|
const directiveIndex = isInitHook ? -arr[i] : arr[i];
|
|
3823
3826
|
const directive = currentView[directiveIndex];
|
|
3824
3827
|
if (isInitHook) {
|
|
3825
|
-
const indexWithintInitPhase = currentView[FLAGS] >>
|
|
3828
|
+
const indexWithintInitPhase = currentView[FLAGS] >> 13 /* LViewFlags.IndexWithinInitPhaseShift */;
|
|
3826
3829
|
// The init phase state must be always checked here as it may have been recursively updated.
|
|
3827
3830
|
if (indexWithintInitPhase <
|
|
3828
3831
|
(currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */) &&
|
|
3829
3832
|
(currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {
|
|
3830
|
-
currentView[FLAGS] +=
|
|
3833
|
+
currentView[FLAGS] += 8192 /* LViewFlags.IndexWithinInitPhaseIncrementer */;
|
|
3831
3834
|
callHookInternal(directive, hook);
|
|
3832
3835
|
}
|
|
3833
3836
|
}
|
|
@@ -4728,7 +4731,7 @@ function ɵɵgetInheritedFactory(type) {
|
|
|
4728
4731
|
// (no Angular decorator on the superclass) or there is no constructor at all
|
|
4729
4732
|
// in the inheritance chain. Since the two cases cannot be distinguished, the
|
|
4730
4733
|
// latter has to be assumed.
|
|
4731
|
-
return t => new t();
|
|
4734
|
+
return (t) => new t();
|
|
4732
4735
|
});
|
|
4733
4736
|
}
|
|
4734
4737
|
function getFactoryOf(type) {
|
|
@@ -4938,6 +4941,7 @@ function makePropDecorator(name, props, parentClass, additionalProcessing) {
|
|
|
4938
4941
|
/**
|
|
4939
4942
|
* Attribute decorator and metadata.
|
|
4940
4943
|
*
|
|
4944
|
+
* @Annotation
|
|
4941
4945
|
* @publicApi
|
|
4942
4946
|
*/
|
|
4943
4947
|
const Attribute = makeParamDecorator('Attribute', (attributeName) => ({ attributeName, __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName) }));
|
|
@@ -4961,6 +4965,7 @@ class Query {
|
|
|
4961
4965
|
* ContentChildren decorator and metadata.
|
|
4962
4966
|
*
|
|
4963
4967
|
*
|
|
4968
|
+
* @Annotation
|
|
4964
4969
|
* @publicApi
|
|
4965
4970
|
*/
|
|
4966
4971
|
const ContentChildren = makePropDecorator('ContentChildren', (selector, data = {}) => ({
|
|
@@ -4975,7 +4980,7 @@ const ContentChildren = makePropDecorator('ContentChildren', (selector, data = {
|
|
|
4975
4980
|
* ContentChild decorator and metadata.
|
|
4976
4981
|
*
|
|
4977
4982
|
*
|
|
4978
|
-
|
|
4983
|
+
* @Annotation
|
|
4979
4984
|
*
|
|
4980
4985
|
* @publicApi
|
|
4981
4986
|
*/
|
|
@@ -4983,7 +4988,7 @@ const ContentChild = makePropDecorator('ContentChild', (selector, data = {}) =>
|
|
|
4983
4988
|
/**
|
|
4984
4989
|
* ViewChildren decorator and metadata.
|
|
4985
4990
|
*
|
|
4986
|
-
|
|
4991
|
+
* @Annotation
|
|
4987
4992
|
* @publicApi
|
|
4988
4993
|
*/
|
|
4989
4994
|
const ViewChildren = makePropDecorator('ViewChildren', (selector, data = {}) => ({
|
|
@@ -4997,7 +5002,7 @@ const ViewChildren = makePropDecorator('ViewChildren', (selector, data = {}) =>
|
|
|
4997
5002
|
/**
|
|
4998
5003
|
* ViewChild decorator and metadata.
|
|
4999
5004
|
*
|
|
5000
|
-
|
|
5005
|
+
* @Annotation
|
|
5001
5006
|
* @publicApi
|
|
5002
5007
|
*/
|
|
5003
5008
|
const ViewChild = makePropDecorator('ViewChild', (selector, data) => ({ selector, first: true, isViewQuery: true, descendants: true, ...data }), Query);
|
|
@@ -5584,6 +5589,7 @@ function getParentCtor(ctor) {
|
|
|
5584
5589
|
/**
|
|
5585
5590
|
* Inject decorator and metadata.
|
|
5586
5591
|
*
|
|
5592
|
+
* @Annotation
|
|
5587
5593
|
* @publicApi
|
|
5588
5594
|
*/
|
|
5589
5595
|
const Inject = attachInjectFlag(
|
|
@@ -5593,7 +5599,7 @@ makeParamDecorator('Inject', (token) => ({ token })), -1 /* DecoratorFlags.Injec
|
|
|
5593
5599
|
/**
|
|
5594
5600
|
* Optional decorator and metadata.
|
|
5595
5601
|
*
|
|
5596
|
-
|
|
5602
|
+
* @Annotation
|
|
5597
5603
|
* @publicApi
|
|
5598
5604
|
*/
|
|
5599
5605
|
const Optional =
|
|
@@ -5603,7 +5609,7 @@ attachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Option
|
|
|
5603
5609
|
/**
|
|
5604
5610
|
* Self decorator and metadata.
|
|
5605
5611
|
*
|
|
5606
|
-
|
|
5612
|
+
* @Annotation
|
|
5607
5613
|
* @publicApi
|
|
5608
5614
|
*/
|
|
5609
5615
|
const Self =
|
|
@@ -5613,7 +5619,7 @@ attachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);
|
|
|
5613
5619
|
/**
|
|
5614
5620
|
* `SkipSelf` decorator and metadata.
|
|
5615
5621
|
*
|
|
5616
|
-
|
|
5622
|
+
* @Annotation
|
|
5617
5623
|
* @publicApi
|
|
5618
5624
|
*/
|
|
5619
5625
|
const SkipSelf =
|
|
@@ -5623,7 +5629,7 @@ attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSe
|
|
|
5623
5629
|
/**
|
|
5624
5630
|
* Host decorator and metadata.
|
|
5625
5631
|
*
|
|
5626
|
-
|
|
5632
|
+
* @Annotation
|
|
5627
5633
|
* @publicApi
|
|
5628
5634
|
*/
|
|
5629
5635
|
const Host =
|
|
@@ -5986,7 +5992,7 @@ function isPropertyValid(element, propName, tagName, schemas) {
|
|
|
5986
5992
|
if (schemas === null)
|
|
5987
5993
|
return true;
|
|
5988
5994
|
// The property is considered valid if the element matches the schema, it exists on the element,
|
|
5989
|
-
// or it is synthetic
|
|
5995
|
+
// or it is synthetic.
|
|
5990
5996
|
if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
|
|
5991
5997
|
return true;
|
|
5992
5998
|
}
|
|
@@ -6128,6 +6134,59 @@ function matchingSchemas(schemas, tagName) {
|
|
|
6128
6134
|
return false;
|
|
6129
6135
|
}
|
|
6130
6136
|
|
|
6137
|
+
/**
|
|
6138
|
+
* The name of an attribute that can be added to the hydration boundary node
|
|
6139
|
+
* (component host node) to disable hydration for the content within that boundary.
|
|
6140
|
+
*/
|
|
6141
|
+
const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
|
|
6142
|
+
/**
|
|
6143
|
+
* Helper function to check if a given node has the 'ngSkipHydration' attribute
|
|
6144
|
+
*/
|
|
6145
|
+
function hasNgSkipHydrationAttr(tNode) {
|
|
6146
|
+
const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
|
|
6147
|
+
const attrs = tNode.mergedAttrs;
|
|
6148
|
+
if (attrs === null)
|
|
6149
|
+
return false;
|
|
6150
|
+
// only ever look at the attribute name and skip the values
|
|
6151
|
+
for (let i = 0; i < attrs.length; i += 2) {
|
|
6152
|
+
const value = attrs[i];
|
|
6153
|
+
// This is a marker, which means that the static attributes section is over,
|
|
6154
|
+
// so we can exit early.
|
|
6155
|
+
if (typeof value === 'number')
|
|
6156
|
+
return false;
|
|
6157
|
+
if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {
|
|
6158
|
+
return true;
|
|
6159
|
+
}
|
|
6160
|
+
}
|
|
6161
|
+
return false;
|
|
6162
|
+
}
|
|
6163
|
+
/**
|
|
6164
|
+
* Checks whether a TNode has a flag to indicate that it's a part of
|
|
6165
|
+
* a skip hydration block.
|
|
6166
|
+
*/
|
|
6167
|
+
function hasInSkipHydrationBlockFlag(tNode) {
|
|
6168
|
+
return (tNode.flags & 128 /* TNodeFlags.inSkipHydrationBlock */) === 128 /* TNodeFlags.inSkipHydrationBlock */;
|
|
6169
|
+
}
|
|
6170
|
+
/**
|
|
6171
|
+
* Helper function that determines if a given node is within a skip hydration block
|
|
6172
|
+
* by navigating up the TNode tree to see if any parent nodes have skip hydration
|
|
6173
|
+
* attribute.
|
|
6174
|
+
*
|
|
6175
|
+
* TODO(akushnir): this function should contain the logic of `hasInSkipHydrationBlockFlag`,
|
|
6176
|
+
* there is no need to traverse parent nodes when we have a TNode flag (which would also
|
|
6177
|
+
* make this lookup O(1)).
|
|
6178
|
+
*/
|
|
6179
|
+
function isInSkipHydrationBlock(tNode) {
|
|
6180
|
+
let currentTNode = tNode.parent;
|
|
6181
|
+
while (currentTNode) {
|
|
6182
|
+
if (hasNgSkipHydrationAttr(currentTNode)) {
|
|
6183
|
+
return true;
|
|
6184
|
+
}
|
|
6185
|
+
currentTNode = currentTNode.parent;
|
|
6186
|
+
}
|
|
6187
|
+
return false;
|
|
6188
|
+
}
|
|
6189
|
+
|
|
6131
6190
|
/**
|
|
6132
6191
|
* Flags for renderer-specific style modifiers.
|
|
6133
6192
|
* @publicApi
|
|
@@ -7427,6 +7486,11 @@ function applyProjectionRecursive(renderer, action, lView, tProjectionNode, pare
|
|
|
7427
7486
|
else {
|
|
7428
7487
|
let nodeToProject = nodeToProjectOrRNodes;
|
|
7429
7488
|
const projectedComponentLView = componentLView[PARENT];
|
|
7489
|
+
// If a parent <ng-content> is located within a skip hydration block,
|
|
7490
|
+
// annotate an actual node that is being projected with the same flag too.
|
|
7491
|
+
if (hasInSkipHydrationBlockFlag(tProjectionNode)) {
|
|
7492
|
+
nodeToProject.flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;
|
|
7493
|
+
}
|
|
7430
7494
|
applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);
|
|
7431
7495
|
}
|
|
7432
7496
|
}
|
|
@@ -7727,7 +7791,7 @@ function ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {
|
|
|
7727
7791
|
* When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
|
|
7728
7792
|
* tell ivy what the global `document` is.
|
|
7729
7793
|
*
|
|
7730
|
-
* Angular does this for us in each of the standard platforms (`Browser
|
|
7794
|
+
* Angular does this for us in each of the standard platforms (`Browser` and `Server`)
|
|
7731
7795
|
* by calling `setDocument()` when providing the `DOCUMENT` token.
|
|
7732
7796
|
*/
|
|
7733
7797
|
let DOCUMENT = undefined;
|
|
@@ -7754,12 +7818,13 @@ function getDocument() {
|
|
|
7754
7818
|
else if (typeof document !== 'undefined') {
|
|
7755
7819
|
return document;
|
|
7756
7820
|
}
|
|
7821
|
+
throw new RuntimeError(210 /* RuntimeErrorCode.MISSING_DOCUMENT */, (typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
7822
|
+
`The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);
|
|
7757
7823
|
// No "document" can be found. This should only happen if we are running ivy outside Angular and
|
|
7758
7824
|
// the current platform is not a browser. Since this is not a supported scenario at the moment
|
|
7759
7825
|
// this should not happen in Angular apps.
|
|
7760
7826
|
// Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
|
|
7761
|
-
// public API.
|
|
7762
|
-
return undefined;
|
|
7827
|
+
// public API.
|
|
7763
7828
|
}
|
|
7764
7829
|
|
|
7765
7830
|
/**
|
|
@@ -9465,7 +9530,9 @@ function makeStateKey(key) {
|
|
|
9465
9530
|
}
|
|
9466
9531
|
function initTransferState() {
|
|
9467
9532
|
const transferState = new TransferState();
|
|
9468
|
-
|
|
9533
|
+
if (inject(PLATFORM_ID) === 'browser') {
|
|
9534
|
+
transferState.store = retrieveTransferredState(getDocument(), inject(APP_ID));
|
|
9535
|
+
}
|
|
9469
9536
|
return transferState;
|
|
9470
9537
|
}
|
|
9471
9538
|
/**
|
|
@@ -9554,17 +9621,16 @@ function retrieveTransferredState(doc, appId) {
|
|
|
9554
9621
|
// Locate the script tag with the JSON data transferred from the server.
|
|
9555
9622
|
// The id of the script tag is set to the Angular appId + 'state'.
|
|
9556
9623
|
const script = doc.getElementById(appId + '-state');
|
|
9557
|
-
|
|
9558
|
-
if (script && script.textContent) {
|
|
9624
|
+
if (script?.textContent) {
|
|
9559
9625
|
try {
|
|
9560
9626
|
// Avoid using any here as it triggers lint errors in google3 (any is not allowed).
|
|
9561
|
-
|
|
9627
|
+
return JSON.parse(unescapeTransferStateContent(script.textContent));
|
|
9562
9628
|
}
|
|
9563
9629
|
catch (e) {
|
|
9564
9630
|
console.warn('Exception while restoring TransferState for app ' + appId, e);
|
|
9565
9631
|
}
|
|
9566
9632
|
}
|
|
9567
|
-
return
|
|
9633
|
+
return {};
|
|
9568
9634
|
}
|
|
9569
9635
|
|
|
9570
9636
|
/** Encodes that the node lookup should start from the host node of this component. */
|
|
@@ -9683,6 +9749,12 @@ function getComponentLViewForHydration(viewRef) {
|
|
|
9683
9749
|
if (isRootView(lView)) {
|
|
9684
9750
|
lView = lView[HEADER_OFFSET];
|
|
9685
9751
|
}
|
|
9752
|
+
// If a `ViewContainerRef` was injected in a component class, this resulted
|
|
9753
|
+
// in an LContainer creation at that location. In this case, the component
|
|
9754
|
+
// LView is in the LContainer's `HOST` slot.
|
|
9755
|
+
if (isLContainer(lView)) {
|
|
9756
|
+
lView = lView[HOST];
|
|
9757
|
+
}
|
|
9686
9758
|
return lView;
|
|
9687
9759
|
}
|
|
9688
9760
|
function getTextNodeContent(node) {
|
|
@@ -9978,7 +10050,7 @@ class Version {
|
|
|
9978
10050
|
/**
|
|
9979
10051
|
* @publicApi
|
|
9980
10052
|
*/
|
|
9981
|
-
const VERSION = new Version('16.0.0');
|
|
10053
|
+
const VERSION = new Version('16.1.0-next.0');
|
|
9982
10054
|
|
|
9983
10055
|
// This default value is when checking the hierarchy for a token.
|
|
9984
10056
|
//
|
|
@@ -10084,48 +10156,6 @@ class ErrorHandler {
|
|
|
10084
10156
|
}
|
|
10085
10157
|
}
|
|
10086
10158
|
|
|
10087
|
-
/**
|
|
10088
|
-
* The name of an attribute that can be added to the hydration boundary node
|
|
10089
|
-
* (component host node) to disable hydration for the content within that boundary.
|
|
10090
|
-
*/
|
|
10091
|
-
const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
|
|
10092
|
-
/**
|
|
10093
|
-
* Helper function to check if a given node has the 'ngSkipHydration' attribute
|
|
10094
|
-
*/
|
|
10095
|
-
function hasNgSkipHydrationAttr(tNode) {
|
|
10096
|
-
const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
|
|
10097
|
-
const attrs = tNode.mergedAttrs;
|
|
10098
|
-
if (attrs === null)
|
|
10099
|
-
return false;
|
|
10100
|
-
// only ever look at the attribute name and skip the values
|
|
10101
|
-
for (let i = 0; i < attrs.length; i += 2) {
|
|
10102
|
-
const value = attrs[i];
|
|
10103
|
-
// This is a marker, which means that the static attributes section is over,
|
|
10104
|
-
// so we can exit early.
|
|
10105
|
-
if (typeof value === 'number')
|
|
10106
|
-
return false;
|
|
10107
|
-
if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {
|
|
10108
|
-
return true;
|
|
10109
|
-
}
|
|
10110
|
-
}
|
|
10111
|
-
return false;
|
|
10112
|
-
}
|
|
10113
|
-
/**
|
|
10114
|
-
* Helper function that determines if a given node is within a skip hydration block
|
|
10115
|
-
* by navigating up the TNode tree to see if any parent nodes have skip hydration
|
|
10116
|
-
* attribute.
|
|
10117
|
-
*/
|
|
10118
|
-
function isInSkipHydrationBlock(tNode) {
|
|
10119
|
-
let currentTNode = tNode.parent;
|
|
10120
|
-
while (currentTNode) {
|
|
10121
|
-
if (hasNgSkipHydrationAttr(currentTNode)) {
|
|
10122
|
-
return true;
|
|
10123
|
-
}
|
|
10124
|
-
currentTNode = currentTNode.parent;
|
|
10125
|
-
}
|
|
10126
|
-
return false;
|
|
10127
|
-
}
|
|
10128
|
-
|
|
10129
10159
|
/**
|
|
10130
10160
|
* Internal token that specifies whether DOM reuse logic
|
|
10131
10161
|
* during hydration is enabled.
|
|
@@ -10563,6 +10593,7 @@ function getInjectableMetadata(type, srcMeta) {
|
|
|
10563
10593
|
/**
|
|
10564
10594
|
* Injectable decorator and metadata.
|
|
10565
10595
|
*
|
|
10596
|
+
* @Annotation
|
|
10566
10597
|
* @publicApi
|
|
10567
10598
|
*/
|
|
10568
10599
|
const Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));
|
|
@@ -11119,6 +11150,10 @@ function createTNode(tView, tParent, type, index, value, attrs) {
|
|
|
11119
11150
|
ngDevMode && ngDevMode.tNode++;
|
|
11120
11151
|
ngDevMode && tParent && assertTNodeForTView(tParent, tView);
|
|
11121
11152
|
let injectorIndex = tParent ? tParent.injectorIndex : -1;
|
|
11153
|
+
let flags = 0;
|
|
11154
|
+
if (isInSkipHydrationBlock$1()) {
|
|
11155
|
+
flags |= 128 /* TNodeFlags.inSkipHydrationBlock */;
|
|
11156
|
+
}
|
|
11122
11157
|
const tNode = {
|
|
11123
11158
|
type,
|
|
11124
11159
|
index,
|
|
@@ -11129,7 +11164,7 @@ function createTNode(tView, tParent, type, index, value, attrs) {
|
|
|
11129
11164
|
directiveStylingLast: -1,
|
|
11130
11165
|
componentOffset: -1,
|
|
11131
11166
|
propertyBindings: null,
|
|
11132
|
-
flags
|
|
11167
|
+
flags,
|
|
11133
11168
|
providerIndexes: 0,
|
|
11134
11169
|
value: value,
|
|
11135
11170
|
attrs: attrs,
|
|
@@ -11681,7 +11716,14 @@ function addComponentLogic(lView, hostTNode, def) {
|
|
|
11681
11716
|
// Only component views should be added to the view tree directly. Embedded views are
|
|
11682
11717
|
// accessed through their containers because they may be removed / re-added later.
|
|
11683
11718
|
const rendererFactory = lView[ENVIRONMENT].rendererFactory;
|
|
11684
|
-
|
|
11719
|
+
let lViewFlags = 16 /* LViewFlags.CheckAlways */;
|
|
11720
|
+
if (def.signals) {
|
|
11721
|
+
lViewFlags = 4096 /* LViewFlags.SignalView */;
|
|
11722
|
+
}
|
|
11723
|
+
else if (def.onPush) {
|
|
11724
|
+
lViewFlags = 64 /* LViewFlags.Dirty */;
|
|
11725
|
+
}
|
|
11726
|
+
const componentView = addToViewTree(lView, createLView(lView, tView, null, lViewFlags, native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));
|
|
11685
11727
|
// Component view will always be created before any injected LContainers,
|
|
11686
11728
|
// so this is a regular element, wrap it with the component view
|
|
11687
11729
|
lView[hostTNode.index] = componentView;
|
|
@@ -12391,7 +12433,7 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
12391
12433
|
// insertion points. This is needed to avoid the situation where the template is defined in this
|
|
12392
12434
|
// `LView` but its declaration appears after the insertion component.
|
|
12393
12435
|
markTransplantedViewsForRefresh(lView);
|
|
12394
|
-
|
|
12436
|
+
detectChangesInEmbeddedViews(lView, 2 /* ChangeDetectionMode.BugToForceRefreshAndIgnoreViewFlags */);
|
|
12395
12437
|
// Content query results must be refreshed before content hooks are called.
|
|
12396
12438
|
if (tView.contentQueries !== null) {
|
|
12397
12439
|
refreshContentQueries(tView, lView);
|
|
@@ -12417,7 +12459,7 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
12417
12459
|
// Refresh child component views.
|
|
12418
12460
|
const components = tView.components;
|
|
12419
12461
|
if (components !== null) {
|
|
12420
|
-
|
|
12462
|
+
detectChangesInChildComponents(lView, components, 0 /* ChangeDetectionMode.Global */);
|
|
12421
12463
|
}
|
|
12422
12464
|
// View queries must execute after refreshing child components because a template in this view
|
|
12423
12465
|
// could be inserted in a child component. If the view query executes before child component
|
|
@@ -12471,15 +12513,11 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
12471
12513
|
* Goes over embedded views (ones created through ViewContainerRef APIs) and refreshes
|
|
12472
12514
|
* them by executing an associated template function.
|
|
12473
12515
|
*/
|
|
12474
|
-
function
|
|
12516
|
+
function detectChangesInEmbeddedViews(lView, mode) {
|
|
12475
12517
|
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
|
|
12476
12518
|
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
12477
12519
|
const embeddedLView = lContainer[i];
|
|
12478
|
-
|
|
12479
|
-
ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
|
|
12480
|
-
if (viewAttachedToChangeDetector(embeddedLView)) {
|
|
12481
|
-
refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
|
|
12482
|
-
}
|
|
12520
|
+
detectChangesInView(embeddedLView, mode);
|
|
12483
12521
|
}
|
|
12484
12522
|
}
|
|
12485
12523
|
}
|
|
@@ -12503,65 +12541,53 @@ function markTransplantedViewsForRefresh(lView) {
|
|
|
12503
12541
|
}
|
|
12504
12542
|
}
|
|
12505
12543
|
/**
|
|
12506
|
-
*
|
|
12544
|
+
* Detects changes in a component by entering the component view and processing its bindings,
|
|
12545
|
+
* queries, etc. if it is CheckAlways, OnPush and Dirty, etc.
|
|
12507
12546
|
*
|
|
12508
12547
|
* @param componentHostIdx Element index in LView[] (adjusted for HEADER_OFFSET)
|
|
12509
12548
|
*/
|
|
12510
|
-
function
|
|
12549
|
+
function detectChangesInComponent(hostLView, componentHostIdx, mode) {
|
|
12511
12550
|
ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');
|
|
12512
12551
|
const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
|
|
12513
|
-
|
|
12514
|
-
if (viewAttachedToChangeDetector(componentView)) {
|
|
12515
|
-
const tView = componentView[TVIEW];
|
|
12516
|
-
if (componentView[FLAGS] & (16 /* LViewFlags.CheckAlways */ | 64 /* LViewFlags.Dirty */)) {
|
|
12517
|
-
refreshView(tView, componentView, tView.template, componentView[CONTEXT]);
|
|
12518
|
-
}
|
|
12519
|
-
else if (componentView[DESCENDANT_VIEWS_TO_REFRESH] > 0) {
|
|
12520
|
-
// Only attached components that are CheckAlways or OnPush and dirty should be refreshed
|
|
12521
|
-
refreshContainsDirtyView(componentView);
|
|
12522
|
-
}
|
|
12523
|
-
}
|
|
12552
|
+
detectChangesInView(componentView, mode);
|
|
12524
12553
|
}
|
|
12525
12554
|
/**
|
|
12526
|
-
*
|
|
12527
|
-
*
|
|
12555
|
+
* Visits a view as part of change detection traversal.
|
|
12556
|
+
*
|
|
12557
|
+
* - If the view is detached, no additional traversal happens.
|
|
12558
|
+
*
|
|
12559
|
+
* The view is refreshed if:
|
|
12560
|
+
* - If the view is CheckAlways or Dirty and ChangeDetectionMode is `Global`
|
|
12561
|
+
* - If the view has the `RefreshTransplantedView` flag
|
|
12562
|
+
*
|
|
12563
|
+
* The view is not refreshed, but descendants are traversed in `ChangeDetectionMode.Targeted` if the
|
|
12564
|
+
* view has a non-zero TRANSPLANTED_VIEWS_TO_REFRESH counter.
|
|
12528
12565
|
*
|
|
12529
|
-
* @param lView The lView which contains descendant transplanted views that need to be refreshed.
|
|
12530
12566
|
*/
|
|
12531
|
-
function
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
const embeddedLView = lContainer[i];
|
|
12535
|
-
if (viewAttachedToChangeDetector(embeddedLView)) {
|
|
12536
|
-
if (embeddedLView[FLAGS] & 1024 /* LViewFlags.RefreshView */) {
|
|
12537
|
-
const embeddedTView = embeddedLView[TVIEW];
|
|
12538
|
-
ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
|
|
12539
|
-
refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
|
|
12540
|
-
}
|
|
12541
|
-
else if (embeddedLView[DESCENDANT_VIEWS_TO_REFRESH] > 0) {
|
|
12542
|
-
refreshContainsDirtyView(embeddedLView);
|
|
12543
|
-
}
|
|
12544
|
-
}
|
|
12545
|
-
}
|
|
12567
|
+
function detectChangesInView(lView, mode) {
|
|
12568
|
+
if (!viewAttachedToChangeDetector(lView)) {
|
|
12569
|
+
return;
|
|
12546
12570
|
}
|
|
12547
12571
|
const tView = lView[TVIEW];
|
|
12548
|
-
|
|
12549
|
-
|
|
12550
|
-
|
|
12551
|
-
|
|
12552
|
-
|
|
12553
|
-
|
|
12554
|
-
|
|
12555
|
-
|
|
12556
|
-
|
|
12557
|
-
|
|
12572
|
+
if ((lView[FLAGS] & (16 /* LViewFlags.CheckAlways */ | 64 /* LViewFlags.Dirty */) &&
|
|
12573
|
+
mode === 0 /* ChangeDetectionMode.Global */) ||
|
|
12574
|
+
lView[FLAGS] & 1024 /* LViewFlags.RefreshView */ ||
|
|
12575
|
+
mode === 2 /* ChangeDetectionMode.BugToForceRefreshAndIgnoreViewFlags */) {
|
|
12576
|
+
refreshView(tView, lView, tView.template, lView[CONTEXT]);
|
|
12577
|
+
}
|
|
12578
|
+
else if (lView[DESCENDANT_VIEWS_TO_REFRESH] > 0) {
|
|
12579
|
+
detectChangesInEmbeddedViews(lView, 1 /* ChangeDetectionMode.Targeted */);
|
|
12580
|
+
const tView = lView[TVIEW];
|
|
12581
|
+
const components = tView.components;
|
|
12582
|
+
if (components !== null) {
|
|
12583
|
+
detectChangesInChildComponents(lView, components, 1 /* ChangeDetectionMode.Targeted */);
|
|
12558
12584
|
}
|
|
12559
12585
|
}
|
|
12560
12586
|
}
|
|
12561
12587
|
/** Refreshes child components in the current view (update mode). */
|
|
12562
|
-
function
|
|
12588
|
+
function detectChangesInChildComponents(hostLView, components, mode) {
|
|
12563
12589
|
for (let i = 0; i < components.length; i++) {
|
|
12564
|
-
|
|
12590
|
+
detectChangesInComponent(hostLView, components[i], mode);
|
|
12565
12591
|
}
|
|
12566
12592
|
}
|
|
12567
12593
|
|
|
@@ -12961,8 +12987,12 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
12961
12987
|
const hostRNode = rootSelectorOrNode ?
|
|
12962
12988
|
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) :
|
|
12963
12989
|
createElementNode(hostRenderer, elementName, getNamespace(elementName));
|
|
12964
|
-
|
|
12990
|
+
// Signal components use the granular "RefreshView" for change detection
|
|
12991
|
+
const signalFlags = (4096 /* LViewFlags.SignalView */ | 512 /* LViewFlags.IsRoot */);
|
|
12992
|
+
// Non-signal components use the traditional "CheckAlways or OnPush/Dirty" change detection
|
|
12993
|
+
const nonSignalFlags = this.componentDef.onPush ? 64 /* LViewFlags.Dirty */ | 512 /* LViewFlags.IsRoot */ :
|
|
12965
12994
|
16 /* LViewFlags.CheckAlways */ | 512 /* LViewFlags.IsRoot */;
|
|
12995
|
+
const rootFlags = this.componentDef.signals ? signalFlags : nonSignalFlags;
|
|
12966
12996
|
// Create the root view. Uses empty TView and ContentTemplate.
|
|
12967
12997
|
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null, null);
|
|
12968
12998
|
const rootLView = createLView(null, rootTView, null, rootFlags, null, null, environment, hostRenderer, rootViewInjector, null, null);
|
|
@@ -13105,7 +13135,14 @@ function createRootComponentView(tNode, hostRNode, rootComponentDef, rootDirecti
|
|
|
13105
13135
|
hydrationInfo = retrieveHydrationInfo(hostRNode, rootView[INJECTOR$1]);
|
|
13106
13136
|
}
|
|
13107
13137
|
const viewRenderer = environment.rendererFactory.createRenderer(hostRNode, rootComponentDef);
|
|
13108
|
-
|
|
13138
|
+
let lViewFlags = 16 /* LViewFlags.CheckAlways */;
|
|
13139
|
+
if (rootComponentDef.signals) {
|
|
13140
|
+
lViewFlags = 4096 /* LViewFlags.SignalView */;
|
|
13141
|
+
}
|
|
13142
|
+
else if (rootComponentDef.onPush) {
|
|
13143
|
+
lViewFlags = 64 /* LViewFlags.Dirty */;
|
|
13144
|
+
}
|
|
13145
|
+
const componentView = createLView(rootView, getOrCreateComponentTView(rootComponentDef), null, lViewFlags, rootView[tNode.index], tNode, environment, viewRenderer, null, null, hydrationInfo);
|
|
13109
13146
|
if (tView.firstCreatePass) {
|
|
13110
13147
|
markAsComponentHost(tView, tNode, rootDirectives.length - 1);
|
|
13111
13148
|
}
|
|
@@ -22842,8 +22879,11 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
|
|
|
22842
22879
|
* @internal
|
|
22843
22880
|
*/
|
|
22844
22881
|
createEmbeddedViewImpl(context, injector, hydrationInfo) {
|
|
22882
|
+
// Embedded views follow the change detection strategy of the view they're declared in.
|
|
22883
|
+
const isSignalView = this._declarationLView[FLAGS] & 4096 /* LViewFlags.SignalView */;
|
|
22884
|
+
const viewFlags = isSignalView ? 4096 /* LViewFlags.SignalView */ : 16 /* LViewFlags.CheckAlways */;
|
|
22845
22885
|
const embeddedTView = this._declarationTContainer.tView;
|
|
22846
|
-
const embeddedLView = createLView(this._declarationLView, embeddedTView, context,
|
|
22886
|
+
const embeddedLView = createLView(this._declarationLView, embeddedTView, context, viewFlags, null, embeddedTView.declTNode, null, null, null, injector || null, hydrationInfo || null);
|
|
22847
22887
|
const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
|
|
22848
22888
|
ngDevMode && assertLContainer(declarationLContainer);
|
|
22849
22889
|
embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
|
|
@@ -23117,7 +23157,11 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
23117
23157
|
}
|
|
23118
23158
|
const hydrationInfo = findMatchingDehydratedView(this._lContainer, templateRef.ssrId);
|
|
23119
23159
|
const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, hydrationInfo);
|
|
23120
|
-
|
|
23160
|
+
// If there is a matching dehydrated view, but the host TNode is located in the skip
|
|
23161
|
+
// hydration block, this means that the content was detached (as a part of the skip
|
|
23162
|
+
// hydration logic) and it needs to be appended into the DOM.
|
|
23163
|
+
const skipDomInsertion = !!hydrationInfo && !hasInSkipHydrationBlockFlag(this._hostTNode);
|
|
23164
|
+
this.insertImpl(viewRef, index, skipDomInsertion);
|
|
23121
23165
|
return viewRef;
|
|
23122
23166
|
}
|
|
23123
23167
|
createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {
|
|
@@ -23191,7 +23235,11 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
23191
23235
|
const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null);
|
|
23192
23236
|
const rNode = dehydratedView?.firstChild ?? null;
|
|
23193
23237
|
const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector);
|
|
23194
|
-
|
|
23238
|
+
// If there is a matching dehydrated view, but the host TNode is located in the skip
|
|
23239
|
+
// hydration block, this means that the content was detached (as a part of the skip
|
|
23240
|
+
// hydration logic) and it needs to be appended into the DOM.
|
|
23241
|
+
const skipDomInsertion = !!dehydratedView && !hasInSkipHydrationBlockFlag(this._hostTNode);
|
|
23242
|
+
this.insertImpl(componentRef.hostView, index, skipDomInsertion);
|
|
23195
23243
|
return componentRef;
|
|
23196
23244
|
}
|
|
23197
23245
|
insert(viewRef, index) {
|
|
@@ -23365,8 +23413,10 @@ function locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) {
|
|
|
23365
23413
|
return;
|
|
23366
23414
|
const hydrationInfo = hostLView[HYDRATION];
|
|
23367
23415
|
const noOffsetIndex = hostTNode.index - HEADER_OFFSET;
|
|
23368
|
-
|
|
23369
|
-
|
|
23416
|
+
// TODO(akushnir): this should really be a single condition, refactor the code
|
|
23417
|
+
// to use `hasInSkipHydrationBlockFlag` logic inside `isInSkipHydrationBlock`.
|
|
23418
|
+
const skipHydration = isInSkipHydrationBlock(hostTNode) || hasInSkipHydrationBlockFlag(hostTNode);
|
|
23419
|
+
const isNodeCreationMode = !hydrationInfo || skipHydration || isDisconnectedNode$1(hydrationInfo, noOffsetIndex);
|
|
23370
23420
|
// Regular creation mode.
|
|
23371
23421
|
if (isNodeCreationMode) {
|
|
23372
23422
|
return createAnchorNode(lContainer, hostLView, hostTNode, slotValue);
|
|
@@ -24910,6 +24960,7 @@ function directiveMetadata(type, metadata) {
|
|
|
24910
24960
|
providers: metadata.providers || null,
|
|
24911
24961
|
viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
|
|
24912
24962
|
isStandalone: !!metadata.standalone,
|
|
24963
|
+
isSignal: !!metadata.signals,
|
|
24913
24964
|
hostDirectives: metadata.hostDirectives?.map(directive => typeof directive === 'function' ? { directive } : directive) ||
|
|
24914
24965
|
null
|
|
24915
24966
|
};
|
|
@@ -25062,17 +25113,17 @@ const Directive = makeDecorator('Directive', (dir = {}) => dir, undefined, undef
|
|
|
25062
25113
|
/**
|
|
25063
25114
|
* Component decorator and metadata.
|
|
25064
25115
|
*
|
|
25065
|
-
|
|
25116
|
+
* @Annotation
|
|
25066
25117
|
* @publicApi
|
|
25067
25118
|
*/
|
|
25068
25119
|
const Component = makeDecorator('Component', (c = {}) => ({ changeDetection: ChangeDetectionStrategy.Default, ...c }), Directive, undefined, (type, meta) => compileComponent(type, meta));
|
|
25069
25120
|
/**
|
|
25070
|
-
|
|
25121
|
+
* @Annotation
|
|
25071
25122
|
* @publicApi
|
|
25072
25123
|
*/
|
|
25073
25124
|
const Pipe = makeDecorator('Pipe', (p) => ({ pure: true, ...p }), undefined, undefined, (type, meta) => compilePipe(type, meta));
|
|
25074
25125
|
/**
|
|
25075
|
-
|
|
25126
|
+
* @Annotation
|
|
25076
25127
|
* @publicApi
|
|
25077
25128
|
*/
|
|
25078
25129
|
const Input = makePropDecorator('Input', (arg) => {
|
|
@@ -25082,12 +25133,12 @@ const Input = makePropDecorator('Input', (arg) => {
|
|
|
25082
25133
|
return typeof arg === 'string' ? { alias: arg } : arg;
|
|
25083
25134
|
});
|
|
25084
25135
|
/**
|
|
25085
|
-
|
|
25136
|
+
* @Annotation
|
|
25086
25137
|
* @publicApi
|
|
25087
25138
|
*/
|
|
25088
25139
|
const Output = makePropDecorator('Output', (alias) => ({ alias }));
|
|
25089
25140
|
/**
|
|
25090
|
-
|
|
25141
|
+
* @Annotation
|
|
25091
25142
|
* @publicApi
|
|
25092
25143
|
*/
|
|
25093
25144
|
const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ hostPropertyName }));
|
|
@@ -25153,12 +25204,13 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
|
|
|
25153
25204
|
* The global target names that can be used to prefix an event name are
|
|
25154
25205
|
* `document:`, `window:` and `body:`.
|
|
25155
25206
|
*
|
|
25156
|
-
|
|
25207
|
+
* @Annotation
|
|
25157
25208
|
* @publicApi
|
|
25158
25209
|
*/
|
|
25159
25210
|
const HostListener = makePropDecorator('HostListener', (eventName, args) => ({ eventName, args }));
|
|
25160
25211
|
|
|
25161
25212
|
/**
|
|
25213
|
+
* @Annotation
|
|
25162
25214
|
*/
|
|
25163
25215
|
const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, undefined,
|
|
25164
25216
|
/**
|
|
@@ -26645,64 +26697,69 @@ function runPlatformInitializers(injector) {
|
|
|
26645
26697
|
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
|
26646
26698
|
*/
|
|
26647
26699
|
function internalCreateApplication(config) {
|
|
26648
|
-
|
|
26649
|
-
|
|
26650
|
-
|
|
26651
|
-
|
|
26652
|
-
|
|
26653
|
-
|
|
26654
|
-
|
|
26655
|
-
|
|
26656
|
-
|
|
26657
|
-
|
|
26658
|
-
|
|
26659
|
-
|
|
26660
|
-
|
|
26661
|
-
|
|
26662
|
-
|
|
26663
|
-
|
|
26664
|
-
|
|
26665
|
-
|
|
26666
|
-
|
|
26667
|
-
const envInjector = adapter.injector;
|
|
26668
|
-
const ngZone = envInjector.get(NgZone);
|
|
26669
|
-
return ngZone.run(() => {
|
|
26670
|
-
envInjector.resolveInjectorInitializers();
|
|
26671
|
-
const exceptionHandler = envInjector.get(ErrorHandler, null);
|
|
26672
|
-
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
|
|
26673
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
26674
|
-
}
|
|
26675
|
-
let onErrorSubscription;
|
|
26676
|
-
ngZone.runOutsideAngular(() => {
|
|
26677
|
-
onErrorSubscription = ngZone.onError.subscribe({
|
|
26678
|
-
next: (error) => {
|
|
26679
|
-
exceptionHandler.handleError(error);
|
|
26680
|
-
}
|
|
26681
|
-
});
|
|
26682
|
-
});
|
|
26683
|
-
// If the whole platform is destroyed, invoke the `destroy` method
|
|
26684
|
-
// for all bootstrapped applications as well.
|
|
26685
|
-
const destroyListener = () => envInjector.destroy();
|
|
26686
|
-
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
|
|
26687
|
-
onPlatformDestroyListeners.add(destroyListener);
|
|
26688
|
-
envInjector.onDestroy(() => {
|
|
26689
|
-
onErrorSubscription.unsubscribe();
|
|
26690
|
-
onPlatformDestroyListeners.delete(destroyListener);
|
|
26700
|
+
try {
|
|
26701
|
+
const { rootComponent, appProviders, platformProviders } = config;
|
|
26702
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
|
|
26703
|
+
assertStandaloneComponentType(rootComponent);
|
|
26704
|
+
}
|
|
26705
|
+
const platformInjector = createOrReusePlatformInjector(platformProviders);
|
|
26706
|
+
// Create root application injector based on a set of providers configured at the platform
|
|
26707
|
+
// bootstrap level as well as providers passed to the bootstrap call by a user.
|
|
26708
|
+
const allAppProviders = [
|
|
26709
|
+
provideZoneChangeDetection(),
|
|
26710
|
+
...(appProviders || []),
|
|
26711
|
+
];
|
|
26712
|
+
const adapter = new EnvironmentNgModuleRefAdapter({
|
|
26713
|
+
providers: allAppProviders,
|
|
26714
|
+
parent: platformInjector,
|
|
26715
|
+
debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
|
|
26716
|
+
// We skip environment initializers because we need to run them inside the NgZone, which
|
|
26717
|
+
// happens after we get the NgZone instance from the Injector.
|
|
26718
|
+
runEnvironmentInitializers: false,
|
|
26691
26719
|
});
|
|
26692
|
-
|
|
26693
|
-
|
|
26694
|
-
|
|
26695
|
-
|
|
26696
|
-
|
|
26697
|
-
|
|
26698
|
-
|
|
26699
|
-
|
|
26700
|
-
|
|
26701
|
-
|
|
26702
|
-
|
|
26720
|
+
const envInjector = adapter.injector;
|
|
26721
|
+
const ngZone = envInjector.get(NgZone);
|
|
26722
|
+
return ngZone.run(() => {
|
|
26723
|
+
envInjector.resolveInjectorInitializers();
|
|
26724
|
+
const exceptionHandler = envInjector.get(ErrorHandler, null);
|
|
26725
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
|
|
26726
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
26727
|
+
}
|
|
26728
|
+
let onErrorSubscription;
|
|
26729
|
+
ngZone.runOutsideAngular(() => {
|
|
26730
|
+
onErrorSubscription = ngZone.onError.subscribe({
|
|
26731
|
+
next: (error) => {
|
|
26732
|
+
exceptionHandler.handleError(error);
|
|
26733
|
+
}
|
|
26734
|
+
});
|
|
26735
|
+
});
|
|
26736
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
26737
|
+
// for all bootstrapped applications as well.
|
|
26738
|
+
const destroyListener = () => envInjector.destroy();
|
|
26739
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
|
|
26740
|
+
onPlatformDestroyListeners.add(destroyListener);
|
|
26741
|
+
envInjector.onDestroy(() => {
|
|
26742
|
+
onErrorSubscription.unsubscribe();
|
|
26743
|
+
onPlatformDestroyListeners.delete(destroyListener);
|
|
26744
|
+
});
|
|
26745
|
+
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
26746
|
+
const initStatus = envInjector.get(ApplicationInitStatus);
|
|
26747
|
+
initStatus.runInitializers();
|
|
26748
|
+
return initStatus.donePromise.then(() => {
|
|
26749
|
+
const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
26750
|
+
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
26751
|
+
const appRef = envInjector.get(ApplicationRef);
|
|
26752
|
+
if (rootComponent !== undefined) {
|
|
26753
|
+
appRef.bootstrap(rootComponent);
|
|
26754
|
+
}
|
|
26755
|
+
return appRef;
|
|
26756
|
+
});
|
|
26703
26757
|
});
|
|
26704
26758
|
});
|
|
26705
|
-
}
|
|
26759
|
+
}
|
|
26760
|
+
catch (e) {
|
|
26761
|
+
return Promise.reject(e);
|
|
26762
|
+
}
|
|
26706
26763
|
}
|
|
26707
26764
|
/**
|
|
26708
26765
|
* Creates a factory for a platform. Can be used to provide or override `Providers` specific to
|
|
@@ -29813,7 +29870,7 @@ function printHydrationStats(injector) {
|
|
|
29813
29870
|
`and ${ngDevMode.hydratedNodes} node(s), ` +
|
|
29814
29871
|
`${ngDevMode.componentsSkippedHydration} component(s) were skipped. ` +
|
|
29815
29872
|
`Note: this feature is in Developer Preview mode. ` +
|
|
29816
|
-
`Learn more at https://
|
|
29873
|
+
`Learn more at https://angular.io/guide/hydration.`;
|
|
29817
29874
|
// tslint:disable-next-line:no-console
|
|
29818
29875
|
console.log(message);
|
|
29819
29876
|
}
|
|
@@ -30146,6 +30203,9 @@ function reflectComponentType(component) {
|
|
|
30146
30203
|
get isStandalone() {
|
|
30147
30204
|
return componentDef.standalone;
|
|
30148
30205
|
},
|
|
30206
|
+
get isSignal() {
|
|
30207
|
+
return componentDef.signals;
|
|
30208
|
+
},
|
|
30149
30209
|
};
|
|
30150
30210
|
}
|
|
30151
30211
|
|