@angular/core 14.0.0-next.15 → 14.0.0-next.16
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 +22 -13
- package/esm2020/src/change_detection/change_detector_ref.mjs +3 -3
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +2 -2
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +2 -2
- package/esm2020/src/change_detection/differs/iterable_differs.mjs +2 -2
- package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -2
- package/esm2020/src/compiler/compiler_facade.mjs +2 -2
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +5 -5
- package/esm2020/src/di/create_injector.mjs +3 -4
- package/esm2020/src/di/index.mjs +2 -2
- package/esm2020/src/di/initializer_token.mjs +4 -4
- package/esm2020/src/di/injector.mjs +2 -2
- package/esm2020/src/di/injector_compatibility.mjs +4 -4
- package/esm2020/src/di/injector_token.mjs +2 -2
- package/esm2020/src/di/interface/provider.mjs +1 -1
- package/esm2020/src/di/jit/injectable.mjs +3 -3
- package/esm2020/src/di/metadata.mjs +6 -6
- package/esm2020/src/di/provider_collection.mjs +20 -5
- package/esm2020/src/di/r3_injector.mjs +27 -10
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/linker/template_ref.mjs +3 -3
- package/esm2020/src/linker/view_container_ref.mjs +4 -4
- package/esm2020/src/metadata/directives.mjs +1 -1
- package/esm2020/src/render3/assert.mjs +3 -3
- package/esm2020/src/render3/collect_native_nodes.mjs +5 -5
- package/esm2020/src/render3/component.mjs +8 -8
- package/esm2020/src/render3/component_ref.mjs +4 -4
- package/esm2020/src/render3/context_discovery.mjs +4 -4
- package/esm2020/src/render3/di.mjs +21 -21
- package/esm2020/src/render3/di_setup.mjs +5 -5
- package/esm2020/src/render3/errors.mjs +5 -5
- package/esm2020/src/render3/errors_di.mjs +10 -7
- package/esm2020/src/render3/features/inherit_definition_feature.mjs +2 -2
- package/esm2020/src/render3/features/standalone_feature.mjs +5 -4
- package/esm2020/src/render3/hooks.mjs +19 -19
- package/esm2020/src/render3/i18n/i18n_apply.mjs +16 -16
- package/esm2020/src/render3/i18n/i18n_debug.mjs +9 -9
- package/esm2020/src/render3/i18n/i18n_insert_before_index.mjs +2 -2
- package/esm2020/src/render3/i18n/i18n_parse.mjs +14 -14
- package/esm2020/src/render3/i18n/i18n_util.mjs +7 -7
- package/esm2020/src/render3/index.mjs +2 -2
- package/esm2020/src/render3/instructions/advance.mjs +3 -3
- package/esm2020/src/render3/instructions/all.mjs +2 -1
- package/esm2020/src/render3/instructions/change_detection.mjs +2 -2
- package/esm2020/src/render3/instructions/element.mjs +26 -6
- package/esm2020/src/render3/instructions/element_container.mjs +3 -3
- package/esm2020/src/render3/instructions/i18n.mjs +2 -2
- package/esm2020/src/render3/instructions/listener.mjs +7 -7
- package/esm2020/src/render3/instructions/lview_debug.mjs +26 -26
- package/esm2020/src/render3/instructions/projection.mjs +3 -3
- package/esm2020/src/render3/instructions/shared.mjs +90 -70
- package/esm2020/src/render3/instructions/styling.mjs +5 -5
- package/esm2020/src/render3/instructions/template.mjs +3 -3
- package/esm2020/src/render3/instructions/text.mjs +2 -2
- package/esm2020/src/render3/interfaces/node.mjs +10 -10
- package/esm2020/src/render3/interfaces/styling.mjs +18 -18
- package/esm2020/src/render3/interfaces/type_checks.mjs +5 -5
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/jit/directive.mjs +43 -6
- package/esm2020/src/render3/jit/module.mjs +22 -12
- package/esm2020/src/render3/jit/partial.mjs +8 -8
- package/esm2020/src/render3/jit/pipe.mjs +3 -3
- package/esm2020/src/render3/jit/util.mjs +15 -0
- package/esm2020/src/render3/ng_module_ref.mjs +1 -1
- package/esm2020/src/render3/node_assert.mjs +8 -8
- package/esm2020/src/render3/node_manipulation.mjs +40 -40
- package/esm2020/src/render3/node_manipulation_i18n.mjs +3 -3
- package/esm2020/src/render3/node_selector_matcher.mjs +28 -28
- package/esm2020/src/render3/pipe.mjs +2 -2
- package/esm2020/src/render3/query.mjs +12 -12
- package/esm2020/src/render3/state.mjs +5 -5
- package/esm2020/src/render3/styling/class_differ.mjs +3 -3
- package/esm2020/src/render3/styling/static_styling.mjs +3 -3
- package/esm2020/src/render3/styling/styling_parser.mjs +17 -17
- package/esm2020/src/render3/util/attrs_utils.mjs +10 -10
- package/esm2020/src/render3/util/discovery_utils.mjs +4 -4
- package/esm2020/src/render3/util/injector_utils.mjs +4 -4
- package/esm2020/src/render3/util/view_traversal_utils.mjs +2 -2
- package/esm2020/src/render3/util/view_utils.mjs +3 -3
- package/esm2020/src/render3/view_ref.mjs +6 -6
- package/esm2020/src/sanitization/bypass.mjs +7 -7
- package/esm2020/src/sanitization/sanitization.mjs +10 -10
- package/esm2020/src/util/raf.mjs +1 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/r3_test_bed.mjs +34 -6
- package/esm2020/testing/src/r3_test_bed_compiler.mjs +45 -4
- package/esm2020/testing/src/resolvers.mjs +1 -1
- package/esm2020/testing/src/test_bed_common.mjs +5 -1
- package/fesm2015/core.mjs +640 -498
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +84 -8
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +640 -498
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +81 -8
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +101 -57
- package/package.json +1 -1
- package/testing/index.d.ts +29 -1
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.16
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -234,24 +234,27 @@ function stringifyForError(value) {
|
|
|
234
234
|
/** Called when directives inject each other (creating a circular dependency) */
|
|
235
235
|
function throwCyclicDependencyError(token, path) {
|
|
236
236
|
const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
|
|
237
|
-
throw new RuntimeError(-200 /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
|
|
237
|
+
throw new RuntimeError(-200 /* RuntimeErrorCode.CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
|
|
238
238
|
}
|
|
239
239
|
function throwMixedMultiProviderError() {
|
|
240
240
|
throw new Error(`Cannot mix multi providers and regular providers`);
|
|
241
241
|
}
|
|
242
242
|
function throwInvalidProviderError(ngModuleType, providers, provider) {
|
|
243
|
-
let ngModuleDetail = '';
|
|
244
243
|
if (ngModuleType && providers) {
|
|
245
244
|
const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`);
|
|
246
|
+
}
|
|
247
|
+
else if (provider.ɵproviders) {
|
|
248
|
+
throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
throw new Error('Invalid provider');
|
|
248
252
|
}
|
|
249
|
-
throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}'` + ngModuleDetail);
|
|
250
253
|
}
|
|
251
254
|
/** Throws an error when a token is not found in DI. */
|
|
252
255
|
function throwProviderNotFoundError(token, injectorName) {
|
|
253
256
|
const injectorDetails = injectorName ? ` in ${injectorName}` : '';
|
|
254
|
-
throw new RuntimeError(-201 /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
|
|
257
|
+
throw new RuntimeError(-201 /* RuntimeErrorCode.PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
|
|
255
258
|
}
|
|
256
259
|
|
|
257
260
|
/**
|
|
@@ -1253,19 +1256,19 @@ function isLContainer(value) {
|
|
|
1253
1256
|
return Array.isArray(value) && value[TYPE] === true;
|
|
1254
1257
|
}
|
|
1255
1258
|
function isContentQueryHost(tNode) {
|
|
1256
|
-
return (tNode.flags & 8 /* hasContentQuery */) !== 0;
|
|
1259
|
+
return (tNode.flags & 8 /* TNodeFlags.hasContentQuery */) !== 0;
|
|
1257
1260
|
}
|
|
1258
1261
|
function isComponentHost(tNode) {
|
|
1259
|
-
return (tNode.flags & 2 /* isComponentHost */) === 2 /* isComponentHost */;
|
|
1262
|
+
return (tNode.flags & 2 /* TNodeFlags.isComponentHost */) === 2 /* TNodeFlags.isComponentHost */;
|
|
1260
1263
|
}
|
|
1261
1264
|
function isDirectiveHost(tNode) {
|
|
1262
|
-
return (tNode.flags & 1 /* isDirectiveHost */) === 1 /* isDirectiveHost */;
|
|
1265
|
+
return (tNode.flags & 1 /* TNodeFlags.isDirectiveHost */) === 1 /* TNodeFlags.isDirectiveHost */;
|
|
1263
1266
|
}
|
|
1264
1267
|
function isComponentDef(def) {
|
|
1265
1268
|
return def.template !== null;
|
|
1266
1269
|
}
|
|
1267
1270
|
function isRootView(target) {
|
|
1268
|
-
return (target[FLAGS] & 512 /* IsRoot */) !== 0;
|
|
1271
|
+
return (target[FLAGS] & 512 /* LViewFlags.IsRoot */) !== 0;
|
|
1269
1272
|
}
|
|
1270
1273
|
|
|
1271
1274
|
/**
|
|
@@ -1379,7 +1382,7 @@ function assertParentView(lView, errMessage) {
|
|
|
1379
1382
|
*/
|
|
1380
1383
|
function assertNodeInjector(lView, injectorIndex) {
|
|
1381
1384
|
assertIndexInExpandoRange(lView, injectorIndex);
|
|
1382
|
-
assertIndexInExpandoRange(lView, injectorIndex + 8 /* PARENT */);
|
|
1385
|
+
assertIndexInExpandoRange(lView, injectorIndex + 8 /* NodeInjectorOffset.PARENT */);
|
|
1383
1386
|
assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');
|
|
1384
1387
|
assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');
|
|
1385
1388
|
assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');
|
|
@@ -1388,7 +1391,7 @@ function assertNodeInjector(lView, injectorIndex) {
|
|
|
1388
1391
|
assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');
|
|
1389
1392
|
assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');
|
|
1390
1393
|
assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');
|
|
1391
|
-
assertNumber(lView[injectorIndex + 8 /* PARENT */], 'injectorIndex should point to parent injector');
|
|
1394
|
+
assertNumber(lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */], 'injectorIndex should point to parent injector');
|
|
1392
1395
|
}
|
|
1393
1396
|
|
|
1394
1397
|
/**
|
|
@@ -1785,7 +1788,7 @@ function getComponentLViewByIndex(nodeIndex, hostView) {
|
|
|
1785
1788
|
}
|
|
1786
1789
|
/** Checks whether a given view is in creation mode */
|
|
1787
1790
|
function isCreationMode(view) {
|
|
1788
|
-
return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;
|
|
1791
|
+
return (view[FLAGS] & 4 /* LViewFlags.CreationMode */) === 4 /* LViewFlags.CreationMode */;
|
|
1789
1792
|
}
|
|
1790
1793
|
/**
|
|
1791
1794
|
* Returns a boolean for whether the view is attached to the change detection tree.
|
|
@@ -1794,7 +1797,7 @@ function isCreationMode(view) {
|
|
|
1794
1797
|
* into a container. For that, you'll want `viewAttachedToContainer` below.
|
|
1795
1798
|
*/
|
|
1796
1799
|
function viewAttachedToChangeDetector(view) {
|
|
1797
|
-
return (view[FLAGS] & 128 /* Attached */) === 128 /* Attached */;
|
|
1800
|
+
return (view[FLAGS] & 128 /* LViewFlags.Attached */) === 128 /* LViewFlags.Attached */;
|
|
1798
1801
|
}
|
|
1799
1802
|
/** Returns a boolean for whether the view is attached to a container. */
|
|
1800
1803
|
function viewAttachedToContainer(view) {
|
|
@@ -1951,7 +1954,7 @@ function ɵɵresetView(value) {
|
|
|
1951
1954
|
}
|
|
1952
1955
|
function getCurrentTNode() {
|
|
1953
1956
|
let currentTNode = getCurrentTNodePlaceholderOk();
|
|
1954
|
-
while (currentTNode !== null && currentTNode.type === 64 /* Placeholder */) {
|
|
1957
|
+
while (currentTNode !== null && currentTNode.type === 64 /* TNodeType.Placeholder */) {
|
|
1955
1958
|
currentTNode = currentTNode.parent;
|
|
1956
1959
|
}
|
|
1957
1960
|
return currentTNode;
|
|
@@ -2077,14 +2080,14 @@ function setCurrentQueryIndex(value) {
|
|
|
2077
2080
|
function getDeclarationTNode(lView) {
|
|
2078
2081
|
const tView = lView[TVIEW];
|
|
2079
2082
|
// Return the declaration parent for embedded views
|
|
2080
|
-
if (tView.type === 2 /* Embedded */) {
|
|
2083
|
+
if (tView.type === 2 /* TViewType.Embedded */) {
|
|
2081
2084
|
ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
2082
2085
|
return tView.declTNode;
|
|
2083
2086
|
}
|
|
2084
2087
|
// Components don't have `TView.declTNode` because each instance of component could be
|
|
2085
2088
|
// inserted in different location, hence `TView.declTNode` is meaningless.
|
|
2086
2089
|
// Falling back to `T_HOST` in case we cross component boundary.
|
|
2087
|
-
if (tView.type === 1 /* Component */) {
|
|
2090
|
+
if (tView.type === 1 /* TViewType.Component */) {
|
|
2088
2091
|
return lView[T_HOST];
|
|
2089
2092
|
}
|
|
2090
2093
|
// Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.
|
|
@@ -2123,7 +2126,7 @@ function enterDI(lView, tNode, flags) {
|
|
|
2123
2126
|
// In Ivy there are Comment nodes that correspond to ngIf and NgFor embedded directives
|
|
2124
2127
|
// We want to skip those and look only at Elements and ElementContainers to ensure
|
|
2125
2128
|
// we're looking at true parent nodes, and not content or other types.
|
|
2126
|
-
if (parentTNode.type & (2 /* Element */ | 8 /* ElementContainer */)) {
|
|
2129
|
+
if (parentTNode.type & (2 /* TNodeType.Element */ | 8 /* TNodeType.ElementContainer */)) {
|
|
2127
2130
|
break;
|
|
2128
2131
|
}
|
|
2129
2132
|
}
|
|
@@ -2454,7 +2457,7 @@ function registerPostOrderHooks(tView, tNode) {
|
|
|
2454
2457
|
* case, when executing select(number))
|
|
2455
2458
|
*/
|
|
2456
2459
|
function executeCheckHooks(lView, hooks, nodeIndex) {
|
|
2457
|
-
callHooks(lView, hooks, 3 /* InitPhaseCompleted */, nodeIndex);
|
|
2460
|
+
callHooks(lView, hooks, 3 /* InitPhaseState.InitPhaseCompleted */, nodeIndex);
|
|
2458
2461
|
}
|
|
2459
2462
|
/**
|
|
2460
2463
|
* Executes post-order init and check hooks (one of AfterContentInit, AfterContentChecked,
|
|
@@ -2471,18 +2474,18 @@ function executeCheckHooks(lView, hooks, nodeIndex) {
|
|
|
2471
2474
|
*/
|
|
2472
2475
|
function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {
|
|
2473
2476
|
ngDevMode &&
|
|
2474
|
-
assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');
|
|
2475
|
-
if ((lView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
2477
|
+
assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init pre-order hooks should not be called more than once');
|
|
2478
|
+
if ((lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {
|
|
2476
2479
|
callHooks(lView, hooks, initPhase, nodeIndex);
|
|
2477
2480
|
}
|
|
2478
2481
|
}
|
|
2479
2482
|
function incrementInitPhaseFlags(lView, initPhase) {
|
|
2480
2483
|
ngDevMode &&
|
|
2481
|
-
assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
2484
|
+
assertNotEqual(initPhase, 3 /* InitPhaseState.InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
2482
2485
|
let flags = lView[FLAGS];
|
|
2483
|
-
if ((flags & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
2484
|
-
flags &= 4095 /* IndexWithinInitPhaseReset */;
|
|
2485
|
-
flags += 1 /* InitPhaseStateIncrementer */;
|
|
2486
|
+
if ((flags & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {
|
|
2487
|
+
flags &= 4095 /* LViewFlags.IndexWithinInitPhaseReset */;
|
|
2488
|
+
flags += 1 /* LViewFlags.InitPhaseStateIncrementer */;
|
|
2486
2489
|
lView[FLAGS] = flags;
|
|
2487
2490
|
}
|
|
2488
2491
|
}
|
|
@@ -2504,7 +2507,7 @@ function callHooks(currentView, arr, initPhase, currentNodeIndex) {
|
|
|
2504
2507
|
ngDevMode &&
|
|
2505
2508
|
assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');
|
|
2506
2509
|
const startIndex = currentNodeIndex !== undefined ?
|
|
2507
|
-
(currentView[PREORDER_HOOK_FLAGS] & 65535 /* IndexOfTheNextPreOrderHookMaskMask */) :
|
|
2510
|
+
(currentView[PREORDER_HOOK_FLAGS] & 65535 /* PreOrderHookFlags.IndexOfTheNextPreOrderHookMaskMask */) :
|
|
2508
2511
|
0;
|
|
2509
2512
|
const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;
|
|
2510
2513
|
const max = arr.length - 1; // Stop the loop at length - 1, because we look for the hook at i + 1
|
|
@@ -2520,11 +2523,11 @@ function callHooks(currentView, arr, initPhase, currentNodeIndex) {
|
|
|
2520
2523
|
else {
|
|
2521
2524
|
const isInitHook = arr[i] < 0;
|
|
2522
2525
|
if (isInitHook)
|
|
2523
|
-
currentView[PREORDER_HOOK_FLAGS] += 65536 /* NumberOfInitHooksCalledIncrementer */;
|
|
2526
|
+
currentView[PREORDER_HOOK_FLAGS] += 65536 /* PreOrderHookFlags.NumberOfInitHooksCalledIncrementer */;
|
|
2524
2527
|
if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {
|
|
2525
2528
|
callHook(currentView, initPhase, arr, i);
|
|
2526
2529
|
currentView[PREORDER_HOOK_FLAGS] =
|
|
2527
|
-
(currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* NumberOfInitHooksCalledMask */) + i +
|
|
2530
|
+
(currentView[PREORDER_HOOK_FLAGS] & 4294901760 /* PreOrderHookFlags.NumberOfInitHooksCalledMask */) + i +
|
|
2528
2531
|
2;
|
|
2529
2532
|
}
|
|
2530
2533
|
i++;
|
|
@@ -2545,28 +2548,28 @@ function callHook(currentView, initPhase, arr, i) {
|
|
|
2545
2548
|
const directiveIndex = isInitHook ? -arr[i] : arr[i];
|
|
2546
2549
|
const directive = currentView[directiveIndex];
|
|
2547
2550
|
if (isInitHook) {
|
|
2548
|
-
const indexWithintInitPhase = currentView[FLAGS] >> 12 /* IndexWithinInitPhaseShift */;
|
|
2551
|
+
const indexWithintInitPhase = currentView[FLAGS] >> 12 /* LViewFlags.IndexWithinInitPhaseShift */;
|
|
2549
2552
|
// The init phase state must be always checked here as it may have been recursively updated.
|
|
2550
2553
|
if (indexWithintInitPhase <
|
|
2551
|
-
(currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) &&
|
|
2552
|
-
(currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
2553
|
-
currentView[FLAGS] += 4096 /* IndexWithinInitPhaseIncrementer */;
|
|
2554
|
-
profiler(4 /* LifecycleHookStart */, directive, hook);
|
|
2554
|
+
(currentView[PREORDER_HOOK_FLAGS] >> 16 /* PreOrderHookFlags.NumberOfInitHooksCalledShift */) &&
|
|
2555
|
+
(currentView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === initPhase) {
|
|
2556
|
+
currentView[FLAGS] += 4096 /* LViewFlags.IndexWithinInitPhaseIncrementer */;
|
|
2557
|
+
profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);
|
|
2555
2558
|
try {
|
|
2556
2559
|
hook.call(directive);
|
|
2557
2560
|
}
|
|
2558
2561
|
finally {
|
|
2559
|
-
profiler(5 /* LifecycleHookEnd */, directive, hook);
|
|
2562
|
+
profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);
|
|
2560
2563
|
}
|
|
2561
2564
|
}
|
|
2562
2565
|
}
|
|
2563
2566
|
else {
|
|
2564
|
-
profiler(4 /* LifecycleHookStart */, directive, hook);
|
|
2567
|
+
profiler(4 /* ProfilerEvent.LifecycleHookStart */, directive, hook);
|
|
2565
2568
|
try {
|
|
2566
2569
|
hook.call(directive);
|
|
2567
2570
|
}
|
|
2568
2571
|
finally {
|
|
2569
|
-
profiler(5 /* LifecycleHookEnd */, directive, hook);
|
|
2572
|
+
profiler(5 /* ProfilerEvent.LifecycleHookEnd */, directive, hook);
|
|
2570
2573
|
}
|
|
2571
2574
|
}
|
|
2572
2575
|
}
|
|
@@ -2708,13 +2711,13 @@ const unusedValueExportToPlacateAjd$5 = 1;
|
|
|
2708
2711
|
*/
|
|
2709
2712
|
function toTNodeTypeAsString(tNodeType) {
|
|
2710
2713
|
let text = '';
|
|
2711
|
-
(tNodeType & 1 /* Text */) && (text += '|Text');
|
|
2712
|
-
(tNodeType & 2 /* Element */) && (text += '|Element');
|
|
2713
|
-
(tNodeType & 4 /* Container */) && (text += '|Container');
|
|
2714
|
-
(tNodeType & 8 /* ElementContainer */) && (text += '|ElementContainer');
|
|
2715
|
-
(tNodeType & 16 /* Projection */) && (text += '|Projection');
|
|
2716
|
-
(tNodeType & 32 /* Icu */) && (text += '|IcuContainer');
|
|
2717
|
-
(tNodeType & 64 /* Placeholder */) && (text += '|Placeholder');
|
|
2714
|
+
(tNodeType & 1 /* TNodeType.Text */) && (text += '|Text');
|
|
2715
|
+
(tNodeType & 2 /* TNodeType.Element */) && (text += '|Element');
|
|
2716
|
+
(tNodeType & 4 /* TNodeType.Container */) && (text += '|Container');
|
|
2717
|
+
(tNodeType & 8 /* TNodeType.ElementContainer */) && (text += '|ElementContainer');
|
|
2718
|
+
(tNodeType & 16 /* TNodeType.Projection */) && (text += '|Projection');
|
|
2719
|
+
(tNodeType & 32 /* TNodeType.Icu */) && (text += '|IcuContainer');
|
|
2720
|
+
(tNodeType & 64 /* TNodeType.Placeholder */) && (text += '|Placeholder');
|
|
2718
2721
|
return text.length > 0 ? text.substring(1) : text;
|
|
2719
2722
|
}
|
|
2720
2723
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
@@ -2742,7 +2745,7 @@ const unusedValueExportToPlacateAjd$4 = 1;
|
|
|
2742
2745
|
* @param tNode
|
|
2743
2746
|
*/
|
|
2744
2747
|
function hasClassInput(tNode) {
|
|
2745
|
-
return (tNode.flags & 16 /* hasClassInput */) !== 0;
|
|
2748
|
+
return (tNode.flags & 16 /* TNodeFlags.hasClassInput */) !== 0;
|
|
2746
2749
|
}
|
|
2747
2750
|
/**
|
|
2748
2751
|
* Returns `true` if the `TNode` has a directive which has `@Input()` for `style` binding.
|
|
@@ -2766,7 +2769,7 @@ function hasClassInput(tNode) {
|
|
|
2766
2769
|
* @param tNode
|
|
2767
2770
|
*/
|
|
2768
2771
|
function hasStyleInput(tNode) {
|
|
2769
|
-
return (tNode.flags & 32 /* hasStyleInput */) !== 0;
|
|
2772
|
+
return (tNode.flags & 32 /* TNodeFlags.hasStyleInput */) !== 0;
|
|
2770
2773
|
}
|
|
2771
2774
|
|
|
2772
2775
|
/**
|
|
@@ -2784,13 +2787,13 @@ function assertTNodeType(tNode, expectedTypes, message) {
|
|
|
2784
2787
|
}
|
|
2785
2788
|
}
|
|
2786
2789
|
function assertPureTNodeType(type) {
|
|
2787
|
-
if (!(type === 2 /* Element */ || //
|
|
2788
|
-
type === 1 /* Text */ || //
|
|
2789
|
-
type === 4 /* Container */ || //
|
|
2790
|
-
type === 8 /* ElementContainer */ || //
|
|
2791
|
-
type === 32 /* Icu */ || //
|
|
2792
|
-
type === 16 /* Projection */ || //
|
|
2793
|
-
type === 64 /* Placeholder */)) {
|
|
2790
|
+
if (!(type === 2 /* TNodeType.Element */ || //
|
|
2791
|
+
type === 1 /* TNodeType.Text */ || //
|
|
2792
|
+
type === 4 /* TNodeType.Container */ || //
|
|
2793
|
+
type === 8 /* TNodeType.ElementContainer */ || //
|
|
2794
|
+
type === 32 /* TNodeType.Icu */ || //
|
|
2795
|
+
type === 16 /* TNodeType.Projection */ || //
|
|
2796
|
+
type === 64 /* TNodeType.Placeholder */)) {
|
|
2794
2797
|
throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);
|
|
2795
2798
|
}
|
|
2796
2799
|
}
|
|
@@ -2830,7 +2833,7 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2830
2833
|
if (typeof value === 'number') {
|
|
2831
2834
|
// only namespaces are supported. Other value types (such as style/class
|
|
2832
2835
|
// entries) are not supported in this function.
|
|
2833
|
-
if (value !== 0 /* NamespaceURI */) {
|
|
2836
|
+
if (value !== 0 /* AttributeMarker.NamespaceURI */) {
|
|
2834
2837
|
break;
|
|
2835
2838
|
}
|
|
2836
2839
|
// we just landed on the marker value ... therefore
|
|
@@ -2877,14 +2880,14 @@ function setUpAttributes(renderer, native, attrs) {
|
|
|
2877
2880
|
* @returns true if the marker is a "name-only" marker (e.g. `Bindings`, `Template` or `I18n`).
|
|
2878
2881
|
*/
|
|
2879
2882
|
function isNameOnlyAttributeMarker(marker) {
|
|
2880
|
-
return marker === 3 /* Bindings */ || marker === 4 /* Template */ ||
|
|
2881
|
-
marker === 6 /* I18n */;
|
|
2883
|
+
return marker === 3 /* AttributeMarker.Bindings */ || marker === 4 /* AttributeMarker.Template */ ||
|
|
2884
|
+
marker === 6 /* AttributeMarker.I18n */;
|
|
2882
2885
|
}
|
|
2883
2886
|
function isAnimationProp(name) {
|
|
2884
2887
|
// Perf note: accessing charCodeAt to check for the first character of a string is faster as
|
|
2885
2888
|
// compared to accessing a character at index 0 (ex. name[0]). The main reason for this is that
|
|
2886
2889
|
// charCodeAt doesn't allocate memory to return a substring.
|
|
2887
|
-
return name.charCodeAt(0) === 64 /* AT_SIGN */;
|
|
2890
|
+
return name.charCodeAt(0) === 64 /* CharCode.AT_SIGN */;
|
|
2888
2891
|
}
|
|
2889
2892
|
/**
|
|
2890
2893
|
* Merges `src` `TAttributes` into `dst` `TAttributes` removing any duplicates in the process.
|
|
@@ -2903,18 +2906,18 @@ function mergeHostAttrs(dst, src) {
|
|
|
2903
2906
|
dst = src.slice();
|
|
2904
2907
|
}
|
|
2905
2908
|
else {
|
|
2906
|
-
let srcMarker = -1 /* ImplicitAttributes */;
|
|
2909
|
+
let srcMarker = -1 /* AttributeMarker.ImplicitAttributes */;
|
|
2907
2910
|
for (let i = 0; i < src.length; i++) {
|
|
2908
2911
|
const item = src[i];
|
|
2909
2912
|
if (typeof item === 'number') {
|
|
2910
2913
|
srcMarker = item;
|
|
2911
2914
|
}
|
|
2912
2915
|
else {
|
|
2913
|
-
if (srcMarker === 0 /* NamespaceURI */) {
|
|
2916
|
+
if (srcMarker === 0 /* AttributeMarker.NamespaceURI */) {
|
|
2914
2917
|
// Case where we need to consume `key1`, `key2`, `value` items.
|
|
2915
2918
|
}
|
|
2916
|
-
else if (srcMarker === -1 /* ImplicitAttributes */ ||
|
|
2917
|
-
srcMarker === 2 /* Styles */) {
|
|
2919
|
+
else if (srcMarker === -1 /* AttributeMarker.ImplicitAttributes */ ||
|
|
2920
|
+
srcMarker === 2 /* AttributeMarker.Styles */) {
|
|
2918
2921
|
// Case where we have to consume `key1` and `value` only.
|
|
2919
2922
|
mergeHostAttribute(dst, srcMarker, item, null, src[++i]);
|
|
2920
2923
|
}
|
|
@@ -2941,7 +2944,7 @@ function mergeHostAttribute(dst, marker, key1, key2, value) {
|
|
|
2941
2944
|
// Assume that new markers will be inserted at the end.
|
|
2942
2945
|
let markerInsertPosition = dst.length;
|
|
2943
2946
|
// scan until correct type.
|
|
2944
|
-
if (marker === -1 /* ImplicitAttributes */) {
|
|
2947
|
+
if (marker === -1 /* AttributeMarker.ImplicitAttributes */) {
|
|
2945
2948
|
markerInsertPosition = -1;
|
|
2946
2949
|
}
|
|
2947
2950
|
else {
|
|
@@ -3016,13 +3019,13 @@ function hasParentInjector(parentLocation) {
|
|
|
3016
3019
|
function getParentInjectorIndex(parentLocation) {
|
|
3017
3020
|
ngDevMode && assertNumber(parentLocation, 'Number expected');
|
|
3018
3021
|
ngDevMode && assertNotEqual(parentLocation, -1, 'Not a valid state.');
|
|
3019
|
-
const parentInjectorIndex = parentLocation & 32767 /* InjectorIndexMask */;
|
|
3022
|
+
const parentInjectorIndex = parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;
|
|
3020
3023
|
ngDevMode &&
|
|
3021
3024
|
assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');
|
|
3022
|
-
return parentLocation & 32767 /* InjectorIndexMask */;
|
|
3025
|
+
return parentLocation & 32767 /* RelativeInjectorLocationFlags.InjectorIndexMask */;
|
|
3023
3026
|
}
|
|
3024
3027
|
function getParentInjectorViewOffset(parentLocation) {
|
|
3025
|
-
return parentLocation >> 16 /* ViewOffsetShift */;
|
|
3028
|
+
return parentLocation >> 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */;
|
|
3026
3029
|
}
|
|
3027
3030
|
/**
|
|
3028
3031
|
* Unwraps a parent injector location number to find the view offset from the current injector,
|
|
@@ -3176,11 +3179,11 @@ function getOrCreateNodeInjectorForNode(tNode, lView) {
|
|
|
3176
3179
|
const parentData = parentLView[TVIEW].data;
|
|
3177
3180
|
// Creates a cumulative bloom filter that merges the parent's bloom filter
|
|
3178
3181
|
// and its own cumulative bloom (which contains tokens for all ancestors)
|
|
3179
|
-
for (let i = 0; i < 8 /* BLOOM_SIZE */; i++) {
|
|
3182
|
+
for (let i = 0; i < 8 /* NodeInjectorOffset.BLOOM_SIZE */; i++) {
|
|
3180
3183
|
lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];
|
|
3181
3184
|
}
|
|
3182
3185
|
}
|
|
3183
|
-
lView[injectorIndex + 8 /* PARENT */] = parentLoc;
|
|
3186
|
+
lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */] = parentLoc;
|
|
3184
3187
|
return injectorIndex;
|
|
3185
3188
|
}
|
|
3186
3189
|
function insertBloom(arr, footer) {
|
|
@@ -3193,7 +3196,7 @@ function getInjectorIndex(tNode, lView) {
|
|
|
3193
3196
|
(tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||
|
|
3194
3197
|
// After the first template pass, the injector index might exist but the parent values
|
|
3195
3198
|
// might not have been calculated yet for this instance
|
|
3196
|
-
lView[tNode.injectorIndex + 8 /* PARENT */] === null) {
|
|
3199
|
+
lView[tNode.injectorIndex + 8 /* NodeInjectorOffset.PARENT */] === null) {
|
|
3197
3200
|
return -1;
|
|
3198
3201
|
}
|
|
3199
3202
|
else {
|
|
@@ -3236,7 +3239,7 @@ function getParentInjectorLocation(tNode, lView) {
|
|
|
3236
3239
|
if (parentTNode.injectorIndex !== -1) {
|
|
3237
3240
|
// We found a NodeInjector which points to something.
|
|
3238
3241
|
return (parentTNode.injectorIndex |
|
|
3239
|
-
(declarationViewOffset << 16 /* ViewOffsetShift */));
|
|
3242
|
+
(declarationViewOffset << 16 /* RelativeInjectorLocationFlags.ViewOffsetShift */));
|
|
3240
3243
|
}
|
|
3241
3244
|
}
|
|
3242
3245
|
return NO_PARENT_INJECTOR;
|
|
@@ -3283,7 +3286,7 @@ function diPublicInInjector(injectorIndex, tView, token) {
|
|
|
3283
3286
|
* @publicApi
|
|
3284
3287
|
*/
|
|
3285
3288
|
function injectAttributeImpl(tNode, attrNameToInject) {
|
|
3286
|
-
ngDevMode && assertTNodeType(tNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);
|
|
3289
|
+
ngDevMode && assertTNodeType(tNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);
|
|
3287
3290
|
ngDevMode && assertDefined(tNode, 'expecting tNode');
|
|
3288
3291
|
if (attrNameToInject === 'class') {
|
|
3289
3292
|
return tNode.classes;
|
|
@@ -3301,7 +3304,7 @@ function injectAttributeImpl(tNode, attrNameToInject) {
|
|
|
3301
3304
|
if (isNameOnlyAttributeMarker(value))
|
|
3302
3305
|
break;
|
|
3303
3306
|
// Skip namespaced attributes
|
|
3304
|
-
if (value === 0 /* NamespaceURI */) {
|
|
3307
|
+
if (value === 0 /* AttributeMarker.NamespaceURI */) {
|
|
3305
3308
|
// we skip the next two values
|
|
3306
3309
|
// as namespaced attributes looks like
|
|
3307
3310
|
// [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',
|
|
@@ -3387,7 +3390,7 @@ function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default,
|
|
|
3387
3390
|
if (tNode !== null) {
|
|
3388
3391
|
// If the view or any of its ancestors have an embedded
|
|
3389
3392
|
// view injector, we have to look it up there first.
|
|
3390
|
-
if (lView[FLAGS] & 2048 /* HasEmbeddedViewInjector */) {
|
|
3393
|
+
if (lView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */) {
|
|
3391
3394
|
const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);
|
|
3392
3395
|
if (embeddedInjectorValue !== NOT_FOUND) {
|
|
3393
3396
|
return embeddedInjectorValue;
|
|
@@ -3449,7 +3452,7 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue)
|
|
|
3449
3452
|
// searching the parent injector.
|
|
3450
3453
|
if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {
|
|
3451
3454
|
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :
|
|
3452
|
-
lView[injectorIndex + 8 /* PARENT */];
|
|
3455
|
+
lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
3453
3456
|
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
|
|
3454
3457
|
injectorIndex = -1;
|
|
3455
3458
|
}
|
|
@@ -3466,7 +3469,7 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue)
|
|
|
3466
3469
|
// Check the current injector. If it matches, see if it contains token.
|
|
3467
3470
|
const tView = lView[TVIEW];
|
|
3468
3471
|
ngDevMode &&
|
|
3469
|
-
assertTNodeForLView(tView.data[injectorIndex + 8 /* TNODE */], lView);
|
|
3472
|
+
assertTNodeForLView(tView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */], lView);
|
|
3470
3473
|
if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
|
|
3471
3474
|
// At this point, we have an injector which *may* contain the token, so we step through
|
|
3472
3475
|
// the providers and directives associated with the injector's corresponding node to get
|
|
@@ -3476,9 +3479,9 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue)
|
|
|
3476
3479
|
return instance;
|
|
3477
3480
|
}
|
|
3478
3481
|
}
|
|
3479
|
-
parentLocation = lView[injectorIndex + 8 /* PARENT */];
|
|
3482
|
+
parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
3480
3483
|
if (parentLocation !== NO_PARENT_INJECTOR &&
|
|
3481
|
-
shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* TNODE */] === hostTElementNode) &&
|
|
3484
|
+
shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */] === hostTElementNode) &&
|
|
3482
3485
|
bloomHasToken(bloomHash, injectorIndex, lView)) {
|
|
3483
3486
|
// The def wasn't found anywhere on this node, so it was a false positive.
|
|
3484
3487
|
// Traverse up the tree and continue searching.
|
|
@@ -3498,7 +3501,7 @@ function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue)
|
|
|
3498
3501
|
}
|
|
3499
3502
|
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
|
|
3500
3503
|
const currentTView = lView[TVIEW];
|
|
3501
|
-
const tNode = currentTView.data[injectorIndex + 8 /* TNODE */];
|
|
3504
|
+
const tNode = currentTView.data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
3502
3505
|
// First, we need to determine if view providers can be accessed by the starting element.
|
|
3503
3506
|
// There are two possibilities
|
|
3504
3507
|
const canAccessViewProviders = previousTView == null ?
|
|
@@ -3516,7 +3519,7 @@ function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flag
|
|
|
3516
3519
|
// - AND the parent TNode is an Element.
|
|
3517
3520
|
// This means that we just came from the Component's View and therefore are allowed to see
|
|
3518
3521
|
// into the ViewProviders.
|
|
3519
|
-
(previousTView != currentTView && ((tNode.type & 3 /* AnyRNode */) !== 0));
|
|
3522
|
+
(previousTView != currentTView && ((tNode.type & 3 /* TNodeType.AnyRNode */) !== 0));
|
|
3520
3523
|
// This special case happens when there is a @host on the inject and when we are searching
|
|
3521
3524
|
// on the host element node.
|
|
3522
3525
|
const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;
|
|
@@ -3541,10 +3544,10 @@ function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flag
|
|
|
3541
3544
|
function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {
|
|
3542
3545
|
const nodeProviderIndexes = tNode.providerIndexes;
|
|
3543
3546
|
const tInjectables = tView.data;
|
|
3544
|
-
const injectablesStart = nodeProviderIndexes & 1048575 /* ProvidersStartIndexMask */;
|
|
3547
|
+
const injectablesStart = nodeProviderIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
3545
3548
|
const directivesStart = tNode.directiveStart;
|
|
3546
3549
|
const directiveEnd = tNode.directiveEnd;
|
|
3547
|
-
const cptViewProvidersCount = nodeProviderIndexes >> 20 /* CptViewProvidersCountShift */;
|
|
3550
|
+
const cptViewProvidersCount = nodeProviderIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;
|
|
3548
3551
|
const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;
|
|
3549
3552
|
// When the host special case applies, only the viewProviders and the component are visible
|
|
3550
3553
|
const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;
|
|
@@ -3634,7 +3637,7 @@ function bloomHashBitOrFactory(token) {
|
|
|
3634
3637
|
}
|
|
3635
3638
|
else {
|
|
3636
3639
|
ngDevMode &&
|
|
3637
|
-
assertEqual(tokenId, -1 /* Injector */, 'Expecting to get Special Injector Id');
|
|
3640
|
+
assertEqual(tokenId, -1 /* InjectorMarkers.Injector */, 'Expecting to get Special Injector Id');
|
|
3638
3641
|
return createNodeInjector;
|
|
3639
3642
|
}
|
|
3640
3643
|
}
|
|
@@ -3730,8 +3733,8 @@ function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundVa
|
|
|
3730
3733
|
// hierarchy when resolving the value is to walk it node-by-node while attempting to resolve
|
|
3731
3734
|
// the token at each level.
|
|
3732
3735
|
while (currentTNode !== null && currentLView !== null &&
|
|
3733
|
-
(currentLView[FLAGS] & 2048 /* HasEmbeddedViewInjector */) &&
|
|
3734
|
-
!(currentLView[FLAGS] & 512 /* IsRoot */)) {
|
|
3736
|
+
(currentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */) &&
|
|
3737
|
+
!(currentLView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {
|
|
3735
3738
|
ngDevMode && assertTNodeForLView(currentTNode, currentLView);
|
|
3736
3739
|
// Note that this lookup on the node injector is using the `Self` flag, because
|
|
3737
3740
|
// we don't want the node injector to look at any parent injectors since we
|
|
@@ -3766,11 +3769,11 @@ function getTNodeFromLView(lView) {
|
|
|
3766
3769
|
const tView = lView[TVIEW];
|
|
3767
3770
|
const tViewType = tView.type;
|
|
3768
3771
|
// The parent pointer differs based on `TView.type`.
|
|
3769
|
-
if (tViewType === 2 /* Embedded */) {
|
|
3772
|
+
if (tViewType === 2 /* TViewType.Embedded */) {
|
|
3770
3773
|
ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
3771
3774
|
return tView.declTNode;
|
|
3772
3775
|
}
|
|
3773
|
-
else if (tViewType === 1 /* Component */) {
|
|
3776
|
+
else if (tViewType === 1 /* TViewType.Component */) {
|
|
3774
3777
|
// Components don't have `TView.declTNode` because each instance of component could be
|
|
3775
3778
|
// inserted in different location, hence `TView.declTNode` is meaningless.
|
|
3776
3779
|
return lView[T_HOST];
|
|
@@ -4154,7 +4157,7 @@ function getCompilerFacade(request) {
|
|
|
4154
4157
|
console.error(`JIT compilation failed for ${request.kind}`, request.type);
|
|
4155
4158
|
let message = `The ${request.kind} '${request
|
|
4156
4159
|
.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`;
|
|
4157
|
-
if (request.usage === 1 /* PartialDeclaration */) {
|
|
4160
|
+
if (request.usage === 1 /* JitCompilerUsage.PartialDeclaration */) {
|
|
4158
4161
|
message += `The ${request.kind} is part of a library that has been partially compiled.\n`;
|
|
4159
4162
|
message +=
|
|
4160
4163
|
`However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`;
|
|
@@ -4826,7 +4829,7 @@ function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
|
4826
4829
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4827
4830
|
`inject() must be called from an injection context` :
|
|
4828
4831
|
'';
|
|
4829
|
-
throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4832
|
+
throw new RuntimeError(203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4830
4833
|
}
|
|
4831
4834
|
else if (_currentInjector === null) {
|
|
4832
4835
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4893,7 +4896,7 @@ function injectArgs(types) {
|
|
|
4893
4896
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4894
4897
|
'Arguments array must have arguments.' :
|
|
4895
4898
|
'';
|
|
4896
|
-
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
4899
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
4897
4900
|
}
|
|
4898
4901
|
let type = undefined;
|
|
4899
4902
|
let flags = InjectFlags.Default;
|
|
@@ -4902,7 +4905,7 @@ function injectArgs(types) {
|
|
|
4902
4905
|
const flag = getInjectFlag(meta);
|
|
4903
4906
|
if (typeof flag === 'number') {
|
|
4904
4907
|
// Special case when we handle @Inject decorator.
|
|
4905
|
-
if (flag === -1 /* Inject */) {
|
|
4908
|
+
if (flag === -1 /* DecoratorFlags.Inject */) {
|
|
4906
4909
|
type = meta.token;
|
|
4907
4910
|
}
|
|
4908
4911
|
else {
|
|
@@ -4989,7 +4992,7 @@ function formatError(text, obj, injectorErrorName, source = null) {
|
|
|
4989
4992
|
const Inject = attachInjectFlag(
|
|
4990
4993
|
// Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
|
|
4991
4994
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
4992
|
-
makeParamDecorator('Inject', (token) => ({ token })), -1 /* Inject */);
|
|
4995
|
+
makeParamDecorator('Inject', (token) => ({ token })), -1 /* DecoratorFlags.Inject */);
|
|
4993
4996
|
/**
|
|
4994
4997
|
* Optional decorator and metadata.
|
|
4995
4998
|
*
|
|
@@ -4999,7 +5002,7 @@ makeParamDecorator('Inject', (token) => ({ token })), -1 /* Inject */);
|
|
|
4999
5002
|
const Optional =
|
|
5000
5003
|
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
|
|
5001
5004
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
5002
|
-
attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);
|
|
5005
|
+
attachInjectFlag(makeParamDecorator('Optional'), 8 /* InternalInjectFlags.Optional */);
|
|
5003
5006
|
/**
|
|
5004
5007
|
* Self decorator and metadata.
|
|
5005
5008
|
*
|
|
@@ -5009,7 +5012,7 @@ attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);
|
|
|
5009
5012
|
const Self =
|
|
5010
5013
|
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
|
|
5011
5014
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
5012
|
-
attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);
|
|
5015
|
+
attachInjectFlag(makeParamDecorator('Self'), 2 /* InternalInjectFlags.Self */);
|
|
5013
5016
|
/**
|
|
5014
5017
|
* `SkipSelf` decorator and metadata.
|
|
5015
5018
|
*
|
|
@@ -5019,7 +5022,7 @@ attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);
|
|
|
5019
5022
|
const SkipSelf =
|
|
5020
5023
|
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
|
|
5021
5024
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
5022
|
-
attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);
|
|
5025
|
+
attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* InternalInjectFlags.SkipSelf */);
|
|
5023
5026
|
/**
|
|
5024
5027
|
* Host decorator and metadata.
|
|
5025
5028
|
*
|
|
@@ -5029,7 +5032,7 @@ attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);
|
|
|
5029
5032
|
const Host =
|
|
5030
5033
|
// Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
|
|
5031
5034
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
5032
|
-
attachInjectFlag(makeParamDecorator('Host'), 1 /* Host */);
|
|
5035
|
+
attachInjectFlag(makeParamDecorator('Host'), 1 /* InternalInjectFlags.Host */);
|
|
5033
5036
|
|
|
5034
5037
|
/**
|
|
5035
5038
|
* @license
|
|
@@ -5484,27 +5487,27 @@ class SafeValueImpl {
|
|
|
5484
5487
|
}
|
|
5485
5488
|
class SafeHtmlImpl extends SafeValueImpl {
|
|
5486
5489
|
getTypeName() {
|
|
5487
|
-
return "HTML" /* Html */;
|
|
5490
|
+
return "HTML" /* BypassType.Html */;
|
|
5488
5491
|
}
|
|
5489
5492
|
}
|
|
5490
5493
|
class SafeStyleImpl extends SafeValueImpl {
|
|
5491
5494
|
getTypeName() {
|
|
5492
|
-
return "Style" /* Style */;
|
|
5495
|
+
return "Style" /* BypassType.Style */;
|
|
5493
5496
|
}
|
|
5494
5497
|
}
|
|
5495
5498
|
class SafeScriptImpl extends SafeValueImpl {
|
|
5496
5499
|
getTypeName() {
|
|
5497
|
-
return "Script" /* Script */;
|
|
5500
|
+
return "Script" /* BypassType.Script */;
|
|
5498
5501
|
}
|
|
5499
5502
|
}
|
|
5500
5503
|
class SafeUrlImpl extends SafeValueImpl {
|
|
5501
5504
|
getTypeName() {
|
|
5502
|
-
return "URL" /* Url */;
|
|
5505
|
+
return "URL" /* BypassType.Url */;
|
|
5503
5506
|
}
|
|
5504
5507
|
}
|
|
5505
5508
|
class SafeResourceUrlImpl extends SafeValueImpl {
|
|
5506
5509
|
getTypeName() {
|
|
5507
|
-
return "ResourceURL" /* ResourceUrl */;
|
|
5510
|
+
return "ResourceURL" /* BypassType.ResourceUrl */;
|
|
5508
5511
|
}
|
|
5509
5512
|
}
|
|
5510
5513
|
function unwrapSafeValue(value) {
|
|
@@ -5515,7 +5518,7 @@ function allowSanitizationBypassAndThrow(value, type) {
|
|
|
5515
5518
|
const actualType = getSanitizationBypassType(value);
|
|
5516
5519
|
if (actualType != null && actualType !== type) {
|
|
5517
5520
|
// Allow ResourceURLs in URL contexts, they are strictly more trusted.
|
|
5518
|
-
if (actualType === "ResourceURL" /* ResourceUrl */ && type === "URL" /* Url */)
|
|
5521
|
+
if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
|
|
5519
5522
|
return true;
|
|
5520
5523
|
throw new Error(`Required a safe ${type}, got a ${actualType} (see https://g.co/ng/security#xss)`);
|
|
5521
5524
|
}
|
|
@@ -6073,7 +6076,7 @@ function ɵɵsanitizeHtml(unsafeHtml) {
|
|
|
6073
6076
|
if (sanitizer) {
|
|
6074
6077
|
return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');
|
|
6075
6078
|
}
|
|
6076
|
-
if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* Html */)) {
|
|
6079
|
+
if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* BypassType.Html */)) {
|
|
6077
6080
|
return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
|
|
6078
6081
|
}
|
|
6079
6082
|
return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
|
|
@@ -6094,7 +6097,7 @@ function ɵɵsanitizeStyle(unsafeStyle) {
|
|
|
6094
6097
|
if (sanitizer) {
|
|
6095
6098
|
return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';
|
|
6096
6099
|
}
|
|
6097
|
-
if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* Style */)) {
|
|
6100
|
+
if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* BypassType.Style */)) {
|
|
6098
6101
|
return unwrapSafeValue(unsafeStyle);
|
|
6099
6102
|
}
|
|
6100
6103
|
return renderStringify(unsafeStyle);
|
|
@@ -6120,7 +6123,7 @@ function ɵɵsanitizeUrl(unsafeUrl) {
|
|
|
6120
6123
|
if (sanitizer) {
|
|
6121
6124
|
return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
|
|
6122
6125
|
}
|
|
6123
|
-
if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* Url */)) {
|
|
6126
|
+
if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* BypassType.Url */)) {
|
|
6124
6127
|
return unwrapSafeValue(unsafeUrl);
|
|
6125
6128
|
}
|
|
6126
6129
|
return _sanitizeUrl(renderStringify(unsafeUrl));
|
|
@@ -6141,13 +6144,13 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
6141
6144
|
if (sanitizer) {
|
|
6142
6145
|
return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');
|
|
6143
6146
|
}
|
|
6144
|
-
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
|
|
6147
|
+
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
6145
6148
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6146
6149
|
}
|
|
6147
6150
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6148
6151
|
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
|
|
6149
6152
|
'';
|
|
6150
|
-
throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
6153
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
6151
6154
|
}
|
|
6152
6155
|
/**
|
|
6153
6156
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6166,13 +6169,13 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6166
6169
|
if (sanitizer) {
|
|
6167
6170
|
return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');
|
|
6168
6171
|
}
|
|
6169
|
-
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
|
|
6172
|
+
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
6170
6173
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6171
6174
|
}
|
|
6172
6175
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6173
6176
|
'unsafe value used in a script context' :
|
|
6174
6177
|
'';
|
|
6175
|
-
throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6178
|
+
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6176
6179
|
}
|
|
6177
6180
|
/**
|
|
6178
6181
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -6264,14 +6267,14 @@ function validateAgainstEventProperties(name) {
|
|
|
6264
6267
|
`please use (${name.slice(2)})=...` +
|
|
6265
6268
|
`\nIf '${name}' is a directive input, make sure the directive is imported by the` +
|
|
6266
6269
|
` current module.`;
|
|
6267
|
-
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6270
|
+
throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);
|
|
6268
6271
|
}
|
|
6269
6272
|
}
|
|
6270
6273
|
function validateAgainstEventAttributes(name) {
|
|
6271
6274
|
if (name.toLowerCase().startsWith('on')) {
|
|
6272
6275
|
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
|
|
6273
6276
|
`please use (${name.slice(2)})=...`;
|
|
6274
|
-
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6277
|
+
throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);
|
|
6275
6278
|
}
|
|
6276
6279
|
}
|
|
6277
6280
|
function getSanitizer() {
|
|
@@ -6526,7 +6529,7 @@ function readPatchedData(target) {
|
|
|
6526
6529
|
function readPatchedLView(target) {
|
|
6527
6530
|
const value = readPatchedData(target);
|
|
6528
6531
|
if (value) {
|
|
6529
|
-
return isLView(value) ? value : value.lView;
|
|
6532
|
+
return (isLView(value) ? value : value.lView);
|
|
6530
6533
|
}
|
|
6531
6534
|
return null;
|
|
6532
6535
|
}
|
|
@@ -6629,14 +6632,14 @@ function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) {
|
|
|
6629
6632
|
if (directiveStartIndex == 0)
|
|
6630
6633
|
return EMPTY_ARRAY;
|
|
6631
6634
|
const directiveEndIndex = tNode.directiveEnd;
|
|
6632
|
-
if (!includeComponents && tNode.flags & 2 /* isComponentHost */)
|
|
6635
|
+
if (!includeComponents && tNode.flags & 2 /* TNodeFlags.isComponentHost */)
|
|
6633
6636
|
directiveStartIndex++;
|
|
6634
6637
|
return lView.slice(directiveStartIndex, directiveEndIndex);
|
|
6635
6638
|
}
|
|
6636
6639
|
function getComponentAtNodeIndex(nodeIndex, lView) {
|
|
6637
6640
|
const tNode = lView[TVIEW].data[nodeIndex];
|
|
6638
6641
|
let directiveStartIndex = tNode.directiveStart;
|
|
6639
|
-
return tNode.flags & 2 /* isComponentHost */ ? lView[directiveStartIndex] : null;
|
|
6642
|
+
return tNode.flags & 2 /* TNodeFlags.isComponentHost */ ? lView[directiveStartIndex] : null;
|
|
6640
6643
|
}
|
|
6641
6644
|
/**
|
|
6642
6645
|
* Returns a map of local references (local reference name => element or directive instance) that
|
|
@@ -6917,11 +6920,11 @@ function maybeUnwrapFn(value) {
|
|
|
6917
6920
|
function assertStandaloneComponentType(type) {
|
|
6918
6921
|
const componentDef = getComponentDef(type);
|
|
6919
6922
|
if (!componentDef) {
|
|
6920
|
-
throw new RuntimeError(906 /* MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +
|
|
6923
|
+
throw new RuntimeError(906 /* RuntimeErrorCode.MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +
|
|
6921
6924
|
`make sure it has the \`@Component\` decorator.`);
|
|
6922
6925
|
}
|
|
6923
6926
|
if (!componentDef.standalone) {
|
|
6924
|
-
throw new RuntimeError(907 /* TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +
|
|
6927
|
+
throw new RuntimeError(907 /* RuntimeErrorCode.TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +
|
|
6925
6928
|
`but Angular expects to have a standalone component here. ` +
|
|
6926
6929
|
`Please make sure the ${stringifyForError(type)} component has ` +
|
|
6927
6930
|
`the \`standalone: true\` flag in the decorator.`);
|
|
@@ -6929,7 +6932,7 @@ function assertStandaloneComponentType(type) {
|
|
|
6929
6932
|
}
|
|
6930
6933
|
/** Called when there are multiple component selectors that match a given node */
|
|
6931
6934
|
function throwMultipleComponentError(tNode, first, second) {
|
|
6932
|
-
throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +
|
|
6935
|
+
throw new RuntimeError(-300 /* RuntimeErrorCode.MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +
|
|
6933
6936
|
`${stringifyForError(first)} and ` +
|
|
6934
6937
|
`${stringifyForError(second)}`);
|
|
6935
6938
|
}
|
|
@@ -6942,7 +6945,7 @@ function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName)
|
|
|
6942
6945
|
` It seems like the view has been created after its parent and its children have been dirty checked.` +
|
|
6943
6946
|
` Has it been created in a change detection hook?`;
|
|
6944
6947
|
}
|
|
6945
|
-
throw new RuntimeError(-100 /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
|
|
6948
|
+
throw new RuntimeError(-100 /* RuntimeErrorCode.EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
|
|
6946
6949
|
}
|
|
6947
6950
|
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
|
|
6948
6951
|
const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
|
|
@@ -7086,7 +7089,7 @@ function getLViewParent(lView) {
|
|
|
7086
7089
|
function getRootView(componentOrLView) {
|
|
7087
7090
|
ngDevMode && assertDefined(componentOrLView, 'component');
|
|
7088
7091
|
let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);
|
|
7089
|
-
while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) {
|
|
7092
|
+
while (lView && !(lView[FLAGS] & 512 /* LViewFlags.IsRoot */)) {
|
|
7090
7093
|
lView = getLViewParent(lView);
|
|
7091
7094
|
}
|
|
7092
7095
|
ngDevMode && assertLView(lView);
|
|
@@ -7157,7 +7160,7 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7157
7160
|
}
|
|
7158
7161
|
const rNode = unwrapRNode(lNodeToHandle);
|
|
7159
7162
|
ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
|
|
7160
|
-
if (action === 0 /* Create */ && parent !== null) {
|
|
7163
|
+
if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
|
|
7161
7164
|
if (beforeNode == null) {
|
|
7162
7165
|
nativeAppendChild(renderer, parent, rNode);
|
|
7163
7166
|
}
|
|
@@ -7165,13 +7168,13 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
|
|
|
7165
7168
|
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
7166
7169
|
}
|
|
7167
7170
|
}
|
|
7168
|
-
else if (action === 1 /* Insert */ && parent !== null) {
|
|
7171
|
+
else if (action === 1 /* WalkTNodeTreeAction.Insert */ && parent !== null) {
|
|
7169
7172
|
nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);
|
|
7170
7173
|
}
|
|
7171
|
-
else if (action === 2 /* Detach */) {
|
|
7174
|
+
else if (action === 2 /* WalkTNodeTreeAction.Detach */) {
|
|
7172
7175
|
nativeRemoveNode(renderer, rNode, isComponent);
|
|
7173
7176
|
}
|
|
7174
|
-
else if (action === 3 /* Destroy */) {
|
|
7177
|
+
else if (action === 3 /* WalkTNodeTreeAction.Destroy */) {
|
|
7175
7178
|
ngDevMode && ngDevMode.rendererDestroyNode++;
|
|
7176
7179
|
renderer.destroyNode(rNode);
|
|
7177
7180
|
}
|
|
@@ -7226,7 +7229,7 @@ function createElementNode(renderer, name, namespace) {
|
|
|
7226
7229
|
*/
|
|
7227
7230
|
function removeViewFromContainer(tView, lView) {
|
|
7228
7231
|
const renderer = lView[RENDERER];
|
|
7229
|
-
applyView(tView, lView, renderer, 2 /* Detach */, null, null);
|
|
7232
|
+
applyView(tView, lView, renderer, 2 /* WalkTNodeTreeAction.Detach */, null, null);
|
|
7230
7233
|
lView[HOST] = null;
|
|
7231
7234
|
lView[T_HOST] = null;
|
|
7232
7235
|
}
|
|
@@ -7247,7 +7250,7 @@ function removeViewFromContainer(tView, lView) {
|
|
|
7247
7250
|
function addViewToContainer(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {
|
|
7248
7251
|
lView[HOST] = parentNativeNode;
|
|
7249
7252
|
lView[T_HOST] = parentTNode;
|
|
7250
|
-
applyView(tView, lView, renderer, 1 /* Insert */, parentNativeNode, beforeNode);
|
|
7253
|
+
applyView(tView, lView, renderer, 1 /* WalkTNodeTreeAction.Insert */, parentNativeNode, beforeNode);
|
|
7251
7254
|
}
|
|
7252
7255
|
/**
|
|
7253
7256
|
* Detach a `LView` from the DOM by detaching its nodes.
|
|
@@ -7256,7 +7259,7 @@ function addViewToContainer(tView, parentTNode, renderer, lView, parentNativeNod
|
|
|
7256
7259
|
* @param lView the `LView` to be detached.
|
|
7257
7260
|
*/
|
|
7258
7261
|
function renderDetachView(tView, lView) {
|
|
7259
|
-
applyView(tView, lView, lView[RENDERER], 2 /* Detach */, null, null);
|
|
7262
|
+
applyView(tView, lView, lView[RENDERER], 2 /* WalkTNodeTreeAction.Detach */, null, null);
|
|
7260
7263
|
}
|
|
7261
7264
|
/**
|
|
7262
7265
|
* Traverses down and up the tree of views and containers to remove listeners and
|
|
@@ -7351,7 +7354,7 @@ function insertView(tView, lView, lContainer, index) {
|
|
|
7351
7354
|
lQueries.insertView(tView);
|
|
7352
7355
|
}
|
|
7353
7356
|
// Sets the attached flag
|
|
7354
|
-
lView[FLAGS] |= 128 /* Attached */;
|
|
7357
|
+
lView[FLAGS] |= 128 /* LViewFlags.Attached */;
|
|
7355
7358
|
}
|
|
7356
7359
|
/**
|
|
7357
7360
|
* Track views created from the declaration container (TemplateRef) and inserted into a
|
|
@@ -7391,8 +7394,8 @@ function detachMovedView(declarationContainer, lView) {
|
|
|
7391
7394
|
// If the view was marked for refresh but then detached before it was checked (where the flag
|
|
7392
7395
|
// would be cleared and the counter decremented), we need to decrement the view counter here
|
|
7393
7396
|
// instead.
|
|
7394
|
-
if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {
|
|
7395
|
-
lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;
|
|
7397
|
+
if (lView[FLAGS] & 1024 /* LViewFlags.RefreshTransplantedView */) {
|
|
7398
|
+
lView[FLAGS] &= ~1024 /* LViewFlags.RefreshTransplantedView */;
|
|
7396
7399
|
updateTransplantedViewCount(insertionLContainer, -1);
|
|
7397
7400
|
}
|
|
7398
7401
|
movedViews.splice(declarationViewIndex, 1);
|
|
@@ -7430,7 +7433,7 @@ function detachView(lContainer, removeIndex) {
|
|
|
7430
7433
|
viewToDetach[PARENT] = null;
|
|
7431
7434
|
viewToDetach[NEXT] = null;
|
|
7432
7435
|
// Unsets the attached flag
|
|
7433
|
-
viewToDetach[FLAGS] &= ~128 /* Attached */;
|
|
7436
|
+
viewToDetach[FLAGS] &= ~128 /* LViewFlags.Attached */;
|
|
7434
7437
|
}
|
|
7435
7438
|
return viewToDetach;
|
|
7436
7439
|
}
|
|
@@ -7442,10 +7445,10 @@ function detachView(lContainer, removeIndex) {
|
|
|
7442
7445
|
* @param lView The view to be destroyed.
|
|
7443
7446
|
*/
|
|
7444
7447
|
function destroyLView(tView, lView) {
|
|
7445
|
-
if (!(lView[FLAGS] & 256 /* Destroyed */)) {
|
|
7448
|
+
if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {
|
|
7446
7449
|
const renderer = lView[RENDERER];
|
|
7447
7450
|
if (isProceduralRenderer(renderer) && renderer.destroyNode) {
|
|
7448
|
-
applyView(tView, lView, renderer, 3 /* Destroy */, null, null);
|
|
7451
|
+
applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
|
|
7449
7452
|
}
|
|
7450
7453
|
destroyViewTree(lView);
|
|
7451
7454
|
}
|
|
@@ -7459,20 +7462,20 @@ function destroyLView(tView, lView) {
|
|
|
7459
7462
|
* @param lView The LView to clean up
|
|
7460
7463
|
*/
|
|
7461
7464
|
function cleanUpView(tView, lView) {
|
|
7462
|
-
if (!(lView[FLAGS] & 256 /* Destroyed */)) {
|
|
7465
|
+
if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {
|
|
7463
7466
|
// Usually the Attached flag is removed when the view is detached from its parent, however
|
|
7464
7467
|
// if it's a root view, the flag won't be unset hence why we're also removing on destroy.
|
|
7465
|
-
lView[FLAGS] &= ~128 /* Attached */;
|
|
7468
|
+
lView[FLAGS] &= ~128 /* LViewFlags.Attached */;
|
|
7466
7469
|
// Mark the LView as destroyed *before* executing the onDestroy hooks. An onDestroy hook
|
|
7467
7470
|
// runs arbitrary user code, which could include its own `viewRef.destroy()` (or similar). If
|
|
7468
7471
|
// We don't flag the view as destroyed before the hooks, this could lead to an infinite loop.
|
|
7469
7472
|
// This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is
|
|
7470
7473
|
// really more of an "afterDestroy" hook if you think about it.
|
|
7471
|
-
lView[FLAGS] |= 256 /* Destroyed */;
|
|
7474
|
+
lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;
|
|
7472
7475
|
executeOnDestroys(tView, lView);
|
|
7473
7476
|
processCleanups(tView, lView);
|
|
7474
7477
|
// For component views only, the local renderer is destroyed at clean up time.
|
|
7475
|
-
if (lView[TVIEW].type === 1 /* Component */ && isProceduralRenderer(lView[RENDERER])) {
|
|
7478
|
+
if (lView[TVIEW].type === 1 /* TViewType.Component */ && isProceduralRenderer(lView[RENDERER])) {
|
|
7476
7479
|
ngDevMode && ngDevMode.rendererDestroy++;
|
|
7477
7480
|
lView[RENDERER].destroy();
|
|
7478
7481
|
}
|
|
@@ -7556,22 +7559,22 @@ function executeOnDestroys(tView, lView) {
|
|
|
7556
7559
|
for (let j = 0; j < toCall.length; j += 2) {
|
|
7557
7560
|
const callContext = context[toCall[j]];
|
|
7558
7561
|
const hook = toCall[j + 1];
|
|
7559
|
-
profiler(4 /* LifecycleHookStart */, callContext, hook);
|
|
7562
|
+
profiler(4 /* ProfilerEvent.LifecycleHookStart */, callContext, hook);
|
|
7560
7563
|
try {
|
|
7561
7564
|
hook.call(callContext);
|
|
7562
7565
|
}
|
|
7563
7566
|
finally {
|
|
7564
|
-
profiler(5 /* LifecycleHookEnd */, callContext, hook);
|
|
7567
|
+
profiler(5 /* ProfilerEvent.LifecycleHookEnd */, callContext, hook);
|
|
7565
7568
|
}
|
|
7566
7569
|
}
|
|
7567
7570
|
}
|
|
7568
7571
|
else {
|
|
7569
|
-
profiler(4 /* LifecycleHookStart */, context, toCall);
|
|
7572
|
+
profiler(4 /* ProfilerEvent.LifecycleHookStart */, context, toCall);
|
|
7570
7573
|
try {
|
|
7571
7574
|
toCall.call(context);
|
|
7572
7575
|
}
|
|
7573
7576
|
finally {
|
|
7574
|
-
profiler(5 /* LifecycleHookEnd */, context, toCall);
|
|
7577
|
+
profiler(5 /* ProfilerEvent.LifecycleHookEnd */, context, toCall);
|
|
7575
7578
|
}
|
|
7576
7579
|
}
|
|
7577
7580
|
}
|
|
@@ -7617,7 +7620,7 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7617
7620
|
// Skip over element and ICU containers as those are represented by a comment node and
|
|
7618
7621
|
// can't be used as a render parent.
|
|
7619
7622
|
while (parentTNode !== null &&
|
|
7620
|
-
(parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */))) {
|
|
7623
|
+
(parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */))) {
|
|
7621
7624
|
tNode = parentTNode;
|
|
7622
7625
|
parentTNode = tNode.parent;
|
|
7623
7626
|
}
|
|
@@ -7629,8 +7632,8 @@ function getClosestRElement(tView, tNode, lView) {
|
|
|
7629
7632
|
return lView[HOST];
|
|
7630
7633
|
}
|
|
7631
7634
|
else {
|
|
7632
|
-
ngDevMode && assertTNodeType(parentTNode, 3 /* AnyRNode */ | 4 /* Container */);
|
|
7633
|
-
if (parentTNode.flags & 2 /* isComponentHost */) {
|
|
7635
|
+
ngDevMode && assertTNodeType(parentTNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);
|
|
7636
|
+
if (parentTNode.flags & 2 /* TNodeFlags.isComponentHost */) {
|
|
7634
7637
|
ngDevMode && assertTNodeForLView(parentTNode, lView);
|
|
7635
7638
|
const encapsulation = tView.data[parentTNode.directiveStart].encapsulation;
|
|
7636
7639
|
// We've got a parent which is an element in the current view. We just need to verify if the
|
|
@@ -7731,7 +7734,7 @@ function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {
|
|
|
7731
7734
|
* @param lView current `LView`
|
|
7732
7735
|
*/
|
|
7733
7736
|
function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {
|
|
7734
|
-
if (parentTNode.type & (8 /* ElementContainer */ | 32 /* Icu */)) {
|
|
7737
|
+
if (parentTNode.type & (8 /* TNodeType.ElementContainer */ | 32 /* TNodeType.Icu */)) {
|
|
7735
7738
|
return getNativeByTNode(parentTNode, lView);
|
|
7736
7739
|
}
|
|
7737
7740
|
return null;
|
|
@@ -7786,15 +7789,15 @@ function appendChild(tView, lView, childRNode, childTNode) {
|
|
|
7786
7789
|
function getFirstNativeNode(lView, tNode) {
|
|
7787
7790
|
if (tNode !== null) {
|
|
7788
7791
|
ngDevMode &&
|
|
7789
|
-
assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */ | 16 /* Projection */);
|
|
7792
|
+
assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */ | 16 /* TNodeType.Projection */);
|
|
7790
7793
|
const tNodeType = tNode.type;
|
|
7791
|
-
if (tNodeType & 3 /* AnyRNode */) {
|
|
7794
|
+
if (tNodeType & 3 /* TNodeType.AnyRNode */) {
|
|
7792
7795
|
return getNativeByTNode(tNode, lView);
|
|
7793
7796
|
}
|
|
7794
|
-
else if (tNodeType & 4 /* Container */) {
|
|
7797
|
+
else if (tNodeType & 4 /* TNodeType.Container */) {
|
|
7795
7798
|
return getBeforeNodeForView(-1, lView[tNode.index]);
|
|
7796
7799
|
}
|
|
7797
|
-
else if (tNodeType & 8 /* ElementContainer */) {
|
|
7800
|
+
else if (tNodeType & 8 /* TNodeType.ElementContainer */) {
|
|
7798
7801
|
const elIcuContainerChild = tNode.child;
|
|
7799
7802
|
if (elIcuContainerChild !== null) {
|
|
7800
7803
|
return getFirstNativeNode(lView, elIcuContainerChild);
|
|
@@ -7809,7 +7812,7 @@ function getFirstNativeNode(lView, tNode) {
|
|
|
7809
7812
|
}
|
|
7810
7813
|
}
|
|
7811
7814
|
}
|
|
7812
|
-
else if (tNodeType & 32 /* Icu */) {
|
|
7815
|
+
else if (tNodeType & 32 /* TNodeType.Icu */) {
|
|
7813
7816
|
let nextRNode = icuContainerIterate(tNode, lView);
|
|
7814
7817
|
let rNode = nextRNode();
|
|
7815
7818
|
// If the ICU container has no nodes, than we use the ICU anchor as the node.
|
|
@@ -7877,21 +7880,21 @@ function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode,
|
|
|
7877
7880
|
while (tNode != null) {
|
|
7878
7881
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
7879
7882
|
ngDevMode &&
|
|
7880
|
-
assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);
|
|
7883
|
+
assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);
|
|
7881
7884
|
const rawSlotValue = lView[tNode.index];
|
|
7882
7885
|
const tNodeType = tNode.type;
|
|
7883
7886
|
if (isProjection) {
|
|
7884
|
-
if (action === 0 /* Create */) {
|
|
7887
|
+
if (action === 0 /* WalkTNodeTreeAction.Create */) {
|
|
7885
7888
|
rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);
|
|
7886
|
-
tNode.flags |= 4 /* isProjected */;
|
|
7889
|
+
tNode.flags |= 4 /* TNodeFlags.isProjected */;
|
|
7887
7890
|
}
|
|
7888
7891
|
}
|
|
7889
|
-
if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
|
|
7890
|
-
if (tNodeType & 8 /* ElementContainer */) {
|
|
7892
|
+
if ((tNode.flags & 64 /* TNodeFlags.isDetached */) !== 64 /* TNodeFlags.isDetached */) {
|
|
7893
|
+
if (tNodeType & 8 /* TNodeType.ElementContainer */) {
|
|
7891
7894
|
applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);
|
|
7892
7895
|
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
|
|
7893
7896
|
}
|
|
7894
|
-
else if (tNodeType & 32 /* Icu */) {
|
|
7897
|
+
else if (tNodeType & 32 /* TNodeType.Icu */) {
|
|
7895
7898
|
const nextRNode = icuContainerIterate(tNode, lView);
|
|
7896
7899
|
let rNode;
|
|
7897
7900
|
while (rNode = nextRNode()) {
|
|
@@ -7899,11 +7902,11 @@ function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode,
|
|
|
7899
7902
|
}
|
|
7900
7903
|
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
|
|
7901
7904
|
}
|
|
7902
|
-
else if (tNodeType & 16 /* Projection */) {
|
|
7905
|
+
else if (tNodeType & 16 /* TNodeType.Projection */) {
|
|
7903
7906
|
applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);
|
|
7904
7907
|
}
|
|
7905
7908
|
else {
|
|
7906
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 4 /* Container */);
|
|
7909
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */);
|
|
7907
7910
|
applyToElementOrContainer(action, renderer, parentRElement, rawSlotValue, beforeNode);
|
|
7908
7911
|
}
|
|
7909
7912
|
}
|
|
@@ -7928,7 +7931,7 @@ function applyProjection(tView, lView, tProjectionNode) {
|
|
|
7928
7931
|
const parentRNode = getParentRElement(tView, tProjectionNode, lView);
|
|
7929
7932
|
const parentTNode = tProjectionNode.parent || lView[T_HOST];
|
|
7930
7933
|
let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);
|
|
7931
|
-
applyProjectionRecursive(renderer, 0 /* Create */, lView, tProjectionNode, parentRNode, beforeNode);
|
|
7934
|
+
applyProjectionRecursive(renderer, 0 /* WalkTNodeTreeAction.Create */, lView, tProjectionNode, parentRNode, beforeNode);
|
|
7932
7935
|
}
|
|
7933
7936
|
/**
|
|
7934
7937
|
* `applyProjectionRecursive` performs operation on the projection specified by `action` (insert,
|
|
@@ -8138,11 +8141,11 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
8138
8141
|
const foundIndex = className.indexOf(classToSearch, startingIndex);
|
|
8139
8142
|
if (foundIndex === -1)
|
|
8140
8143
|
return foundIndex;
|
|
8141
|
-
if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* SPACE */) {
|
|
8144
|
+
if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32 /* CharCode.SPACE */) {
|
|
8142
8145
|
// Ensure that it has leading whitespace
|
|
8143
8146
|
const length = classToSearch.length;
|
|
8144
8147
|
if (foundIndex + length === end ||
|
|
8145
|
-
className.charCodeAt(foundIndex + length) <= 32 /* SPACE */) {
|
|
8148
|
+
className.charCodeAt(foundIndex + length) <= 32 /* CharCode.SPACE */) {
|
|
8146
8149
|
// Ensure that it has trailing whitespace
|
|
8147
8150
|
return foundIndex;
|
|
8148
8151
|
}
|
|
@@ -8185,7 +8188,7 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
|
|
|
8185
8188
|
return true;
|
|
8186
8189
|
}
|
|
8187
8190
|
}
|
|
8188
|
-
else if (item === 1 /* Classes */) {
|
|
8191
|
+
else if (item === 1 /* AttributeMarker.Classes */) {
|
|
8189
8192
|
// We found the classes section. Start searching for the class.
|
|
8190
8193
|
while (i < attrs.length && typeof (item = attrs[i++]) == 'string') {
|
|
8191
8194
|
// while we have strings
|
|
@@ -8203,7 +8206,7 @@ function isCssClassMatching(attrs, cssClassToMatch, isProjectionMode) {
|
|
|
8203
8206
|
* @param tNode current TNode
|
|
8204
8207
|
*/
|
|
8205
8208
|
function isInlineTemplate(tNode) {
|
|
8206
|
-
return tNode.type === 4 /* Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;
|
|
8209
|
+
return tNode.type === 4 /* TNodeType.Container */ && tNode.value !== NG_TEMPLATE_SELECTOR;
|
|
8207
8210
|
}
|
|
8208
8211
|
/**
|
|
8209
8212
|
* Function that checks whether a given tNode matches tag-based selector and has a valid type.
|
|
@@ -8217,7 +8220,7 @@ function isInlineTemplate(tNode) {
|
|
|
8217
8220
|
* (applicable to TNodeType.Container only).
|
|
8218
8221
|
*/
|
|
8219
8222
|
function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {
|
|
8220
|
-
const tagNameToCompare = tNode.type === 4 /* Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;
|
|
8223
|
+
const tagNameToCompare = tNode.type === 4 /* TNodeType.Container */ && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;
|
|
8221
8224
|
return currentSelector === tagNameToCompare;
|
|
8222
8225
|
}
|
|
8223
8226
|
/**
|
|
@@ -8231,7 +8234,7 @@ function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {
|
|
|
8231
8234
|
*/
|
|
8232
8235
|
function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
8233
8236
|
ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');
|
|
8234
|
-
let mode = 4 /* ELEMENT */;
|
|
8237
|
+
let mode = 4 /* SelectorFlags.ELEMENT */;
|
|
8235
8238
|
const nodeAttrs = tNode.attrs || [];
|
|
8236
8239
|
// Find the index of first attribute that has no value, only a name.
|
|
8237
8240
|
const nameOnlyMarkerIdx = getNameOnlyMarkerIndex(nodeAttrs);
|
|
@@ -8250,13 +8253,13 @@ function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
|
8250
8253
|
if (skipToNextSelector && isPositive(current))
|
|
8251
8254
|
continue;
|
|
8252
8255
|
skipToNextSelector = false;
|
|
8253
|
-
mode = current | (mode & 1 /* NOT */);
|
|
8256
|
+
mode = current | (mode & 1 /* SelectorFlags.NOT */);
|
|
8254
8257
|
continue;
|
|
8255
8258
|
}
|
|
8256
8259
|
if (skipToNextSelector)
|
|
8257
8260
|
continue;
|
|
8258
|
-
if (mode & 4 /* ELEMENT */) {
|
|
8259
|
-
mode = 2 /* ATTRIBUTE */ | mode & 1 /* NOT */;
|
|
8261
|
+
if (mode & 4 /* SelectorFlags.ELEMENT */) {
|
|
8262
|
+
mode = 2 /* SelectorFlags.ATTRIBUTE */ | mode & 1 /* SelectorFlags.NOT */;
|
|
8260
8263
|
if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||
|
|
8261
8264
|
current === '' && selector.length === 1) {
|
|
8262
8265
|
if (isPositive(mode))
|
|
@@ -8265,10 +8268,10 @@ function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
|
8265
8268
|
}
|
|
8266
8269
|
}
|
|
8267
8270
|
else {
|
|
8268
|
-
const selectorAttrValue = mode & 8 /* CLASS */ ? current : selector[++i];
|
|
8271
|
+
const selectorAttrValue = mode & 8 /* SelectorFlags.CLASS */ ? current : selector[++i];
|
|
8269
8272
|
// special case for matching against classes when a tNode has been instantiated with
|
|
8270
8273
|
// class and style values as separate attribute values (e.g. ['title', CLASS, 'foo'])
|
|
8271
|
-
if ((mode & 8 /* CLASS */) && tNode.attrs !== null) {
|
|
8274
|
+
if ((mode & 8 /* SelectorFlags.CLASS */) && tNode.attrs !== null) {
|
|
8272
8275
|
if (!isCssClassMatching(tNode.attrs, selectorAttrValue, isProjectionMode)) {
|
|
8273
8276
|
if (isPositive(mode))
|
|
8274
8277
|
return false;
|
|
@@ -8276,7 +8279,7 @@ function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
|
8276
8279
|
}
|
|
8277
8280
|
continue;
|
|
8278
8281
|
}
|
|
8279
|
-
const attrName = (mode & 8 /* CLASS */) ? 'class' : current;
|
|
8282
|
+
const attrName = (mode & 8 /* SelectorFlags.CLASS */) ? 'class' : current;
|
|
8280
8283
|
const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);
|
|
8281
8284
|
if (attrIndexInNode === -1) {
|
|
8282
8285
|
if (isPositive(mode))
|
|
@@ -8291,16 +8294,16 @@ function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
|
8291
8294
|
}
|
|
8292
8295
|
else {
|
|
8293
8296
|
ngDevMode &&
|
|
8294
|
-
assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* NamespaceURI */, 'We do not match directives on namespaced attributes');
|
|
8297
|
+
assertNotEqual(nodeAttrs[attrIndexInNode], 0 /* AttributeMarker.NamespaceURI */, 'We do not match directives on namespaced attributes');
|
|
8295
8298
|
// we lowercase the attribute value to be able to match
|
|
8296
8299
|
// selectors without case-sensitivity
|
|
8297
8300
|
// (selectors are already in lowercase when generated)
|
|
8298
8301
|
nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();
|
|
8299
8302
|
}
|
|
8300
|
-
const compareAgainstClassName = mode & 8 /* CLASS */ ? nodeAttrValue : null;
|
|
8303
|
+
const compareAgainstClassName = mode & 8 /* SelectorFlags.CLASS */ ? nodeAttrValue : null;
|
|
8301
8304
|
if (compareAgainstClassName &&
|
|
8302
8305
|
classIndexOf(compareAgainstClassName, selectorAttrValue, 0) !== -1 ||
|
|
8303
|
-
mode & 2 /* ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
|
|
8306
|
+
mode & 2 /* SelectorFlags.ATTRIBUTE */ && selectorAttrValue !== nodeAttrValue) {
|
|
8304
8307
|
if (isPositive(mode))
|
|
8305
8308
|
return false;
|
|
8306
8309
|
skipToNextSelector = true;
|
|
@@ -8311,7 +8314,7 @@ function isNodeMatchingSelector(tNode, selector, isProjectionMode) {
|
|
|
8311
8314
|
return isPositive(mode) || skipToNextSelector;
|
|
8312
8315
|
}
|
|
8313
8316
|
function isPositive(mode) {
|
|
8314
|
-
return (mode & 1 /* NOT */) === 0;
|
|
8317
|
+
return (mode & 1 /* SelectorFlags.NOT */) === 0;
|
|
8315
8318
|
}
|
|
8316
8319
|
/**
|
|
8317
8320
|
* Examines the attribute's definition array for a node to find the index of the
|
|
@@ -8353,10 +8356,10 @@ function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {
|
|
|
8353
8356
|
if (maybeAttrName === name) {
|
|
8354
8357
|
return i;
|
|
8355
8358
|
}
|
|
8356
|
-
else if (maybeAttrName === 3 /* Bindings */ || maybeAttrName === 6 /* I18n */) {
|
|
8359
|
+
else if (maybeAttrName === 3 /* AttributeMarker.Bindings */ || maybeAttrName === 6 /* AttributeMarker.I18n */) {
|
|
8357
8360
|
bindingsMode = true;
|
|
8358
8361
|
}
|
|
8359
|
-
else if (maybeAttrName === 1 /* Classes */ || maybeAttrName === 2 /* Styles */) {
|
|
8362
|
+
else if (maybeAttrName === 1 /* AttributeMarker.Classes */ || maybeAttrName === 2 /* AttributeMarker.Styles */) {
|
|
8360
8363
|
let value = attrs[++i];
|
|
8361
8364
|
// We should skip classes here because we have a separate mechanism for
|
|
8362
8365
|
// matching classes in projection mode.
|
|
@@ -8365,11 +8368,11 @@ function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {
|
|
|
8365
8368
|
}
|
|
8366
8369
|
continue;
|
|
8367
8370
|
}
|
|
8368
|
-
else if (maybeAttrName === 4 /* Template */) {
|
|
8371
|
+
else if (maybeAttrName === 4 /* AttributeMarker.Template */) {
|
|
8369
8372
|
// We do not care about Template attributes in this scenario.
|
|
8370
8373
|
break;
|
|
8371
8374
|
}
|
|
8372
|
-
else if (maybeAttrName === 0 /* NamespaceURI */) {
|
|
8375
|
+
else if (maybeAttrName === 0 /* AttributeMarker.NamespaceURI */) {
|
|
8373
8376
|
// Skip the whole namespaced attribute and value. This is by design.
|
|
8374
8377
|
i += 4;
|
|
8375
8378
|
continue;
|
|
@@ -8395,7 +8398,7 @@ function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {
|
|
|
8395
8398
|
function getProjectAsAttrValue(tNode) {
|
|
8396
8399
|
const nodeAttrs = tNode.attrs;
|
|
8397
8400
|
if (nodeAttrs != null) {
|
|
8398
|
-
const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* ProjectAs */);
|
|
8401
|
+
const ngProjectAsAttrIdx = nodeAttrs.indexOf(5 /* AttributeMarker.ProjectAs */);
|
|
8399
8402
|
// only check for ngProjectAs in attribute names, don't accidentally match attribute's value
|
|
8400
8403
|
// (attribute names are stored at even indexes)
|
|
8401
8404
|
if ((ngProjectAsAttrIdx & 1) === 0) {
|
|
@@ -8414,7 +8417,7 @@ function getNameOnlyMarkerIndex(nodeAttrs) {
|
|
|
8414
8417
|
return nodeAttrs.length;
|
|
8415
8418
|
}
|
|
8416
8419
|
function matchTemplateAttribute(attrs, name) {
|
|
8417
|
-
let i = attrs.indexOf(4 /* Template */);
|
|
8420
|
+
let i = attrs.indexOf(4 /* AttributeMarker.Template */);
|
|
8418
8421
|
if (i > -1) {
|
|
8419
8422
|
i++;
|
|
8420
8423
|
while (i < attrs.length) {
|
|
@@ -8456,21 +8459,21 @@ function maybeWrapInNotSelector(isNegativeMode, chunk) {
|
|
|
8456
8459
|
function stringifyCSSSelector(selector) {
|
|
8457
8460
|
let result = selector[0];
|
|
8458
8461
|
let i = 1;
|
|
8459
|
-
let mode = 2 /* ATTRIBUTE */;
|
|
8462
|
+
let mode = 2 /* SelectorFlags.ATTRIBUTE */;
|
|
8460
8463
|
let currentChunk = '';
|
|
8461
8464
|
let isNegativeMode = false;
|
|
8462
8465
|
while (i < selector.length) {
|
|
8463
8466
|
let valueOrMarker = selector[i];
|
|
8464
8467
|
if (typeof valueOrMarker === 'string') {
|
|
8465
|
-
if (mode & 2 /* ATTRIBUTE */) {
|
|
8468
|
+
if (mode & 2 /* SelectorFlags.ATTRIBUTE */) {
|
|
8466
8469
|
const attrValue = selector[++i];
|
|
8467
8470
|
currentChunk +=
|
|
8468
8471
|
'[' + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : '') + ']';
|
|
8469
8472
|
}
|
|
8470
|
-
else if (mode & 8 /* CLASS */) {
|
|
8473
|
+
else if (mode & 8 /* SelectorFlags.CLASS */) {
|
|
8471
8474
|
currentChunk += '.' + valueOrMarker;
|
|
8472
8475
|
}
|
|
8473
|
-
else if (mode & 4 /* ELEMENT */) {
|
|
8476
|
+
else if (mode & 4 /* SelectorFlags.ELEMENT */) {
|
|
8474
8477
|
currentChunk += ' ' + valueOrMarker;
|
|
8475
8478
|
}
|
|
8476
8479
|
}
|
|
@@ -8537,16 +8540,16 @@ function extractAttrsAndClassesFromSelector(selector) {
|
|
|
8537
8540
|
const attrs = [];
|
|
8538
8541
|
const classes = [];
|
|
8539
8542
|
let i = 1;
|
|
8540
|
-
let mode = 2 /* ATTRIBUTE */;
|
|
8543
|
+
let mode = 2 /* SelectorFlags.ATTRIBUTE */;
|
|
8541
8544
|
while (i < selector.length) {
|
|
8542
8545
|
let valueOrMarker = selector[i];
|
|
8543
8546
|
if (typeof valueOrMarker === 'string') {
|
|
8544
|
-
if (mode === 2 /* ATTRIBUTE */) {
|
|
8547
|
+
if (mode === 2 /* SelectorFlags.ATTRIBUTE */) {
|
|
8545
8548
|
if (valueOrMarker !== '') {
|
|
8546
8549
|
attrs.push(valueOrMarker, selector[++i]);
|
|
8547
8550
|
}
|
|
8548
8551
|
}
|
|
8549
|
-
else if (mode === 8 /* CLASS */) {
|
|
8552
|
+
else if (mode === 8 /* SelectorFlags.CLASS */) {
|
|
8550
8553
|
classes.push(valueOrMarker);
|
|
8551
8554
|
}
|
|
8552
8555
|
}
|
|
@@ -8612,7 +8615,7 @@ function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
|
|
|
8612
8615
|
// Flush the initial hooks for elements in the view that have been added up to this point.
|
|
8613
8616
|
// PERF WARNING: do NOT extract this to a separate function without running benchmarks
|
|
8614
8617
|
if (!checkNoChangesMode) {
|
|
8615
|
-
const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
|
|
8618
|
+
const hooksInitPhaseCompleted = (lView[FLAGS] & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;
|
|
8616
8619
|
if (hooksInitPhaseCompleted) {
|
|
8617
8620
|
const preOrderCheckHooks = tView.preOrderCheckHooks;
|
|
8618
8621
|
if (preOrderCheckHooks !== null) {
|
|
@@ -8622,7 +8625,7 @@ function selectIndexInternal(tView, lView, index, checkNoChangesMode) {
|
|
|
8622
8625
|
else {
|
|
8623
8626
|
const preOrderHooks = tView.preOrderHooks;
|
|
8624
8627
|
if (preOrderHooks !== null) {
|
|
8625
|
-
executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, index);
|
|
8628
|
+
executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, index);
|
|
8626
8629
|
}
|
|
8627
8630
|
}
|
|
8628
8631
|
}
|
|
@@ -8679,47 +8682,47 @@ function createNamedArrayType(name) {
|
|
|
8679
8682
|
* found in the LICENSE file at https://angular.io/license
|
|
8680
8683
|
*/
|
|
8681
8684
|
function toTStylingRange(prev, next) {
|
|
8682
|
-
ngDevMode && assertNumberInRange(prev, 0, 32767 /* UNSIGNED_MASK */);
|
|
8683
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);
|
|
8684
|
-
return (prev << 17 /* PREV_SHIFT */ | next << 2 /* NEXT_SHIFT */);
|
|
8685
|
+
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
8686
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
8687
|
+
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
8685
8688
|
}
|
|
8686
8689
|
function getTStylingRangePrev(tStylingRange) {
|
|
8687
8690
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8688
|
-
return (tStylingRange >> 17 /* PREV_SHIFT */) & 32767 /* UNSIGNED_MASK */;
|
|
8691
|
+
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
8689
8692
|
}
|
|
8690
8693
|
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
8691
8694
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8692
|
-
return (tStylingRange & 2 /* PREV_DUPLICATE */) ==
|
|
8693
|
-
2 /* PREV_DUPLICATE */;
|
|
8695
|
+
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
8696
|
+
2 /* StylingRange.PREV_DUPLICATE */;
|
|
8694
8697
|
}
|
|
8695
8698
|
function setTStylingRangePrev(tStylingRange, previous) {
|
|
8696
8699
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8697
|
-
ngDevMode && assertNumberInRange(previous, 0, 32767 /* UNSIGNED_MASK */);
|
|
8698
|
-
return ((tStylingRange & ~4294836224 /* PREV_MASK */) |
|
|
8699
|
-
(previous << 17 /* PREV_SHIFT */));
|
|
8700
|
+
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
8701
|
+
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
8702
|
+
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
8700
8703
|
}
|
|
8701
8704
|
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
8702
8705
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8703
|
-
return (tStylingRange | 2 /* PREV_DUPLICATE */);
|
|
8706
|
+
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
8704
8707
|
}
|
|
8705
8708
|
function getTStylingRangeNext(tStylingRange) {
|
|
8706
8709
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8707
|
-
return (tStylingRange & 131068 /* NEXT_MASK */) >> 2 /* NEXT_SHIFT */;
|
|
8710
|
+
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
8708
8711
|
}
|
|
8709
8712
|
function setTStylingRangeNext(tStylingRange, next) {
|
|
8710
8713
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8711
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* UNSIGNED_MASK */);
|
|
8712
|
-
return ((tStylingRange & ~131068 /* NEXT_MASK */) | //
|
|
8713
|
-
next << 2 /* NEXT_SHIFT */);
|
|
8714
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
8715
|
+
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
8716
|
+
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
8714
8717
|
}
|
|
8715
8718
|
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
8716
8719
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8717
|
-
return (tStylingRange & 1 /* NEXT_DUPLICATE */) ===
|
|
8718
|
-
1 /* NEXT_DUPLICATE */;
|
|
8720
|
+
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
8721
|
+
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
8719
8722
|
}
|
|
8720
8723
|
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
8721
8724
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
8722
|
-
return (tStylingRange | 1 /* NEXT_DUPLICATE */);
|
|
8725
|
+
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
8723
8726
|
}
|
|
8724
8727
|
function getTStylingRangeTail(tStylingRange) {
|
|
8725
8728
|
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
@@ -8825,11 +8828,11 @@ class LEmbeddedView extends Array {
|
|
|
8825
8828
|
}
|
|
8826
8829
|
function getLViewToClone(type, name) {
|
|
8827
8830
|
switch (type) {
|
|
8828
|
-
case 0 /* Root */:
|
|
8831
|
+
case 0 /* TViewType.Root */:
|
|
8829
8832
|
if (LVIEW_ROOT === undefined)
|
|
8830
8833
|
LVIEW_ROOT = new LRootView();
|
|
8831
8834
|
return LVIEW_ROOT;
|
|
8832
|
-
case 1 /* Component */:
|
|
8835
|
+
case 1 /* TViewType.Component */:
|
|
8833
8836
|
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
8834
8837
|
if (LVIEW_COMPONENT === undefined)
|
|
8835
8838
|
LVIEW_COMPONENT = new LComponentView();
|
|
@@ -8843,7 +8846,7 @@ function getLViewToClone(type, name) {
|
|
|
8843
8846
|
LVIEW_COMPONENT_CACHE.set(name, componentArray);
|
|
8844
8847
|
}
|
|
8845
8848
|
return componentArray;
|
|
8846
|
-
case 2 /* Embedded */:
|
|
8849
|
+
case 2 /* TViewType.Embedded */:
|
|
8847
8850
|
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
8848
8851
|
if (LVIEW_EMBEDDED === undefined)
|
|
8849
8852
|
LVIEW_EMBEDDED = new LEmbeddedView();
|
|
@@ -9011,9 +9014,9 @@ class TNode {
|
|
|
9011
9014
|
}
|
|
9012
9015
|
while (injectorIndex !== -1) {
|
|
9013
9016
|
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
9014
|
-
const tNode = lView[TVIEW].data[injectorIndex + 8 /* TNODE */];
|
|
9017
|
+
const tNode = lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
9015
9018
|
path.push(buildDebugNode(tNode, lView));
|
|
9016
|
-
const parentLocation = lView[injectorIndex + 8 /* PARENT */];
|
|
9019
|
+
const parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
9017
9020
|
if (parentLocation === NO_PARENT_INJECTOR) {
|
|
9018
9021
|
injectorIndex = -1;
|
|
9019
9022
|
}
|
|
@@ -9029,26 +9032,26 @@ class TNode {
|
|
|
9029
9032
|
}
|
|
9030
9033
|
get flags_() {
|
|
9031
9034
|
const flags = [];
|
|
9032
|
-
if (this.flags & 16 /* hasClassInput */)
|
|
9035
|
+
if (this.flags & 16 /* TNodeFlags.hasClassInput */)
|
|
9033
9036
|
flags.push('TNodeFlags.hasClassInput');
|
|
9034
|
-
if (this.flags & 8 /* hasContentQuery */)
|
|
9037
|
+
if (this.flags & 8 /* TNodeFlags.hasContentQuery */)
|
|
9035
9038
|
flags.push('TNodeFlags.hasContentQuery');
|
|
9036
|
-
if (this.flags & 32 /* hasStyleInput */)
|
|
9039
|
+
if (this.flags & 32 /* TNodeFlags.hasStyleInput */)
|
|
9037
9040
|
flags.push('TNodeFlags.hasStyleInput');
|
|
9038
|
-
if (this.flags & 128 /* hasHostBindings */)
|
|
9041
|
+
if (this.flags & 128 /* TNodeFlags.hasHostBindings */)
|
|
9039
9042
|
flags.push('TNodeFlags.hasHostBindings');
|
|
9040
|
-
if (this.flags & 2 /* isComponentHost */)
|
|
9043
|
+
if (this.flags & 2 /* TNodeFlags.isComponentHost */)
|
|
9041
9044
|
flags.push('TNodeFlags.isComponentHost');
|
|
9042
|
-
if (this.flags & 1 /* isDirectiveHost */)
|
|
9045
|
+
if (this.flags & 1 /* TNodeFlags.isDirectiveHost */)
|
|
9043
9046
|
flags.push('TNodeFlags.isDirectiveHost');
|
|
9044
|
-
if (this.flags & 64 /* isDetached */)
|
|
9047
|
+
if (this.flags & 64 /* TNodeFlags.isDetached */)
|
|
9045
9048
|
flags.push('TNodeFlags.isDetached');
|
|
9046
|
-
if (this.flags & 4 /* isProjected */)
|
|
9049
|
+
if (this.flags & 4 /* TNodeFlags.isProjected */)
|
|
9047
9050
|
flags.push('TNodeFlags.isProjected');
|
|
9048
9051
|
return flags.join('|');
|
|
9049
9052
|
}
|
|
9050
9053
|
get template_() {
|
|
9051
|
-
if (this.type & 1 /* Text */)
|
|
9054
|
+
if (this.type & 1 /* TNodeType.Text */)
|
|
9052
9055
|
return this.value;
|
|
9053
9056
|
const buf = [];
|
|
9054
9057
|
const tagName = typeof this.value === 'string' && this.value || this.type_;
|
|
@@ -9078,11 +9081,11 @@ class TNode {
|
|
|
9078
9081
|
return toDebugStyleBinding(this, true);
|
|
9079
9082
|
}
|
|
9080
9083
|
get providerIndexStart_() {
|
|
9081
|
-
return this.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
|
|
9084
|
+
return this.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
9082
9085
|
}
|
|
9083
9086
|
get providerIndexEnd_() {
|
|
9084
9087
|
return this.providerIndexStart_ +
|
|
9085
|
-
(this.providerIndexes >>> 20 /* CptViewProvidersCountShift */);
|
|
9088
|
+
(this.providerIndexes >>> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */);
|
|
9086
9089
|
}
|
|
9087
9090
|
}
|
|
9088
9091
|
const TNodeDebug = TNode;
|
|
@@ -9206,15 +9209,15 @@ class LViewDebug {
|
|
|
9206
9209
|
const flags = this._raw_lView[FLAGS];
|
|
9207
9210
|
return {
|
|
9208
9211
|
__raw__flags__: flags,
|
|
9209
|
-
initPhaseState: flags & 3 /* InitPhaseStateMask */,
|
|
9210
|
-
creationMode: !!(flags & 4 /* CreationMode */),
|
|
9211
|
-
firstViewPass: !!(flags & 8 /* FirstLViewPass */),
|
|
9212
|
-
checkAlways: !!(flags & 16 /* CheckAlways */),
|
|
9213
|
-
dirty: !!(flags & 64 /* Dirty */),
|
|
9214
|
-
attached: !!(flags & 128 /* Attached */),
|
|
9215
|
-
destroyed: !!(flags & 256 /* Destroyed */),
|
|
9216
|
-
isRoot: !!(flags & 512 /* IsRoot */),
|
|
9217
|
-
indexWithinInitPhase: flags >> 12 /* IndexWithinInitPhaseShift */,
|
|
9212
|
+
initPhaseState: flags & 3 /* LViewFlags.InitPhaseStateMask */,
|
|
9213
|
+
creationMode: !!(flags & 4 /* LViewFlags.CreationMode */),
|
|
9214
|
+
firstViewPass: !!(flags & 8 /* LViewFlags.FirstLViewPass */),
|
|
9215
|
+
checkAlways: !!(flags & 16 /* LViewFlags.CheckAlways */),
|
|
9216
|
+
dirty: !!(flags & 64 /* LViewFlags.Dirty */),
|
|
9217
|
+
attached: !!(flags & 128 /* LViewFlags.Attached */),
|
|
9218
|
+
destroyed: !!(flags & 256 /* LViewFlags.Destroyed */),
|
|
9219
|
+
isRoot: !!(flags & 512 /* LViewFlags.IsRoot */),
|
|
9220
|
+
indexWithinInitPhase: flags >> 12 /* LViewFlags.IndexWithinInitPhaseShift */,
|
|
9218
9221
|
};
|
|
9219
9222
|
}
|
|
9220
9223
|
get parent() {
|
|
@@ -9439,6 +9442,21 @@ class LContainerDebug {
|
|
|
9439
9442
|
}
|
|
9440
9443
|
}
|
|
9441
9444
|
|
|
9445
|
+
let shouldThrowErrorOnUnknownProperty = false;
|
|
9446
|
+
/**
|
|
9447
|
+
* Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
|
|
9448
|
+
* instead of just logging the error.
|
|
9449
|
+
* (for AOT-compiled ones this check happens at build time).
|
|
9450
|
+
*/
|
|
9451
|
+
function ɵsetUnknownPropertyStrictMode(shouldThrow) {
|
|
9452
|
+
shouldThrowErrorOnUnknownProperty = shouldThrow;
|
|
9453
|
+
}
|
|
9454
|
+
/**
|
|
9455
|
+
* Gets the current value of the strict mode.
|
|
9456
|
+
*/
|
|
9457
|
+
function ɵgetUnknownPropertyStrictMode() {
|
|
9458
|
+
return shouldThrowErrorOnUnknownProperty;
|
|
9459
|
+
}
|
|
9442
9460
|
/**
|
|
9443
9461
|
* A permanent marker promise which signifies that the current CD tree is
|
|
9444
9462
|
* clean.
|
|
@@ -9471,7 +9489,7 @@ function processHostBindingOpCodes(tView, lView) {
|
|
|
9471
9489
|
const hostBindingFn = hostBindingOpCodes[++i];
|
|
9472
9490
|
setBindingRootForHostBindings(bindingRootIndx, directiveIdx);
|
|
9473
9491
|
const context = lView[directiveIdx];
|
|
9474
|
-
hostBindingFn(2 /* Update */, context);
|
|
9492
|
+
hostBindingFn(2 /* RenderFlags.Update */, context);
|
|
9475
9493
|
}
|
|
9476
9494
|
}
|
|
9477
9495
|
}
|
|
@@ -9492,7 +9510,7 @@ function refreshContentQueries(tView, lView) {
|
|
|
9492
9510
|
ngDevMode &&
|
|
9493
9511
|
assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');
|
|
9494
9512
|
setCurrentQueryIndex(queryStartIdx);
|
|
9495
|
-
directiveDef.contentQueries(2 /* Update */, lView[directiveDefIdx], directiveDefIdx);
|
|
9513
|
+
directiveDef.contentQueries(2 /* RenderFlags.Update */, lView[directiveDefIdx], directiveDefIdx);
|
|
9496
9514
|
}
|
|
9497
9515
|
}
|
|
9498
9516
|
}
|
|
@@ -9512,10 +9530,10 @@ function renderChildComponents(hostLView, components) {
|
|
|
9512
9530
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
9513
9531
|
const lView = ngDevMode ? cloneToLViewFromTViewBlueprint(tView) : tView.blueprint.slice();
|
|
9514
9532
|
lView[HOST] = host;
|
|
9515
|
-
lView[FLAGS] = flags | 4 /* CreationMode */ | 128 /* Attached */ | 8 /* FirstLViewPass */;
|
|
9533
|
+
lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
|
|
9516
9534
|
if (embeddedViewInjector !== null ||
|
|
9517
|
-
(parentLView && (parentLView[FLAGS] & 2048 /* HasEmbeddedViewInjector */))) {
|
|
9518
|
-
lView[FLAGS] |= 2048 /* HasEmbeddedViewInjector */;
|
|
9535
|
+
(parentLView && (parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */))) {
|
|
9536
|
+
lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;
|
|
9519
9537
|
}
|
|
9520
9538
|
resetPreOrderHookFlags(lView);
|
|
9521
9539
|
ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
|
|
@@ -9531,9 +9549,9 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
|
|
|
9531
9549
|
lView[ID] = getUniqueLViewId();
|
|
9532
9550
|
lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
|
|
9533
9551
|
ngDevMode &&
|
|
9534
|
-
assertEqual(tView.type == 2 /* Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
9552
|
+
assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
9535
9553
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
9536
|
-
tView.type == 2 /* Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
|
|
9554
|
+
tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
|
|
9537
9555
|
ngDevMode && attachLViewDebug(lView);
|
|
9538
9556
|
return lView;
|
|
9539
9557
|
}
|
|
@@ -9551,10 +9569,10 @@ function getOrCreateTNode(tView, index, type, name, attrs) {
|
|
|
9551
9569
|
// See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
|
|
9552
9570
|
// If the `TNode` was not pre-declared than it means it was not mentioned which means it was
|
|
9553
9571
|
// removed, so we mark it as detached.
|
|
9554
|
-
tNode.flags |= 64 /* isDetached */;
|
|
9572
|
+
tNode.flags |= 64 /* TNodeFlags.isDetached */;
|
|
9555
9573
|
}
|
|
9556
9574
|
}
|
|
9557
|
-
else if (tNode.type & 64 /* Placeholder */) {
|
|
9575
|
+
else if (tNode.type & 64 /* TNodeType.Placeholder */) {
|
|
9558
9576
|
tNode.type = type;
|
|
9559
9577
|
tNode.value = name;
|
|
9560
9578
|
tNode.attrs = attrs;
|
|
@@ -9641,13 +9659,13 @@ function renderView(tView, lView, context) {
|
|
|
9641
9659
|
try {
|
|
9642
9660
|
const viewQuery = tView.viewQuery;
|
|
9643
9661
|
if (viewQuery !== null) {
|
|
9644
|
-
executeViewQueryFn(1 /* Create */, viewQuery, context);
|
|
9662
|
+
executeViewQueryFn(1 /* RenderFlags.Create */, viewQuery, context);
|
|
9645
9663
|
}
|
|
9646
9664
|
// Execute a template associated with this view, if it exists. A template function might not be
|
|
9647
9665
|
// defined for the root component views.
|
|
9648
9666
|
const templateFn = tView.template;
|
|
9649
9667
|
if (templateFn !== null) {
|
|
9650
|
-
executeTemplate(tView, lView, templateFn, 1 /* Create */, context);
|
|
9668
|
+
executeTemplate(tView, lView, templateFn, 1 /* RenderFlags.Create */, context);
|
|
9651
9669
|
}
|
|
9652
9670
|
// This needs to be set before children are processed to support recursive components.
|
|
9653
9671
|
// This must be set to false immediately after the first creation run because in an
|
|
@@ -9667,7 +9685,7 @@ function renderView(tView, lView, context) {
|
|
|
9667
9685
|
// in case a child component has projected a container. The LContainer needs
|
|
9668
9686
|
// to exist so the embedded views are properly attached by the container.
|
|
9669
9687
|
if (tView.staticViewQueries) {
|
|
9670
|
-
executeViewQueryFn(2 /* Update */, tView.viewQuery, context);
|
|
9688
|
+
executeViewQueryFn(2 /* RenderFlags.Update */, tView.viewQuery, context);
|
|
9671
9689
|
}
|
|
9672
9690
|
// Render child component views.
|
|
9673
9691
|
const components = tView.components;
|
|
@@ -9685,7 +9703,7 @@ function renderView(tView, lView, context) {
|
|
|
9685
9703
|
throw error;
|
|
9686
9704
|
}
|
|
9687
9705
|
finally {
|
|
9688
|
-
lView[FLAGS] &= ~4 /* CreationMode */;
|
|
9706
|
+
lView[FLAGS] &= ~4 /* LViewFlags.CreationMode */;
|
|
9689
9707
|
leaveView();
|
|
9690
9708
|
}
|
|
9691
9709
|
}
|
|
@@ -9700,7 +9718,7 @@ function renderView(tView, lView, context) {
|
|
|
9700
9718
|
function refreshView(tView, lView, templateFn, context) {
|
|
9701
9719
|
ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');
|
|
9702
9720
|
const flags = lView[FLAGS];
|
|
9703
|
-
if ((flags & 256 /* Destroyed */) === 256 /* Destroyed */)
|
|
9721
|
+
if ((flags & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */)
|
|
9704
9722
|
return;
|
|
9705
9723
|
enterView(lView);
|
|
9706
9724
|
// Check no changes mode is a dev only mode used to verify that bindings have not changed
|
|
@@ -9710,9 +9728,9 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9710
9728
|
resetPreOrderHookFlags(lView);
|
|
9711
9729
|
setBindingIndex(tView.bindingStartIndex);
|
|
9712
9730
|
if (templateFn !== null) {
|
|
9713
|
-
executeTemplate(tView, lView, templateFn, 2 /* Update */, context);
|
|
9731
|
+
executeTemplate(tView, lView, templateFn, 2 /* RenderFlags.Update */, context);
|
|
9714
9732
|
}
|
|
9715
|
-
const hooksInitPhaseCompleted = (flags & 3 /* InitPhaseStateMask */) === 3 /* InitPhaseCompleted */;
|
|
9733
|
+
const hooksInitPhaseCompleted = (flags & 3 /* LViewFlags.InitPhaseStateMask */) === 3 /* InitPhaseState.InitPhaseCompleted */;
|
|
9716
9734
|
// execute pre-order hooks (OnInit, OnChanges, DoCheck)
|
|
9717
9735
|
// PERF WARNING: do NOT extract this to a separate function without running benchmarks
|
|
9718
9736
|
if (!isInCheckNoChangesPass) {
|
|
@@ -9725,9 +9743,9 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9725
9743
|
else {
|
|
9726
9744
|
const preOrderHooks = tView.preOrderHooks;
|
|
9727
9745
|
if (preOrderHooks !== null) {
|
|
9728
|
-
executeInitAndCheckHooks(lView, preOrderHooks, 0 /* OnInitHooksToBeRun */, null);
|
|
9746
|
+
executeInitAndCheckHooks(lView, preOrderHooks, 0 /* InitPhaseState.OnInitHooksToBeRun */, null);
|
|
9729
9747
|
}
|
|
9730
|
-
incrementInitPhaseFlags(lView, 0 /* OnInitHooksToBeRun */);
|
|
9748
|
+
incrementInitPhaseFlags(lView, 0 /* InitPhaseState.OnInitHooksToBeRun */);
|
|
9731
9749
|
}
|
|
9732
9750
|
}
|
|
9733
9751
|
// First mark transplanted views that are declared in this lView as needing a refresh at their
|
|
@@ -9751,9 +9769,9 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9751
9769
|
else {
|
|
9752
9770
|
const contentHooks = tView.contentHooks;
|
|
9753
9771
|
if (contentHooks !== null) {
|
|
9754
|
-
executeInitAndCheckHooks(lView, contentHooks, 1 /* AfterContentInitHooksToBeRun */);
|
|
9772
|
+
executeInitAndCheckHooks(lView, contentHooks, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);
|
|
9755
9773
|
}
|
|
9756
|
-
incrementInitPhaseFlags(lView, 1 /* AfterContentInitHooksToBeRun */);
|
|
9774
|
+
incrementInitPhaseFlags(lView, 1 /* InitPhaseState.AfterContentInitHooksToBeRun */);
|
|
9757
9775
|
}
|
|
9758
9776
|
}
|
|
9759
9777
|
processHostBindingOpCodes(tView, lView);
|
|
@@ -9767,7 +9785,7 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9767
9785
|
// refresh, the template might not yet be inserted.
|
|
9768
9786
|
const viewQuery = tView.viewQuery;
|
|
9769
9787
|
if (viewQuery !== null) {
|
|
9770
|
-
executeViewQueryFn(2 /* Update */, viewQuery, context);
|
|
9788
|
+
executeViewQueryFn(2 /* RenderFlags.Update */, viewQuery, context);
|
|
9771
9789
|
}
|
|
9772
9790
|
// execute view hooks (AfterViewInit, AfterViewChecked)
|
|
9773
9791
|
// PERF WARNING: do NOT extract this to a separate function without running benchmarks
|
|
@@ -9781,9 +9799,9 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9781
9799
|
else {
|
|
9782
9800
|
const viewHooks = tView.viewHooks;
|
|
9783
9801
|
if (viewHooks !== null) {
|
|
9784
|
-
executeInitAndCheckHooks(lView, viewHooks, 2 /* AfterViewInitHooksToBeRun */);
|
|
9802
|
+
executeInitAndCheckHooks(lView, viewHooks, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);
|
|
9785
9803
|
}
|
|
9786
|
-
incrementInitPhaseFlags(lView, 2 /* AfterViewInitHooksToBeRun */);
|
|
9804
|
+
incrementInitPhaseFlags(lView, 2 /* InitPhaseState.AfterViewInitHooksToBeRun */);
|
|
9787
9805
|
}
|
|
9788
9806
|
}
|
|
9789
9807
|
if (tView.firstUpdatePass === true) {
|
|
@@ -9802,10 +9820,10 @@ function refreshView(tView, lView, templateFn, context) {
|
|
|
9802
9820
|
// no changes cycle, the component would be not be dirty for the next update pass. This would
|
|
9803
9821
|
// be different in production mode where the component dirty state is not reset.
|
|
9804
9822
|
if (!isInCheckNoChangesPass) {
|
|
9805
|
-
lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);
|
|
9823
|
+
lView[FLAGS] &= ~(64 /* LViewFlags.Dirty */ | 8 /* LViewFlags.FirstLViewPass */);
|
|
9806
9824
|
}
|
|
9807
|
-
if (lView[FLAGS] & 1024 /* RefreshTransplantedView */) {
|
|
9808
|
-
lView[FLAGS] &= ~1024 /* RefreshTransplantedView */;
|
|
9825
|
+
if (lView[FLAGS] & 1024 /* LViewFlags.RefreshTransplantedView */) {
|
|
9826
|
+
lView[FLAGS] &= ~1024 /* LViewFlags.RefreshTransplantedView */;
|
|
9809
9827
|
updateTransplantedViewCount(lView[PARENT], -1);
|
|
9810
9828
|
}
|
|
9811
9829
|
}
|
|
@@ -9834,7 +9852,7 @@ function renderComponentOrTemplate(tView, lView, templateFn, context) {
|
|
|
9834
9852
|
}
|
|
9835
9853
|
function executeTemplate(tView, lView, templateFn, rf, context) {
|
|
9836
9854
|
const prevSelectedIndex = getSelectedIndex();
|
|
9837
|
-
const isUpdatePhase = rf & 2 /* Update */;
|
|
9855
|
+
const isUpdatePhase = rf & 2 /* RenderFlags.Update */;
|
|
9838
9856
|
try {
|
|
9839
9857
|
setSelectedIndex(-1);
|
|
9840
9858
|
if (isUpdatePhase && lView.length > HEADER_OFFSET) {
|
|
@@ -9842,13 +9860,13 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
|
|
|
9842
9860
|
// have to generate that instruction for most update blocks.
|
|
9843
9861
|
selectIndexInternal(tView, lView, HEADER_OFFSET, isInCheckNoChangesMode());
|
|
9844
9862
|
}
|
|
9845
|
-
const preHookType = isUpdatePhase ? 2 /* TemplateUpdateStart */ : 0 /* TemplateCreateStart */;
|
|
9863
|
+
const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;
|
|
9846
9864
|
profiler(preHookType, context);
|
|
9847
9865
|
templateFn(rf, context);
|
|
9848
9866
|
}
|
|
9849
9867
|
finally {
|
|
9850
9868
|
setSelectedIndex(prevSelectedIndex);
|
|
9851
|
-
const postHookType = isUpdatePhase ? 3 /* TemplateUpdateEnd */ : 1 /* TemplateCreateEnd */;
|
|
9869
|
+
const postHookType = isUpdatePhase ? 3 /* ProfilerEvent.TemplateUpdateEnd */ : 1 /* ProfilerEvent.TemplateCreateEnd */;
|
|
9852
9870
|
profiler(postHookType, context);
|
|
9853
9871
|
}
|
|
9854
9872
|
}
|
|
@@ -9862,7 +9880,7 @@ function executeContentQueries(tView, tNode, lView) {
|
|
|
9862
9880
|
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
|
|
9863
9881
|
const def = tView.data[directiveIndex];
|
|
9864
9882
|
if (def.contentQueries) {
|
|
9865
|
-
def.contentQueries(1 /* Create */, lView[directiveIndex], directiveIndex);
|
|
9883
|
+
def.contentQueries(1 /* RenderFlags.Create */, lView[directiveIndex], directiveIndex);
|
|
9866
9884
|
}
|
|
9867
9885
|
}
|
|
9868
9886
|
}
|
|
@@ -9874,7 +9892,7 @@ function createDirectivesInstances(tView, lView, tNode) {
|
|
|
9874
9892
|
if (!getBindingsEnabled())
|
|
9875
9893
|
return;
|
|
9876
9894
|
instantiateAllDirectives(tView, lView, tNode, getNativeByTNode(tNode, lView));
|
|
9877
|
-
if ((tNode.flags & 128 /* hasHostBindings */) === 128 /* hasHostBindings */) {
|
|
9895
|
+
if ((tNode.flags & 128 /* TNodeFlags.hasHostBindings */) === 128 /* TNodeFlags.hasHostBindings */) {
|
|
9878
9896
|
invokeDirectivesHostBindings(tView, lView, tNode);
|
|
9879
9897
|
}
|
|
9880
9898
|
}
|
|
@@ -9910,7 +9928,7 @@ function getOrCreateTComponentView(def) {
|
|
|
9910
9928
|
// Declaration node here is null since this function is called when we dynamically create a
|
|
9911
9929
|
// component and hence there is no declaration.
|
|
9912
9930
|
const declTNode = null;
|
|
9913
|
-
return def.tView = createTView(1 /* Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts);
|
|
9931
|
+
return def.tView = createTView(1 /* TViewType.Component */, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts);
|
|
9914
9932
|
}
|
|
9915
9933
|
return tView;
|
|
9916
9934
|
}
|
|
@@ -10208,10 +10226,10 @@ function initializeInputAndOutputAliases(tView, tNode) {
|
|
|
10208
10226
|
}
|
|
10209
10227
|
if (inputsStore !== null) {
|
|
10210
10228
|
if (inputsStore.hasOwnProperty('class')) {
|
|
10211
|
-
tNode.flags |= 16 /* hasClassInput */;
|
|
10229
|
+
tNode.flags |= 16 /* TNodeFlags.hasClassInput */;
|
|
10212
10230
|
}
|
|
10213
10231
|
if (inputsStore.hasOwnProperty('style')) {
|
|
10214
|
-
tNode.flags |= 32 /* hasStyleInput */;
|
|
10232
|
+
tNode.flags |= 32 /* TNodeFlags.hasStyleInput */;
|
|
10215
10233
|
}
|
|
10216
10234
|
}
|
|
10217
10235
|
tNode.initialInputs = inputsFromAttrs;
|
|
@@ -10256,13 +10274,13 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
10256
10274
|
setNgReflectProperties(lView, element, tNode.type, dataValue, value);
|
|
10257
10275
|
}
|
|
10258
10276
|
}
|
|
10259
|
-
else if (tNode.type & 3 /* AnyRNode */) {
|
|
10277
|
+
else if (tNode.type & 3 /* TNodeType.AnyRNode */) {
|
|
10260
10278
|
propName = mapPropName(propName);
|
|
10261
10279
|
if (ngDevMode) {
|
|
10262
10280
|
validateAgainstEventProperties(propName);
|
|
10263
10281
|
if (!validateProperty(element, tNode.value, propName, tView.schemas)) {
|
|
10264
10282
|
// Return here since we only log warnings for unknown properties.
|
|
10265
|
-
|
|
10283
|
+
handleUnknownPropertyError(propName, tNode.value);
|
|
10266
10284
|
return;
|
|
10267
10285
|
}
|
|
10268
10286
|
ngDevMode.rendererSetProperty++;
|
|
@@ -10278,11 +10296,11 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
10278
10296
|
element[propName] = value;
|
|
10279
10297
|
}
|
|
10280
10298
|
}
|
|
10281
|
-
else if (tNode.type & 12 /* AnyContainer */) {
|
|
10299
|
+
else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
|
|
10282
10300
|
// If the node is a container and the property didn't
|
|
10283
10301
|
// match any of the inputs or schemas we should throw.
|
|
10284
10302
|
if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
|
|
10285
|
-
|
|
10303
|
+
handleUnknownPropertyError(propName, tNode.value);
|
|
10286
10304
|
}
|
|
10287
10305
|
}
|
|
10288
10306
|
}
|
|
@@ -10290,15 +10308,15 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
10290
10308
|
function markDirtyIfOnPush(lView, viewIndex) {
|
|
10291
10309
|
ngDevMode && assertLView(lView);
|
|
10292
10310
|
const childComponentLView = getComponentLViewByIndex(viewIndex, lView);
|
|
10293
|
-
if (!(childComponentLView[FLAGS] & 16 /* CheckAlways */)) {
|
|
10294
|
-
childComponentLView[FLAGS] |= 64 /* Dirty */;
|
|
10311
|
+
if (!(childComponentLView[FLAGS] & 16 /* LViewFlags.CheckAlways */)) {
|
|
10312
|
+
childComponentLView[FLAGS] |= 64 /* LViewFlags.Dirty */;
|
|
10295
10313
|
}
|
|
10296
10314
|
}
|
|
10297
10315
|
function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
10298
10316
|
const renderer = lView[RENDERER];
|
|
10299
10317
|
attrName = normalizeDebugBindingName(attrName);
|
|
10300
10318
|
const debugValue = normalizeDebugBindingValue(value);
|
|
10301
|
-
if (type & 3 /* AnyRNode */) {
|
|
10319
|
+
if (type & 3 /* TNodeType.AnyRNode */) {
|
|
10302
10320
|
if (value == null) {
|
|
10303
10321
|
isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :
|
|
10304
10322
|
element.removeAttribute(attrName);
|
|
@@ -10320,7 +10338,7 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
|
|
|
10320
10338
|
}
|
|
10321
10339
|
}
|
|
10322
10340
|
function setNgReflectProperties(lView, element, type, dataValue, value) {
|
|
10323
|
-
if (type & (3 /* AnyRNode */ | 4 /* Container */)) {
|
|
10341
|
+
if (type & (3 /* TNodeType.AnyRNode */ | 4 /* TNodeType.Container */)) {
|
|
10324
10342
|
/**
|
|
10325
10343
|
* dataValue is an array containing runtime input or output names for the directives:
|
|
10326
10344
|
* i+0: directive instance index
|
|
@@ -10384,13 +10402,18 @@ function matchingSchemas(schemas, tagName) {
|
|
|
10384
10402
|
return false;
|
|
10385
10403
|
}
|
|
10386
10404
|
/**
|
|
10387
|
-
* Logs an error that a property is not supported on an element.
|
|
10405
|
+
* Logs or throws an error that a property is not supported on an element.
|
|
10388
10406
|
* @param propName Name of the invalid property.
|
|
10389
10407
|
* @param tagName Name of the node on which we encountered the property.
|
|
10390
10408
|
*/
|
|
10391
|
-
function
|
|
10409
|
+
function handleUnknownPropertyError(propName, tagName) {
|
|
10392
10410
|
const message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'.`;
|
|
10393
|
-
|
|
10411
|
+
if (shouldThrowErrorOnUnknownProperty) {
|
|
10412
|
+
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
10413
|
+
}
|
|
10414
|
+
else {
|
|
10415
|
+
console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
|
|
10416
|
+
}
|
|
10394
10417
|
}
|
|
10395
10418
|
/**
|
|
10396
10419
|
* Instantiate a root component.
|
|
@@ -10451,9 +10474,9 @@ function resolveDirectives(tView, lView, tNode, localRefs) {
|
|
|
10451
10474
|
configureViewWithDirective(tView, tNode, lView, directiveIdx, def);
|
|
10452
10475
|
saveNameToExportMap(directiveIdx, def, exportsMap);
|
|
10453
10476
|
if (def.contentQueries !== null)
|
|
10454
|
-
tNode.flags |= 8 /* hasContentQuery */;
|
|
10477
|
+
tNode.flags |= 8 /* TNodeFlags.hasContentQuery */;
|
|
10455
10478
|
if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0)
|
|
10456
|
-
tNode.flags |= 128 /* hasHostBindings */;
|
|
10479
|
+
tNode.flags |= 128 /* TNodeFlags.hasHostBindings */;
|
|
10457
10480
|
const lifeCycleHooks = def.type.prototype;
|
|
10458
10481
|
// Only push a node index into the preOrderHooks array if this is the first
|
|
10459
10482
|
// pre-order hook found on this node.
|
|
@@ -10541,7 +10564,7 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
|
|
|
10541
10564
|
const def = tView.data[i];
|
|
10542
10565
|
const isComponent = isComponentDef(def);
|
|
10543
10566
|
if (isComponent) {
|
|
10544
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);
|
|
10567
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
|
|
10545
10568
|
addComponentLogic(lView, tNode, def);
|
|
10546
10569
|
}
|
|
10547
10570
|
const directive = getNodeInjectable(lView, tView, i, tNode);
|
|
@@ -10584,7 +10607,7 @@ function invokeDirectivesHostBindings(tView, lView, tNode) {
|
|
|
10584
10607
|
*/
|
|
10585
10608
|
function invokeHostBindingsInCreationMode(def, directive) {
|
|
10586
10609
|
if (def.hostBindings !== null) {
|
|
10587
|
-
def.hostBindings(1 /* Create */, directive);
|
|
10610
|
+
def.hostBindings(1 /* RenderFlags.Create */, directive);
|
|
10588
10611
|
}
|
|
10589
10612
|
}
|
|
10590
10613
|
/**
|
|
@@ -10593,7 +10616,7 @@ function invokeHostBindingsInCreationMode(def, directive) {
|
|
|
10593
10616
|
*/
|
|
10594
10617
|
function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
10595
10618
|
ngDevMode && assertFirstCreatePass(tView);
|
|
10596
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
|
|
10619
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
|
|
10597
10620
|
const registry = tView.directiveRegistry;
|
|
10598
10621
|
let matches = null;
|
|
10599
10622
|
if (registry) {
|
|
@@ -10604,9 +10627,9 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
|
10604
10627
|
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);
|
|
10605
10628
|
if (isComponentDef(def)) {
|
|
10606
10629
|
if (ngDevMode) {
|
|
10607
|
-
assertTNodeType(tNode, 2 /* Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
10630
|
+
assertTNodeType(tNode, 2 /* TNodeType.Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
10608
10631
|
`Please use a different tag to activate the ${stringify(def.type)} component.`);
|
|
10609
|
-
if (tNode.flags & 2 /* isComponentHost */) {
|
|
10632
|
+
if (tNode.flags & 2 /* TNodeFlags.isComponentHost */) {
|
|
10610
10633
|
// If another component has been matched previously, it's the first element in the
|
|
10611
10634
|
// `matches` array, see how we store components/directives in `matches` below.
|
|
10612
10635
|
throwMultipleComponentError(tNode, matches[0].type, def.type);
|
|
@@ -10631,7 +10654,7 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
|
10631
10654
|
*/
|
|
10632
10655
|
function markAsComponentHost(tView, hostTNode) {
|
|
10633
10656
|
ngDevMode && assertFirstCreatePass(tView);
|
|
10634
|
-
hostTNode.flags |= 2 /* isComponentHost */;
|
|
10657
|
+
hostTNode.flags |= 2 /* TNodeFlags.isComponentHost */;
|
|
10635
10658
|
(tView.components || (tView.components = ngDevMode ? new TViewComponents() : []))
|
|
10636
10659
|
.push(hostTNode.index);
|
|
10637
10660
|
}
|
|
@@ -10645,7 +10668,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
|
10645
10668
|
for (let i = 0; i < localRefs.length; i += 2) {
|
|
10646
10669
|
const index = exportsMap[localRefs[i + 1]];
|
|
10647
10670
|
if (index == null)
|
|
10648
|
-
throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
|
|
10671
|
+
throw new RuntimeError(-301 /* RuntimeErrorCode.EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
|
|
10649
10672
|
localNames.push(localRefs[i], index);
|
|
10650
10673
|
}
|
|
10651
10674
|
}
|
|
@@ -10673,7 +10696,7 @@ function saveNameToExportMap(directiveIdx, def, exportsMap) {
|
|
|
10673
10696
|
function initTNodeFlags(tNode, index, numberOfDirectives) {
|
|
10674
10697
|
ngDevMode &&
|
|
10675
10698
|
assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');
|
|
10676
|
-
tNode.flags |= 1 /* isDirectiveHost */;
|
|
10699
|
+
tNode.flags |= 1 /* TNodeFlags.isDirectiveHost */;
|
|
10677
10700
|
// When the first directive is created on a node, save the index
|
|
10678
10701
|
tNode.directiveStart = index;
|
|
10679
10702
|
tNode.directiveEnd = index + numberOfDirectives;
|
|
@@ -10707,7 +10730,7 @@ function addComponentLogic(lView, hostTNode, def) {
|
|
|
10707
10730
|
// Only component views should be added to the view tree directly. Embedded views are
|
|
10708
10731
|
// accessed through their containers because they may be removed / re-added later.
|
|
10709
10732
|
const rendererFactory = lView[RENDERER_FACTORY];
|
|
10710
|
-
const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null));
|
|
10733
|
+
const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null));
|
|
10711
10734
|
// Component view will always be created before any injected LContainers,
|
|
10712
10735
|
// so this is a regular element, wrap it with the component view
|
|
10713
10736
|
lView[hostTNode.index] = componentView;
|
|
@@ -10716,7 +10739,7 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
|
|
|
10716
10739
|
if (ngDevMode) {
|
|
10717
10740
|
assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
|
|
10718
10741
|
validateAgainstEventAttributes(name);
|
|
10719
|
-
assertTNodeType(tNode, 2 /* Element */, `Attempted to set attribute \`${name}\` on a container node. ` +
|
|
10742
|
+
assertTNodeType(tNode, 2 /* TNodeType.Element */, `Attempted to set attribute \`${name}\` on a container node. ` +
|
|
10720
10743
|
`Host bindings are not valid on ng-container or ng-template.`);
|
|
10721
10744
|
}
|
|
10722
10745
|
const element = getNativeByTNode(tNode, lView);
|
|
@@ -10789,12 +10812,12 @@ function generateInitialInputs(inputs, attrs) {
|
|
|
10789
10812
|
let i = 0;
|
|
10790
10813
|
while (i < attrs.length) {
|
|
10791
10814
|
const attrName = attrs[i];
|
|
10792
|
-
if (attrName === 0 /* NamespaceURI */) {
|
|
10815
|
+
if (attrName === 0 /* AttributeMarker.NamespaceURI */) {
|
|
10793
10816
|
// We do not allow inputs on namespaced attributes.
|
|
10794
10817
|
i += 4;
|
|
10795
10818
|
continue;
|
|
10796
10819
|
}
|
|
10797
|
-
else if (attrName === 5 /* ProjectAs */) {
|
|
10820
|
+
else if (attrName === 5 /* AttributeMarker.ProjectAs */) {
|
|
10798
10821
|
// Skip over the `ngProjectAs` value.
|
|
10799
10822
|
i += 2;
|
|
10800
10823
|
continue;
|
|
@@ -10879,14 +10902,14 @@ function markTransplantedViewsForRefresh(lView) {
|
|
|
10879
10902
|
ngDevMode && assertLContainer(insertionLContainer);
|
|
10880
10903
|
// We don't want to increment the counter if the moved LView was already marked for
|
|
10881
10904
|
// refresh.
|
|
10882
|
-
if ((movedLView[FLAGS] & 1024 /* RefreshTransplantedView */) === 0) {
|
|
10905
|
+
if ((movedLView[FLAGS] & 1024 /* LViewFlags.RefreshTransplantedView */) === 0) {
|
|
10883
10906
|
updateTransplantedViewCount(insertionLContainer, 1);
|
|
10884
10907
|
}
|
|
10885
10908
|
// Note, it is possible that the `movedViews` is tracking views that are transplanted *and*
|
|
10886
10909
|
// those that aren't (declaration component === insertion component). In the latter case,
|
|
10887
10910
|
// it's fine to add the flag, as we will clear it immediately in
|
|
10888
10911
|
// `refreshEmbeddedViews` for the view currently being refreshed.
|
|
10889
|
-
movedLView[FLAGS] |= 1024 /* RefreshTransplantedView */;
|
|
10912
|
+
movedLView[FLAGS] |= 1024 /* LViewFlags.RefreshTransplantedView */;
|
|
10890
10913
|
}
|
|
10891
10914
|
}
|
|
10892
10915
|
}
|
|
@@ -10902,7 +10925,7 @@ function refreshComponent(hostLView, componentHostIdx) {
|
|
|
10902
10925
|
// Only attached components that are CheckAlways or OnPush and dirty should be refreshed
|
|
10903
10926
|
if (viewAttachedToChangeDetector(componentView)) {
|
|
10904
10927
|
const tView = componentView[TVIEW];
|
|
10905
|
-
if (componentView[FLAGS] & (16 /* CheckAlways */ | 64 /* Dirty */)) {
|
|
10928
|
+
if (componentView[FLAGS] & (16 /* LViewFlags.CheckAlways */ | 64 /* LViewFlags.Dirty */)) {
|
|
10906
10929
|
refreshView(tView, componentView, tView.template, componentView[CONTEXT]);
|
|
10907
10930
|
}
|
|
10908
10931
|
else if (componentView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
|
|
@@ -10921,7 +10944,7 @@ function refreshContainsDirtyView(lView) {
|
|
|
10921
10944
|
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
|
|
10922
10945
|
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
10923
10946
|
const embeddedLView = lContainer[i];
|
|
10924
|
-
if (embeddedLView[FLAGS] & 1024 /* RefreshTransplantedView */) {
|
|
10947
|
+
if (embeddedLView[FLAGS] & 1024 /* LViewFlags.RefreshTransplantedView */) {
|
|
10925
10948
|
const embeddedTView = embeddedLView[TVIEW];
|
|
10926
10949
|
ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
|
|
10927
10950
|
refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
|
|
@@ -11025,7 +11048,7 @@ function addToViewTree(lView, lViewOrLContainer) {
|
|
|
11025
11048
|
*/
|
|
11026
11049
|
function markViewDirty(lView) {
|
|
11027
11050
|
while (lView) {
|
|
11028
|
-
lView[FLAGS] |= 64 /* Dirty */;
|
|
11051
|
+
lView[FLAGS] |= 64 /* LViewFlags.Dirty */;
|
|
11029
11052
|
const parent = getLViewParent(lView);
|
|
11030
11053
|
// Stop traversing up as soon as you find a root view that wasn't attached to any container
|
|
11031
11054
|
if (isRootView(lView) && !parent) {
|
|
@@ -11048,7 +11071,7 @@ function markViewDirty(lView) {
|
|
|
11048
11071
|
* `renderComponent`'s `scheduler` option.
|
|
11049
11072
|
*/
|
|
11050
11073
|
function scheduleTick(rootContext, flags) {
|
|
11051
|
-
const nothingScheduled = rootContext.flags === 0 /* Empty */;
|
|
11074
|
+
const nothingScheduled = rootContext.flags === 0 /* RootContextFlags.Empty */;
|
|
11052
11075
|
if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {
|
|
11053
11076
|
// https://github.com/angular/angular/issues/39296
|
|
11054
11077
|
// should only attach the flags when really scheduling a tick
|
|
@@ -11056,12 +11079,12 @@ function scheduleTick(rootContext, flags) {
|
|
|
11056
11079
|
let res;
|
|
11057
11080
|
rootContext.clean = new Promise((r) => res = r);
|
|
11058
11081
|
rootContext.scheduler(() => {
|
|
11059
|
-
if (rootContext.flags & 1 /* DetectChanges */) {
|
|
11060
|
-
rootContext.flags &= ~1 /* DetectChanges */;
|
|
11082
|
+
if (rootContext.flags & 1 /* RootContextFlags.DetectChanges */) {
|
|
11083
|
+
rootContext.flags &= ~1 /* RootContextFlags.DetectChanges */;
|
|
11061
11084
|
tickRootContext(rootContext);
|
|
11062
11085
|
}
|
|
11063
|
-
if (rootContext.flags & 2 /* FlushPlayers */) {
|
|
11064
|
-
rootContext.flags &= ~2 /* FlushPlayers */;
|
|
11086
|
+
if (rootContext.flags & 2 /* RootContextFlags.FlushPlayers */) {
|
|
11087
|
+
rootContext.flags &= ~2 /* RootContextFlags.FlushPlayers */;
|
|
11065
11088
|
const playerHandler = rootContext.playerHandler;
|
|
11066
11089
|
if (playerHandler) {
|
|
11067
11090
|
playerHandler.flushPlayers();
|
|
@@ -11276,10 +11299,10 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
|
|
|
11276
11299
|
if (typeof value === 'number') {
|
|
11277
11300
|
mode = value;
|
|
11278
11301
|
}
|
|
11279
|
-
else if (mode == 1 /* Classes */) {
|
|
11302
|
+
else if (mode == 1 /* AttributeMarker.Classes */) {
|
|
11280
11303
|
classes = concatStringsWithSpace(classes, value);
|
|
11281
11304
|
}
|
|
11282
|
-
else if (mode == 2 /* Styles */) {
|
|
11305
|
+
else if (mode == 2 /* AttributeMarker.Styles */) {
|
|
11283
11306
|
const style = value;
|
|
11284
11307
|
const styleValue = attrs[++i];
|
|
11285
11308
|
styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');
|
|
@@ -11321,7 +11344,7 @@ function markDirty(component) {
|
|
|
11321
11344
|
ngDevMode && assertDefined(component, 'component');
|
|
11322
11345
|
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
11323
11346
|
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
11324
|
-
scheduleTick(rootView[CONTEXT], 1 /* DetectChanges */);
|
|
11347
|
+
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
11325
11348
|
}
|
|
11326
11349
|
/**
|
|
11327
11350
|
* Used to perform change detection on the whole application.
|
|
@@ -11357,12 +11380,12 @@ function tick(component) {
|
|
|
11357
11380
|
* found in the LICENSE file at https://angular.io/license
|
|
11358
11381
|
*/
|
|
11359
11382
|
/**
|
|
11360
|
-
* A multi-provider token for initialization functions that will run upon construction of
|
|
11361
|
-
*
|
|
11383
|
+
* A multi-provider token for initialization functions that will run upon construction of an
|
|
11384
|
+
* environment injector.
|
|
11362
11385
|
*
|
|
11363
11386
|
* @publicApi
|
|
11364
11387
|
*/
|
|
11365
|
-
const
|
|
11388
|
+
const ENVIRONMENT_INITIALIZER = new InjectionToken('ENVIRONMENT_INITIALIZER');
|
|
11366
11389
|
|
|
11367
11390
|
/**
|
|
11368
11391
|
* @license
|
|
@@ -11384,14 +11407,27 @@ const INJECTOR_DEF_TYPES = new InjectionToken('INJECTOR_DEF_TYPES');
|
|
|
11384
11407
|
* Collects providers from all NgModules and standalone components, including transitively imported
|
|
11385
11408
|
* ones.
|
|
11386
11409
|
*
|
|
11387
|
-
*
|
|
11410
|
+
* Providers extracted via `importProvidersFrom` are only usable in an application injector or
|
|
11411
|
+
* another environment injector (such as a route injector). They should not be used in component
|
|
11412
|
+
* providers.
|
|
11413
|
+
*
|
|
11414
|
+
* @returns The collected providers from the specified list of types.
|
|
11388
11415
|
* @publicApi
|
|
11389
11416
|
*/
|
|
11390
11417
|
function importProvidersFrom(...sources) {
|
|
11418
|
+
return { ɵproviders: internalImportProvidersFrom(true, sources) };
|
|
11419
|
+
}
|
|
11420
|
+
function internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {
|
|
11391
11421
|
const providersOut = [];
|
|
11392
11422
|
const dedup = new Set(); // already seen types
|
|
11393
11423
|
let injectorTypesWithProviders;
|
|
11394
11424
|
deepForEach(sources, source => {
|
|
11425
|
+
if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {
|
|
11426
|
+
const cmpDef = getComponentDef(source);
|
|
11427
|
+
if (cmpDef === null || cmpDef === void 0 ? void 0 : cmpDef.standalone) {
|
|
11428
|
+
throw new RuntimeError(800 /* RuntimeErrorCode.IMPORT_PROVIDERS_FROM_STANDALONE */, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component "${stringifyForError(source)}"`);
|
|
11429
|
+
}
|
|
11430
|
+
}
|
|
11395
11431
|
// Narrow `source` to access the internal type analogue for `ModuleWithProviders`.
|
|
11396
11432
|
const internalSource = source;
|
|
11397
11433
|
if (walkProviderTree(internalSource, providersOut, [], dedup)) {
|
|
@@ -11521,8 +11557,8 @@ function walkProviderTree(container, providersOut, parents, dedup) {
|
|
|
11521
11557
|
{ provide: defType, useFactory: factory, deps: EMPTY_ARRAY },
|
|
11522
11558
|
// Make this `defType` available to an internal logic that calculates injector scope.
|
|
11523
11559
|
{ provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true },
|
|
11524
|
-
// Provider to eagerly instantiate `defType` via `
|
|
11525
|
-
{ provide:
|
|
11560
|
+
// Provider to eagerly instantiate `defType` via `ENVIRONMENT_INITIALIZER`.
|
|
11561
|
+
{ provide: ENVIRONMENT_INITIALIZER, useValue: () => ɵɵinject(defType), multi: true } //
|
|
11526
11562
|
);
|
|
11527
11563
|
}
|
|
11528
11564
|
// Next, include providers listed on the definition itself.
|
|
@@ -11588,7 +11624,7 @@ function isClassProvider(value) {
|
|
|
11588
11624
|
const INJECTOR = new InjectionToken('INJECTOR',
|
|
11589
11625
|
// Dissable tslint because this is const enum which gets inlined not top level prop access.
|
|
11590
11626
|
// tslint:disable-next-line: no-toplevel-property-access
|
|
11591
|
-
-1 /* Injector */);
|
|
11627
|
+
-1 /* InjectorMarkers.Injector */);
|
|
11592
11628
|
|
|
11593
11629
|
/**
|
|
11594
11630
|
* @license
|
|
@@ -11676,9 +11712,7 @@ class R3Injector extends EnvironmentInjector {
|
|
|
11676
11712
|
this._onDestroyHooks = [];
|
|
11677
11713
|
this._destroyed = false;
|
|
11678
11714
|
// Start off by creating Records for every provider.
|
|
11679
|
-
|
|
11680
|
-
this.processProvider(provider);
|
|
11681
|
-
}
|
|
11715
|
+
forEachSingleProvider(providers, provider => this.processProvider(provider));
|
|
11682
11716
|
// Make sure the INJECTOR token provides this injector.
|
|
11683
11717
|
this.records.set(INJECTOR, makeRecord(undefined, this));
|
|
11684
11718
|
// And `EnvironmentInjector` if the current injector is supposed to be env-scoped.
|
|
@@ -11797,7 +11831,7 @@ class R3Injector extends EnvironmentInjector {
|
|
|
11797
11831
|
const previousInjector = setCurrentInjector(this);
|
|
11798
11832
|
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
11799
11833
|
try {
|
|
11800
|
-
const initializers = this.get(
|
|
11834
|
+
const initializers = this.get(ENVIRONMENT_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);
|
|
11801
11835
|
for (const initializer of initializers) {
|
|
11802
11836
|
initializer();
|
|
11803
11837
|
}
|
|
@@ -11817,7 +11851,7 @@ class R3Injector extends EnvironmentInjector {
|
|
|
11817
11851
|
}
|
|
11818
11852
|
assertNotDestroyed() {
|
|
11819
11853
|
if (this._destroyed) {
|
|
11820
|
-
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
|
|
11854
|
+
throw new RuntimeError(205 /* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
|
|
11821
11855
|
}
|
|
11822
11856
|
}
|
|
11823
11857
|
/**
|
|
@@ -11892,21 +11926,21 @@ function injectableDefOrInjectorDefFactory(token) {
|
|
|
11892
11926
|
// InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
|
|
11893
11927
|
// If it's missing that, it's an error.
|
|
11894
11928
|
if (token instanceof InjectionToken) {
|
|
11895
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);
|
|
11929
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);
|
|
11896
11930
|
}
|
|
11897
11931
|
// Undecorated types can sometimes be created if they have no constructor arguments.
|
|
11898
11932
|
if (token instanceof Function) {
|
|
11899
11933
|
return getUndecoratedInjectableFactory(token);
|
|
11900
11934
|
}
|
|
11901
11935
|
// There was no way to resolve a factory for this token.
|
|
11902
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');
|
|
11936
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');
|
|
11903
11937
|
}
|
|
11904
11938
|
function getUndecoratedInjectableFactory(token) {
|
|
11905
11939
|
// If the token has parameters then it has dependencies that we cannot resolve implicitly.
|
|
11906
11940
|
const paramLength = token.length;
|
|
11907
11941
|
if (paramLength > 0) {
|
|
11908
11942
|
const args = newArray(paramLength, '?');
|
|
11909
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
|
|
11943
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
|
|
11910
11944
|
}
|
|
11911
11945
|
// The constructor function appears to have no parameters.
|
|
11912
11946
|
// This might be because it inherits from a super-class. In which case, use an injectable
|
|
@@ -11937,6 +11971,9 @@ function providerToRecord(provider) {
|
|
|
11937
11971
|
*/
|
|
11938
11972
|
function providerToFactory(provider, ngModuleType, providers) {
|
|
11939
11973
|
let factory = undefined;
|
|
11974
|
+
if (ngDevMode && isImportedNgModuleProviders(provider)) {
|
|
11975
|
+
throwInvalidProviderError(undefined, providers, provider);
|
|
11976
|
+
}
|
|
11940
11977
|
if (isTypeProvider(provider)) {
|
|
11941
11978
|
const unwrappedProvider = resolveForwardRef(provider);
|
|
11942
11979
|
return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);
|
|
@@ -11985,6 +12022,22 @@ function couldBeInjectableType(value) {
|
|
|
11985
12022
|
return (typeof value === 'function') ||
|
|
11986
12023
|
(typeof value === 'object' && value instanceof InjectionToken);
|
|
11987
12024
|
}
|
|
12025
|
+
function isImportedNgModuleProviders(provider) {
|
|
12026
|
+
return !!provider.ɵproviders;
|
|
12027
|
+
}
|
|
12028
|
+
function forEachSingleProvider(providers, fn) {
|
|
12029
|
+
for (const provider of providers) {
|
|
12030
|
+
if (Array.isArray(provider)) {
|
|
12031
|
+
forEachSingleProvider(provider, fn);
|
|
12032
|
+
}
|
|
12033
|
+
else if (isImportedNgModuleProviders(provider)) {
|
|
12034
|
+
forEachSingleProvider(provider.ɵproviders, fn);
|
|
12035
|
+
}
|
|
12036
|
+
else {
|
|
12037
|
+
fn(provider);
|
|
12038
|
+
}
|
|
12039
|
+
}
|
|
12040
|
+
}
|
|
11988
12041
|
|
|
11989
12042
|
/**
|
|
11990
12043
|
* @license
|
|
@@ -12010,8 +12063,8 @@ function createInjector(defType, parent = null, additionalProviders = null, name
|
|
|
12010
12063
|
*/
|
|
12011
12064
|
function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {
|
|
12012
12065
|
const providers = [
|
|
12013
|
-
|
|
12014
|
-
|
|
12066
|
+
additionalProviders || EMPTY_ARRAY,
|
|
12067
|
+
importProvidersFrom(defType),
|
|
12015
12068
|
];
|
|
12016
12069
|
name = name || (typeof defType === 'object' ? undefined : stringify(defType));
|
|
12017
12070
|
return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);
|
|
@@ -12072,7 +12125,7 @@ Injector.ɵprov = ɵɵdefineInjectable({
|
|
|
12072
12125
|
* @internal
|
|
12073
12126
|
* @nocollapse
|
|
12074
12127
|
*/
|
|
12075
|
-
Injector.__NG_ELEMENT_ID__ = -1 /* Injector */;
|
|
12128
|
+
Injector.__NG_ELEMENT_ID__ = -1 /* InjectorMarkers.Injector */;
|
|
12076
12129
|
|
|
12077
12130
|
/**
|
|
12078
12131
|
* @license
|
|
@@ -12161,10 +12214,10 @@ function getOwningComponent(elementOrDir) {
|
|
|
12161
12214
|
if (lView === null)
|
|
12162
12215
|
return null;
|
|
12163
12216
|
let parent;
|
|
12164
|
-
while (lView[TVIEW].type === 2 /* Embedded */ && (parent = getLViewParent(lView))) {
|
|
12217
|
+
while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
|
|
12165
12218
|
lView = parent;
|
|
12166
12219
|
}
|
|
12167
|
-
return lView[FLAGS] & 512 /* IsRoot */ ? null : lView[CONTEXT];
|
|
12220
|
+
return lView[FLAGS] & 512 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
|
|
12168
12221
|
}
|
|
12169
12222
|
/**
|
|
12170
12223
|
* Retrieves all root components associated with a DOM element, directive or component instance.
|
|
@@ -12212,7 +12265,7 @@ function getInjectionTokens(element) {
|
|
|
12212
12265
|
const tView = lView[TVIEW];
|
|
12213
12266
|
const tNode = tView.data[context.nodeIndex];
|
|
12214
12267
|
const providerTokens = [];
|
|
12215
|
-
const startIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
|
|
12268
|
+
const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
12216
12269
|
const endIndex = tNode.directiveEnd;
|
|
12217
12270
|
for (let i = startIndex; i < endIndex; i++) {
|
|
12218
12271
|
let value = tView.data[i];
|
|
@@ -12615,11 +12668,11 @@ function renderComponent(componentType /* Type as workaround for: Microsoft/Type
|
|
|
12615
12668
|
const componentTag = componentDef.selectors[0][0];
|
|
12616
12669
|
const hostRenderer = rendererFactory.createRenderer(null, null);
|
|
12617
12670
|
const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
|
|
12618
|
-
const rootFlags = componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :
|
|
12619
|
-
16 /* CheckAlways */ | 512 /* IsRoot */;
|
|
12671
|
+
const rootFlags = componentDef.onPush ? 64 /* LViewFlags.Dirty */ | 512 /* LViewFlags.IsRoot */ :
|
|
12672
|
+
16 /* LViewFlags.CheckAlways */ | 512 /* LViewFlags.IsRoot */;
|
|
12620
12673
|
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
12621
12674
|
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
12622
|
-
const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
|
|
12675
|
+
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
12623
12676
|
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
12624
12677
|
enterView(rootView);
|
|
12625
12678
|
let component;
|
|
@@ -12660,7 +12713,7 @@ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRend
|
|
|
12660
12713
|
// '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
|
|
12661
12714
|
// the same time we want to communicate the debug `TNode` that this is a special `TNode`
|
|
12662
12715
|
// representing a host element.
|
|
12663
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* Element */, '#host', null);
|
|
12716
|
+
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
|
|
12664
12717
|
const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
|
|
12665
12718
|
if (mergedAttrs !== null) {
|
|
12666
12719
|
computeStaticStyling(tNode, mergedAttrs, true);
|
|
@@ -12675,7 +12728,7 @@ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRend
|
|
|
12675
12728
|
}
|
|
12676
12729
|
}
|
|
12677
12730
|
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
12678
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
12731
|
+
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
12679
12732
|
if (tView.firstCreatePass) {
|
|
12680
12733
|
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
12681
12734
|
markAsComponentHost(tView, tNode);
|
|
@@ -12701,7 +12754,7 @@ function createRootComponent(componentView, componentDef, rootLView, rootContext
|
|
|
12701
12754
|
if (componentDef.contentQueries) {
|
|
12702
12755
|
const tNode = getCurrentTNode();
|
|
12703
12756
|
ngDevMode && assertDefined(tNode, 'TNode expected');
|
|
12704
|
-
componentDef.contentQueries(1 /* Create */, component, tNode.directiveStart);
|
|
12757
|
+
componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
|
|
12705
12758
|
}
|
|
12706
12759
|
const rootTNode = getCurrentTNode();
|
|
12707
12760
|
ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
|
|
@@ -12720,7 +12773,7 @@ function createRootContext(scheduler, playerHandler) {
|
|
|
12720
12773
|
scheduler: scheduler || defaultScheduler,
|
|
12721
12774
|
clean: CLEAN_PROMISE,
|
|
12722
12775
|
playerHandler: playerHandler || null,
|
|
12723
|
-
flags: 0 /* Empty */
|
|
12776
|
+
flags: 0 /* RootContextFlags.Empty */
|
|
12724
12777
|
};
|
|
12725
12778
|
}
|
|
12726
12779
|
/**
|
|
@@ -12795,7 +12848,7 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
12795
12848
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
12796
12849
|
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
|
|
12797
12850
|
'';
|
|
12798
|
-
throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
|
|
12851
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, errorMessage);
|
|
12799
12852
|
}
|
|
12800
12853
|
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
12801
12854
|
superDef = superType.ɵdir;
|
|
@@ -13743,10 +13796,10 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
|
|
|
13743
13796
|
ngDevMode && ngDevMode.firstCreatePass++;
|
|
13744
13797
|
const tViewConsts = tView.consts;
|
|
13745
13798
|
// TODO(pk): refactor getOrCreateTNode to have the "create" only version
|
|
13746
|
-
const tNode = getOrCreateTNode(tView, index, 4 /* Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
|
|
13799
|
+
const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
|
|
13747
13800
|
resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
|
|
13748
13801
|
registerPostOrderHooks(tView, tNode);
|
|
13749
|
-
const embeddedTView = tNode.tViews = createTView(2 /* Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
|
|
13802
|
+
const embeddedTView = tNode.tViews = createTView(2 /* TViewType.Embedded */, tNode, templateFn, decls, vars, tView.directiveRegistry, tView.pipeRegistry, null, tView.schemas, tViewConsts);
|
|
13750
13803
|
if (tView.queries !== null) {
|
|
13751
13804
|
tView.queries.template(tView, tNode);
|
|
13752
13805
|
embeddedTView.queries = tView.queries.embeddedTView(tNode);
|
|
@@ -13862,7 +13915,7 @@ function compileInjectable(type, meta) {
|
|
|
13862
13915
|
Object.defineProperty(type, NG_PROV_DEF, {
|
|
13863
13916
|
get: () => {
|
|
13864
13917
|
if (ngInjectableDef === null) {
|
|
13865
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
|
|
13918
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'injectable', type });
|
|
13866
13919
|
ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));
|
|
13867
13920
|
}
|
|
13868
13921
|
return ngInjectableDef;
|
|
@@ -13874,7 +13927,7 @@ function compileInjectable(type, meta) {
|
|
|
13874
13927
|
Object.defineProperty(type, NG_FACTORY_DEF, {
|
|
13875
13928
|
get: () => {
|
|
13876
13929
|
if (ngFactoryDef === null) {
|
|
13877
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
|
|
13930
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'injectable', type });
|
|
13878
13931
|
ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
|
|
13879
13932
|
name: type.name,
|
|
13880
13933
|
type,
|
|
@@ -14843,12 +14896,27 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
|
|
|
14843
14896
|
* Use of this source code is governed by an MIT-style license that can be
|
|
14844
14897
|
* found in the LICENSE file at https://angular.io/license
|
|
14845
14898
|
*/
|
|
14899
|
+
let shouldThrowErrorOnUnknownElement = false;
|
|
14900
|
+
/**
|
|
14901
|
+
* Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
|
|
14902
|
+
* instead of just logging the error.
|
|
14903
|
+
* (for AOT-compiled ones this check happens at build time).
|
|
14904
|
+
*/
|
|
14905
|
+
function ɵsetUnknownElementStrictMode(shouldThrow) {
|
|
14906
|
+
shouldThrowErrorOnUnknownElement = shouldThrow;
|
|
14907
|
+
}
|
|
14908
|
+
/**
|
|
14909
|
+
* Gets the current value of the strict mode.
|
|
14910
|
+
*/
|
|
14911
|
+
function ɵgetUnknownElementStrictMode() {
|
|
14912
|
+
return shouldThrowErrorOnUnknownElement;
|
|
14913
|
+
}
|
|
14846
14914
|
function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
|
|
14847
14915
|
ngDevMode && assertFirstCreatePass(tView);
|
|
14848
14916
|
ngDevMode && ngDevMode.firstCreatePass++;
|
|
14849
14917
|
const tViewConsts = tView.consts;
|
|
14850
14918
|
const attrs = getConstant(tViewConsts, attrsIndex);
|
|
14851
|
-
const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
|
|
14919
|
+
const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, name, attrs);
|
|
14852
14920
|
const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
|
|
14853
14921
|
ngDevMode && validateElementIsKnown(native, tNode.value, tView.schemas, hasDirectives);
|
|
14854
14922
|
if (tNode.attrs !== null) {
|
|
@@ -14902,7 +14970,7 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
|
|
|
14902
14970
|
if (styles !== null) {
|
|
14903
14971
|
writeDirectStyle(renderer, native, styles);
|
|
14904
14972
|
}
|
|
14905
|
-
if ((tNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
|
|
14973
|
+
if ((tNode.flags & 64 /* TNodeFlags.isDetached */) !== 64 /* TNodeFlags.isDetached */) {
|
|
14906
14974
|
// In the i18n case, the translation may have removed this element, so only add it if it is not
|
|
14907
14975
|
// detached. See `TNodeType.Placeholder` and `LFrame.inI18n` for more context.
|
|
14908
14976
|
appendChild(tView, lView, native, tNode);
|
|
@@ -14941,7 +15009,7 @@ function ɵɵelementEnd() {
|
|
|
14941
15009
|
setCurrentTNode(currentTNode, false);
|
|
14942
15010
|
}
|
|
14943
15011
|
const tNode = currentTNode;
|
|
14944
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */);
|
|
15012
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
|
|
14945
15013
|
decreaseElementDepthCount();
|
|
14946
15014
|
const tView = getTView();
|
|
14947
15015
|
if (tView.firstCreatePass) {
|
|
@@ -15020,7 +15088,12 @@ function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
|
|
|
15020
15088
|
message +=
|
|
15021
15089
|
`2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
15022
15090
|
}
|
|
15023
|
-
|
|
15091
|
+
if (shouldThrowErrorOnUnknownElement) {
|
|
15092
|
+
throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
|
|
15093
|
+
}
|
|
15094
|
+
else {
|
|
15095
|
+
console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
|
|
15096
|
+
}
|
|
15024
15097
|
}
|
|
15025
15098
|
}
|
|
15026
15099
|
}
|
|
@@ -15036,7 +15109,7 @@ function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, l
|
|
|
15036
15109
|
ngDevMode && ngDevMode.firstCreatePass++;
|
|
15037
15110
|
const tViewConsts = tView.consts;
|
|
15038
15111
|
const attrs = getConstant(tViewConsts, attrsIndex);
|
|
15039
|
-
const tNode = getOrCreateTNode(tView, index, 8 /* ElementContainer */, 'ng-container', attrs);
|
|
15112
|
+
const tNode = getOrCreateTNode(tView, index, 8 /* TNodeType.ElementContainer */, 'ng-container', attrs);
|
|
15040
15113
|
// While ng-container doesn't necessarily support styling, we use the style context to identify
|
|
15041
15114
|
// and execute directives on the ng-container.
|
|
15042
15115
|
if (attrs !== null) {
|
|
@@ -15106,7 +15179,7 @@ function ɵɵelementContainerEnd() {
|
|
|
15106
15179
|
currentTNode = currentTNode.parent;
|
|
15107
15180
|
setCurrentTNode(currentTNode, false);
|
|
15108
15181
|
}
|
|
15109
|
-
ngDevMode && assertTNodeType(currentTNode, 8 /* ElementContainer */);
|
|
15182
|
+
ngDevMode && assertTNodeType(currentTNode, 8 /* TNodeType.ElementContainer */);
|
|
15110
15183
|
if (tView.firstCreatePass) {
|
|
15111
15184
|
registerPostOrderHooks(tView, currentTNode);
|
|
15112
15185
|
if (isContentQueryHost(currentTNode)) {
|
|
@@ -15274,13 +15347,13 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15274
15347
|
// native listener or a directive output on this element. As such we we know that we will have to
|
|
15275
15348
|
// register a listener and store its cleanup function on LView.
|
|
15276
15349
|
const lCleanup = getOrCreateLViewCleanup(lView);
|
|
15277
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
|
|
15350
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
|
|
15278
15351
|
let processOutputs = true;
|
|
15279
15352
|
// Adding a native event listener is applicable when:
|
|
15280
15353
|
// - The corresponding TNode represents a DOM element.
|
|
15281
15354
|
// - The event target has a resolver (usually resulting in a global object,
|
|
15282
15355
|
// such as `window` or `document`).
|
|
15283
|
-
if ((tNode.type & 3 /* AnyRNode */) || eventTargetResolver) {
|
|
15356
|
+
if ((tNode.type & 3 /* TNodeType.AnyRNode */) || eventTargetResolver) {
|
|
15284
15357
|
const native = getNativeByTNode(tNode, lView);
|
|
15285
15358
|
const target = eventTargetResolver ? eventTargetResolver(native) : native;
|
|
15286
15359
|
const lCleanupIndex = lCleanup.length;
|
|
@@ -15366,7 +15439,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
15366
15439
|
}
|
|
15367
15440
|
function executeListenerWithErrorHandling(lView, context, listenerFn, e) {
|
|
15368
15441
|
try {
|
|
15369
|
-
profiler(6 /* OutputStart */, context, listenerFn);
|
|
15442
|
+
profiler(6 /* ProfilerEvent.OutputStart */, context, listenerFn);
|
|
15370
15443
|
// Only explicitly returning false from a listener should preventDefault
|
|
15371
15444
|
return listenerFn(e) !== false;
|
|
15372
15445
|
}
|
|
@@ -15375,7 +15448,7 @@ function executeListenerWithErrorHandling(lView, context, listenerFn, e) {
|
|
|
15375
15448
|
return false;
|
|
15376
15449
|
}
|
|
15377
15450
|
finally {
|
|
15378
|
-
profiler(7 /* OutputEnd */, context, listenerFn);
|
|
15451
|
+
profiler(7 /* ProfilerEvent.OutputEnd */, context, listenerFn);
|
|
15379
15452
|
}
|
|
15380
15453
|
}
|
|
15381
15454
|
/**
|
|
@@ -15399,11 +15472,11 @@ function wrapListener(tNode, lView, context, listenerFn, wrapWithPreventDefault)
|
|
|
15399
15472
|
}
|
|
15400
15473
|
// In order to be backwards compatible with View Engine, events on component host nodes
|
|
15401
15474
|
// must also mark the component view itself dirty (i.e. the view that it owns).
|
|
15402
|
-
const startView = tNode.flags & 2 /* isComponentHost */ ?
|
|
15475
|
+
const startView = tNode.flags & 2 /* TNodeFlags.isComponentHost */ ?
|
|
15403
15476
|
getComponentLViewByIndex(tNode.index, lView) :
|
|
15404
15477
|
lView;
|
|
15405
15478
|
// See interfaces/view.ts for more on LViewFlags.ManualOnPush
|
|
15406
|
-
if ((lView[FLAGS] & 32 /* ManualOnPush */) === 0) {
|
|
15479
|
+
if ((lView[FLAGS] & 32 /* LViewFlags.ManualOnPush */) === 0) {
|
|
15407
15480
|
markViewDirty(startView);
|
|
15408
15481
|
}
|
|
15409
15482
|
let result = executeListenerWithErrorHandling(lView, context, listenerFn, e);
|
|
@@ -15555,13 +15628,13 @@ function ɵɵprojectionDef(projectionSlots) {
|
|
|
15555
15628
|
function ɵɵprojection(nodeIndex, selectorIndex = 0, attrs) {
|
|
15556
15629
|
const lView = getLView();
|
|
15557
15630
|
const tView = getTView();
|
|
15558
|
-
const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* Projection */, null, attrs || null);
|
|
15631
|
+
const tProjectionNode = getOrCreateTNode(tView, HEADER_OFFSET + nodeIndex, 16 /* TNodeType.Projection */, null, attrs || null);
|
|
15559
15632
|
// We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.
|
|
15560
15633
|
if (tProjectionNode.projection === null)
|
|
15561
15634
|
tProjectionNode.projection = selectorIndex;
|
|
15562
15635
|
// `<ng-content>` has no content
|
|
15563
15636
|
setCurrentTNodeAsNotParent();
|
|
15564
|
-
if ((tProjectionNode.flags & 64 /* isDetached */) !== 64 /* isDetached */) {
|
|
15637
|
+
if ((tProjectionNode.flags & 64 /* TNodeFlags.isDetached */) !== 64 /* TNodeFlags.isDetached */) {
|
|
15565
15638
|
// re-distribution of projectable nodes is stored on a component's view level
|
|
15566
15639
|
applyProjection(tView, lView, tProjectionNode);
|
|
15567
15640
|
}
|
|
@@ -16547,10 +16620,10 @@ function parseStyleNext(text, startIndex) {
|
|
|
16547
16620
|
return -1;
|
|
16548
16621
|
}
|
|
16549
16622
|
index = parserState.keyEnd = consumeStyleKey(text, index, end);
|
|
16550
|
-
index = consumeSeparator(text, index, end, 58 /* COLON */);
|
|
16623
|
+
index = consumeSeparator(text, index, end, 58 /* CharCode.COLON */);
|
|
16551
16624
|
index = parserState.value = consumeWhitespace(text, index, end);
|
|
16552
16625
|
index = parserState.valueEnd = consumeStyleValue(text, index, end);
|
|
16553
|
-
return consumeSeparator(text, index, end, 59 /* SEMI_COLON */);
|
|
16626
|
+
return consumeSeparator(text, index, end, 59 /* CharCode.SEMI_COLON */);
|
|
16554
16627
|
}
|
|
16555
16628
|
/**
|
|
16556
16629
|
* Reset the global state of the styling parser.
|
|
@@ -16573,7 +16646,7 @@ function resetParserState(text) {
|
|
|
16573
16646
|
* that location.)
|
|
16574
16647
|
*/
|
|
16575
16648
|
function consumeWhitespace(text, startIndex, endIndex) {
|
|
16576
|
-
while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* SPACE */) {
|
|
16649
|
+
while (startIndex < endIndex && text.charCodeAt(startIndex) <= 32 /* CharCode.SPACE */) {
|
|
16577
16650
|
startIndex++;
|
|
16578
16651
|
}
|
|
16579
16652
|
return startIndex;
|
|
@@ -16587,7 +16660,7 @@ function consumeWhitespace(text, startIndex, endIndex) {
|
|
|
16587
16660
|
* @returns Index after last char in class token.
|
|
16588
16661
|
*/
|
|
16589
16662
|
function consumeClassToken(text, startIndex, endIndex) {
|
|
16590
|
-
while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* SPACE */) {
|
|
16663
|
+
while (startIndex < endIndex && text.charCodeAt(startIndex) > 32 /* CharCode.SPACE */) {
|
|
16591
16664
|
startIndex++;
|
|
16592
16665
|
}
|
|
16593
16666
|
return startIndex;
|
|
@@ -16603,9 +16676,9 @@ function consumeClassToken(text, startIndex, endIndex) {
|
|
|
16603
16676
|
function consumeStyleKey(text, startIndex, endIndex) {
|
|
16604
16677
|
let ch;
|
|
16605
16678
|
while (startIndex < endIndex &&
|
|
16606
|
-
((ch = text.charCodeAt(startIndex)) === 45 /* DASH */ || ch === 95 /* UNDERSCORE */ ||
|
|
16607
|
-
((ch & -33 /* UPPER_CASE */) >= 65 /* A */ && (ch & -33 /* UPPER_CASE */) <= 90 /* Z */) ||
|
|
16608
|
-
(ch >= 48 /* ZERO */ && ch <= 57 /* NINE */))) {
|
|
16679
|
+
((ch = text.charCodeAt(startIndex)) === 45 /* CharCode.DASH */ || ch === 95 /* CharCode.UNDERSCORE */ ||
|
|
16680
|
+
((ch & -33 /* CharCode.UPPER_CASE */) >= 65 /* CharCode.A */ && (ch & -33 /* CharCode.UPPER_CASE */) <= 90 /* CharCode.Z */) ||
|
|
16681
|
+
(ch >= 48 /* CharCode.ZERO */ && ch <= 57 /* CharCode.NINE */))) {
|
|
16609
16682
|
startIndex++;
|
|
16610
16683
|
}
|
|
16611
16684
|
return startIndex;
|
|
@@ -16644,25 +16717,25 @@ function consumeStyleValue(text, startIndex, endIndex) {
|
|
|
16644
16717
|
let lastChIndex = i;
|
|
16645
16718
|
while (i < endIndex) {
|
|
16646
16719
|
const ch = text.charCodeAt(i++);
|
|
16647
|
-
if (ch === 59 /* SEMI_COLON */) {
|
|
16720
|
+
if (ch === 59 /* CharCode.SEMI_COLON */) {
|
|
16648
16721
|
return lastChIndex;
|
|
16649
16722
|
}
|
|
16650
|
-
else if (ch === 34 /* DOUBLE_QUOTE */ || ch === 39 /* SINGLE_QUOTE */) {
|
|
16723
|
+
else if (ch === 34 /* CharCode.DOUBLE_QUOTE */ || ch === 39 /* CharCode.SINGLE_QUOTE */) {
|
|
16651
16724
|
lastChIndex = i = consumeQuotedText(text, ch, i, endIndex);
|
|
16652
16725
|
}
|
|
16653
16726
|
else if (startIndex ===
|
|
16654
16727
|
i - 4 && // We have seen only 4 characters so far "URL(" (Ignore "foo_URL()")
|
|
16655
|
-
ch3 === 85 /* U */ &&
|
|
16656
|
-
ch2 === 82 /* R */ && ch1 === 76 /* L */ && ch === 40 /* OPEN_PAREN */) {
|
|
16657
|
-
lastChIndex = i = consumeQuotedText(text, 41 /* CLOSE_PAREN */, i, endIndex);
|
|
16728
|
+
ch3 === 85 /* CharCode.U */ &&
|
|
16729
|
+
ch2 === 82 /* CharCode.R */ && ch1 === 76 /* CharCode.L */ && ch === 40 /* CharCode.OPEN_PAREN */) {
|
|
16730
|
+
lastChIndex = i = consumeQuotedText(text, 41 /* CharCode.CLOSE_PAREN */, i, endIndex);
|
|
16658
16731
|
}
|
|
16659
|
-
else if (ch > 32 /* SPACE */) {
|
|
16732
|
+
else if (ch > 32 /* CharCode.SPACE */) {
|
|
16660
16733
|
// if we have a non-whitespace character then capture its location
|
|
16661
16734
|
lastChIndex = i;
|
|
16662
16735
|
}
|
|
16663
16736
|
ch3 = ch2;
|
|
16664
16737
|
ch2 = ch1;
|
|
16665
|
-
ch1 = ch & -33 /* UPPER_CASE */;
|
|
16738
|
+
ch1 = ch & -33 /* CharCode.UPPER_CASE */;
|
|
16666
16739
|
}
|
|
16667
16740
|
return lastChIndex;
|
|
16668
16741
|
}
|
|
@@ -16680,10 +16753,10 @@ function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
|
|
|
16680
16753
|
let index = startIndex;
|
|
16681
16754
|
while (index < endIndex) {
|
|
16682
16755
|
const ch = text.charCodeAt(index++);
|
|
16683
|
-
if (ch == quoteCharCode && ch1 !== 92 /* BACK_SLASH */) {
|
|
16756
|
+
if (ch == quoteCharCode && ch1 !== 92 /* CharCode.BACK_SLASH */) {
|
|
16684
16757
|
return index;
|
|
16685
16758
|
}
|
|
16686
|
-
if (ch == 92 /* BACK_SLASH */ && ch1 === 92 /* BACK_SLASH */) {
|
|
16759
|
+
if (ch == 92 /* CharCode.BACK_SLASH */ && ch1 === 92 /* CharCode.BACK_SLASH */) {
|
|
16687
16760
|
// two back slashes cancel each other out. For example `"\\"` should properly end the
|
|
16688
16761
|
// quotation. (It should not assume that the last `"` is escaped.)
|
|
16689
16762
|
ch1 = 0;
|
|
@@ -17162,8 +17235,8 @@ function collectStylingFromDirectives(hostDirectiveDef, tData, tNode, stylingKey
|
|
|
17162
17235
|
* @param isClassBased `true` if `class` (`false` if `style`)
|
|
17163
17236
|
*/
|
|
17164
17237
|
function collectStylingFromTAttrs(stylingKey, attrs, isClassBased) {
|
|
17165
|
-
const desiredMarker = isClassBased ? 1 /* Classes */ : 2 /* Styles */;
|
|
17166
|
-
let currentMarker = -1 /* ImplicitAttributes */;
|
|
17238
|
+
const desiredMarker = isClassBased ? 1 /* AttributeMarker.Classes */ : 2 /* AttributeMarker.Styles */;
|
|
17239
|
+
let currentMarker = -1 /* AttributeMarker.ImplicitAttributes */;
|
|
17167
17240
|
if (attrs !== null) {
|
|
17168
17241
|
for (let i = 0; i < attrs.length; i++) {
|
|
17169
17242
|
const item = attrs[i];
|
|
@@ -17333,7 +17406,7 @@ function updateStylingMap(tView, tNode, lView, renderer, oldKeyValueArray, newKe
|
|
|
17333
17406
|
* @param bindingIndex Binding index of the binding.
|
|
17334
17407
|
*/
|
|
17335
17408
|
function updateStyling(tView, tNode, lView, renderer, prop, value, isClassBased, bindingIndex) {
|
|
17336
|
-
if (!(tNode.type & 3 /* AnyRNode */)) {
|
|
17409
|
+
if (!(tNode.type & 3 /* TNodeType.AnyRNode */)) {
|
|
17337
17410
|
// It is possible to have styling on non-elements (such as ng-container).
|
|
17338
17411
|
// This is rare, but it does happen. In such a case, just ignore the binding.
|
|
17339
17412
|
return;
|
|
@@ -17475,7 +17548,7 @@ function normalizeSuffix(value, suffix) {
|
|
|
17475
17548
|
* @param isClassBased `true` if `class` (`false` if `style`)
|
|
17476
17549
|
*/
|
|
17477
17550
|
function hasStylingInputShadow(tNode, isClassBased) {
|
|
17478
|
-
return (tNode.flags & (isClassBased ? 16 /* hasClassInput */ : 32 /* hasStyleInput */)) !== 0;
|
|
17551
|
+
return (tNode.flags & (isClassBased ? 16 /* TNodeFlags.hasClassInput */ : 32 /* TNodeFlags.hasStyleInput */)) !== 0;
|
|
17479
17552
|
}
|
|
17480
17553
|
|
|
17481
17554
|
/**
|
|
@@ -17501,7 +17574,7 @@ function ɵɵtext(index, value = '') {
|
|
|
17501
17574
|
assertEqual(getBindingIndex(), tView.bindingStartIndex, 'text nodes should be created before any bindings');
|
|
17502
17575
|
ngDevMode && assertIndexInRange(lView, adjustedIndex);
|
|
17503
17576
|
const tNode = tView.firstCreatePass ?
|
|
17504
|
-
getOrCreateTNode(tView, adjustedIndex, 1 /* Text */, value, null) :
|
|
17577
|
+
getOrCreateTNode(tView, adjustedIndex, 1 /* TNodeType.Text */, value, null) :
|
|
17505
17578
|
tView.data[adjustedIndex];
|
|
17506
17579
|
const textNative = lView[adjustedIndex] = createTextNode(lView[RENDERER], value);
|
|
17507
17580
|
appendChild(tView, lView, textNative, tNode);
|
|
@@ -19163,11 +19236,11 @@ function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parent
|
|
|
19163
19236
|
ngDevMode && assertDomNode(childRNode);
|
|
19164
19237
|
let i18nParent = childRNode;
|
|
19165
19238
|
let anchorRNode = null;
|
|
19166
|
-
if (!(childTNode.type & 3 /* AnyRNode */)) {
|
|
19239
|
+
if (!(childTNode.type & 3 /* TNodeType.AnyRNode */)) {
|
|
19167
19240
|
anchorRNode = i18nParent;
|
|
19168
19241
|
i18nParent = parentRElement;
|
|
19169
19242
|
}
|
|
19170
|
-
if (i18nParent !== null && (childTNode.flags & 2 /* isComponentHost */) === 0) {
|
|
19243
|
+
if (i18nParent !== null && (childTNode.flags & 2 /* TNodeFlags.isComponentHost */) === 0) {
|
|
19171
19244
|
for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {
|
|
19172
19245
|
// No need to `unwrapRNode` because all of the indexes point to i18n text nodes.
|
|
19173
19246
|
// see `assertDomNode` below.
|
|
@@ -19237,7 +19310,7 @@ function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {
|
|
|
19237
19310
|
}
|
|
19238
19311
|
}
|
|
19239
19312
|
function isI18nText(tNode) {
|
|
19240
|
-
return !(tNode.type & 64 /* Placeholder */);
|
|
19313
|
+
return !(tNode.type & 64 /* TNodeType.Placeholder */);
|
|
19241
19314
|
}
|
|
19242
19315
|
function isNewTNodeCreatedBefore(existingTNode, newTNode) {
|
|
19243
19316
|
return isI18nText(newTNode) || existingTNode.index > newTNode.index;
|
|
@@ -19317,7 +19390,7 @@ function setTIcu(tView, index, tIcu) {
|
|
|
19317
19390
|
tView.data[index] = tIcu;
|
|
19318
19391
|
}
|
|
19319
19392
|
else {
|
|
19320
|
-
ngDevMode && assertTNodeType(tNode, 32 /* Icu */);
|
|
19393
|
+
ngDevMode && assertTNodeType(tNode, 32 /* TNodeType.Icu */);
|
|
19321
19394
|
tNode.value = tIcu;
|
|
19322
19395
|
}
|
|
19323
19396
|
}
|
|
@@ -19345,7 +19418,7 @@ function setTNodeInsertBeforeIndex(tNode, index) {
|
|
|
19345
19418
|
* See `TNodeType.Placeholder` for more information.
|
|
19346
19419
|
*/
|
|
19347
19420
|
function createTNodePlaceholder(tView, previousTNodes, index) {
|
|
19348
|
-
const tNode = createTNodeAtIndex(tView, index, 64 /* Placeholder */, null, null);
|
|
19421
|
+
const tNode = createTNodeAtIndex(tView, index, 64 /* TNodeType.Placeholder */, null, null);
|
|
19349
19422
|
addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);
|
|
19350
19423
|
return tNode;
|
|
19351
19424
|
}
|
|
@@ -19362,18 +19435,18 @@ function getCurrentICUCaseIndex(tIcu, lView) {
|
|
|
19362
19435
|
return currentCase === null ? currentCase : (currentCase < 0 ? ~currentCase : currentCase);
|
|
19363
19436
|
}
|
|
19364
19437
|
function getParentFromIcuCreateOpCode(mergedCode) {
|
|
19365
|
-
return mergedCode >>> 17 /* SHIFT_PARENT */;
|
|
19438
|
+
return mergedCode >>> 17 /* IcuCreateOpCode.SHIFT_PARENT */;
|
|
19366
19439
|
}
|
|
19367
19440
|
function getRefFromIcuCreateOpCode(mergedCode) {
|
|
19368
|
-
return (mergedCode & 131070 /* MASK_REF */) >>> 1 /* SHIFT_REF */;
|
|
19441
|
+
return (mergedCode & 131070 /* IcuCreateOpCode.MASK_REF */) >>> 1 /* IcuCreateOpCode.SHIFT_REF */;
|
|
19369
19442
|
}
|
|
19370
19443
|
function getInstructionFromIcuCreateOpCode(mergedCode) {
|
|
19371
|
-
return mergedCode & 1 /* MASK_INSTRUCTION */;
|
|
19444
|
+
return mergedCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */;
|
|
19372
19445
|
}
|
|
19373
19446
|
function icuCreateOpCode(opCode, parentIdx, refIdx) {
|
|
19374
19447
|
ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');
|
|
19375
19448
|
ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');
|
|
19376
|
-
return opCode | parentIdx << 17 /* SHIFT_PARENT */ | refIdx << 1 /* SHIFT_REF */;
|
|
19449
|
+
return opCode | parentIdx << 17 /* IcuCreateOpCode.SHIFT_PARENT */ | refIdx << 1 /* IcuCreateOpCode.SHIFT_REF */;
|
|
19377
19450
|
}
|
|
19378
19451
|
|
|
19379
19452
|
/**
|
|
@@ -19490,8 +19563,8 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
|
|
|
19490
19563
|
}
|
|
19491
19564
|
}
|
|
19492
19565
|
else if (typeof opCode == 'number') {
|
|
19493
|
-
switch (opCode & 1 /* MASK_INSTRUCTION */) {
|
|
19494
|
-
case 0 /* AppendChild */:
|
|
19566
|
+
switch (opCode & 1 /* IcuCreateOpCode.MASK_INSTRUCTION */) {
|
|
19567
|
+
case 0 /* IcuCreateOpCode.AppendChild */:
|
|
19495
19568
|
const parentIdx = getParentFromIcuCreateOpCode(opCode);
|
|
19496
19569
|
if (rootIdx === null) {
|
|
19497
19570
|
// The first operation should save the `rootIdx` because the first operation
|
|
@@ -19536,8 +19609,8 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
|
|
|
19536
19609
|
}
|
|
19537
19610
|
}
|
|
19538
19611
|
break;
|
|
19539
|
-
case 1 /* Attr */:
|
|
19540
|
-
const elementNodeIndex = opCode >>> 1 /* SHIFT_REF */;
|
|
19612
|
+
case 1 /* IcuCreateOpCode.Attr */:
|
|
19613
|
+
const elementNodeIndex = opCode >>> 1 /* IcuCreateOpCode.SHIFT_REF */;
|
|
19541
19614
|
const attrName = mutableOpCodes[++i];
|
|
19542
19615
|
const attrValue = mutableOpCodes[++i];
|
|
19543
19616
|
// This code is used for ICU expressions only, since we don't support
|
|
@@ -19546,7 +19619,7 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
|
|
|
19546
19619
|
break;
|
|
19547
19620
|
default:
|
|
19548
19621
|
if (ngDevMode) {
|
|
19549
|
-
throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
|
|
19622
|
+
throw new RuntimeError(700 /* RuntimeErrorCode.INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
|
|
19550
19623
|
}
|
|
19551
19624
|
}
|
|
19552
19625
|
}
|
|
@@ -19617,9 +19690,9 @@ function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, cha
|
|
|
19617
19690
|
value += renderStringify(lView[bindingsStartIndex - opCode]);
|
|
19618
19691
|
}
|
|
19619
19692
|
else {
|
|
19620
|
-
const nodeIndex = (opCode >>> 2 /* SHIFT_REF */);
|
|
19621
|
-
switch (opCode & 3 /* MASK_OPCODE */) {
|
|
19622
|
-
case 1 /* Attr */:
|
|
19693
|
+
const nodeIndex = (opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */);
|
|
19694
|
+
switch (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) {
|
|
19695
|
+
case 1 /* I18nUpdateOpCode.Attr */:
|
|
19623
19696
|
const propName = updateOpCodes[++j];
|
|
19624
19697
|
const sanitizeFn = updateOpCodes[++j];
|
|
19625
19698
|
const tNodeOrTagName = tView.data[nodeIndex];
|
|
@@ -19634,14 +19707,14 @@ function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, cha
|
|
|
19634
19707
|
elementPropertyInternal(tView, tNodeOrTagName, lView, propName, value, lView[RENDERER], sanitizeFn, false);
|
|
19635
19708
|
}
|
|
19636
19709
|
break;
|
|
19637
|
-
case 0 /* Text */:
|
|
19710
|
+
case 0 /* I18nUpdateOpCode.Text */:
|
|
19638
19711
|
const rText = lView[nodeIndex];
|
|
19639
19712
|
rText !== null && updateTextNode(lView[RENDERER], rText, value);
|
|
19640
19713
|
break;
|
|
19641
|
-
case 2 /* IcuSwitch */:
|
|
19714
|
+
case 2 /* I18nUpdateOpCode.IcuSwitch */:
|
|
19642
19715
|
applyIcuSwitchCase(tView, getTIcu(tView, nodeIndex), lView, value);
|
|
19643
19716
|
break;
|
|
19644
|
-
case 3 /* IcuUpdate */:
|
|
19717
|
+
case 3 /* I18nUpdateOpCode.IcuUpdate */:
|
|
19645
19718
|
applyIcuUpdateCase(tView, getTIcu(tView, nodeIndex), bindingsStartIndex, lView);
|
|
19646
19719
|
break;
|
|
19647
19720
|
}
|
|
@@ -19651,12 +19724,12 @@ function applyUpdateOpCodes(tView, lView, updateOpCodes, bindingsStartIndex, cha
|
|
|
19651
19724
|
}
|
|
19652
19725
|
else {
|
|
19653
19726
|
const opCode = updateOpCodes[i + 1];
|
|
19654
|
-
if (opCode > 0 && (opCode & 3 /* MASK_OPCODE */) === 3 /* IcuUpdate */) {
|
|
19727
|
+
if (opCode > 0 && (opCode & 3 /* I18nUpdateOpCode.MASK_OPCODE */) === 3 /* I18nUpdateOpCode.IcuUpdate */) {
|
|
19655
19728
|
// Special case for the `icuUpdateCase`. It could be that the mask did not match, but
|
|
19656
19729
|
// we still need to execute `icuUpdateCase` because the case has changed recently due to
|
|
19657
19730
|
// previous `icuSwitchCase` instruction. (`icuSwitchCase` and `icuUpdateCase` always come in
|
|
19658
19731
|
// pairs.)
|
|
19659
|
-
const nodeIndex = (opCode >>> 2 /* SHIFT_REF */);
|
|
19732
|
+
const nodeIndex = (opCode >>> 2 /* I18nUpdateOpCode.SHIFT_REF */);
|
|
19660
19733
|
const tIcu = getTIcu(tView, nodeIndex);
|
|
19661
19734
|
const currentIndex = lView[tIcu.currentCaseLViewIndex];
|
|
19662
19735
|
if (currentIndex < 0) {
|
|
@@ -19754,7 +19827,7 @@ function getCaseIndex(icuExpression, bindingValue) {
|
|
|
19754
19827
|
let index = icuExpression.cases.indexOf(bindingValue);
|
|
19755
19828
|
if (index === -1) {
|
|
19756
19829
|
switch (icuExpression.type) {
|
|
19757
|
-
case 1 /* plural */: {
|
|
19830
|
+
case 1 /* IcuType.plural */: {
|
|
19758
19831
|
const resolvedCase = getPluralCase(bindingValue, getLocaleId());
|
|
19759
19832
|
index = icuExpression.cases.indexOf(resolvedCase);
|
|
19760
19833
|
if (index === -1 && resolvedCase !== 'other') {
|
|
@@ -19762,7 +19835,7 @@ function getCaseIndex(icuExpression, bindingValue) {
|
|
|
19762
19835
|
}
|
|
19763
19836
|
break;
|
|
19764
19837
|
}
|
|
19765
|
-
case 0 /* select */: {
|
|
19838
|
+
case 0 /* IcuType.select */: {
|
|
19766
19839
|
index = icuExpression.cases.indexOf('other');
|
|
19767
19840
|
break;
|
|
19768
19841
|
}
|
|
@@ -19898,19 +19971,19 @@ function i18nUpdateOpCodesToString(opcodes) {
|
|
|
19898
19971
|
const parser = new OpCodeParser(opcodes || (Array.isArray(this) ? this : []));
|
|
19899
19972
|
let lines = [];
|
|
19900
19973
|
function consumeOpCode(value) {
|
|
19901
|
-
const ref = value >>> 2 /* SHIFT_REF */;
|
|
19902
|
-
const opCode = value & 3 /* MASK_OPCODE */;
|
|
19974
|
+
const ref = value >>> 2 /* I18nUpdateOpCode.SHIFT_REF */;
|
|
19975
|
+
const opCode = value & 3 /* I18nUpdateOpCode.MASK_OPCODE */;
|
|
19903
19976
|
switch (opCode) {
|
|
19904
|
-
case 0 /* Text */:
|
|
19977
|
+
case 0 /* I18nUpdateOpCode.Text */:
|
|
19905
19978
|
return `(lView[${ref}] as Text).textContent = $$$`;
|
|
19906
|
-
case 1 /* Attr */:
|
|
19979
|
+
case 1 /* I18nUpdateOpCode.Attr */:
|
|
19907
19980
|
const attrName = parser.consumeString();
|
|
19908
19981
|
const sanitizationFn = parser.consumeFunction();
|
|
19909
19982
|
const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';
|
|
19910
19983
|
return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;
|
|
19911
|
-
case 2 /* IcuSwitch */:
|
|
19984
|
+
case 2 /* I18nUpdateOpCode.IcuSwitch */:
|
|
19912
19985
|
return `icuSwitchCase(${ref}, $$$)`;
|
|
19913
|
-
case 3 /* IcuUpdate */:
|
|
19986
|
+
case 3 /* I18nUpdateOpCode.IcuUpdate */:
|
|
19914
19987
|
return `icuUpdateCase(${ref})`;
|
|
19915
19988
|
}
|
|
19916
19989
|
throw new Error('unexpected OpCode');
|
|
@@ -19960,9 +20033,9 @@ function icuCreateOpCodesToString(opcodes) {
|
|
|
19960
20033
|
const parent = getParentFromIcuCreateOpCode(opCode);
|
|
19961
20034
|
const ref = getRefFromIcuCreateOpCode(opCode);
|
|
19962
20035
|
switch (getInstructionFromIcuCreateOpCode(opCode)) {
|
|
19963
|
-
case 0 /* AppendChild */:
|
|
20036
|
+
case 0 /* IcuCreateOpCode.AppendChild */:
|
|
19964
20037
|
return `(lView[${parent}] as Element).appendChild(lView[${lastRef}])`;
|
|
19965
|
-
case 1 /* Attr */:
|
|
20038
|
+
case 1 /* IcuCreateOpCode.Attr */:
|
|
19966
20039
|
return `(lView[${ref}] as Element).setAttribute("${parser.consumeString()}", "${parser.consumeString()}")`;
|
|
19967
20040
|
}
|
|
19968
20041
|
throw new Error('Unexpected OpCode: ' + getInstructionFromIcuCreateOpCode(opCode));
|
|
@@ -20152,9 +20225,9 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
|
|
|
20152
20225
|
else {
|
|
20153
20226
|
// Odd indexes are placeholders (elements and sub-templates)
|
|
20154
20227
|
// At this point value is something like: '/#1:2' (originally coming from '�/#1:2�')
|
|
20155
|
-
const isClosing = value.charCodeAt(0) === 47 /* SLASH */;
|
|
20228
|
+
const isClosing = value.charCodeAt(0) === 47 /* CharCode.SLASH */;
|
|
20156
20229
|
const type = value.charCodeAt(isClosing ? 1 : 0);
|
|
20157
|
-
ngDevMode && assertOneOf(type, 42 /* STAR */, 35 /* HASH */);
|
|
20230
|
+
ngDevMode && assertOneOf(type, 42 /* CharCode.STAR */, 35 /* CharCode.HASH */);
|
|
20158
20231
|
const index = HEADER_OFFSET + Number.parseInt(value.substring((isClosing ? 2 : 1)));
|
|
20159
20232
|
if (isClosing) {
|
|
20160
20233
|
existingTNodeStack.shift();
|
|
@@ -20208,7 +20281,7 @@ function createTNodeAndAddOpCode(tView, rootTNode, existingTNodes, lView, create
|
|
|
20208
20281
|
createOpCodes.push(opCode, text === null ? '' : text);
|
|
20209
20282
|
// We store `{{?}}` so that when looking at debug `TNodeType.template` we can see where the
|
|
20210
20283
|
// bindings are.
|
|
20211
|
-
const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* Icu */ : 1 /* Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);
|
|
20284
|
+
const tNode = createTNodeAtIndex(tView, i18nNodeIdx, isICU ? 32 /* TNodeType.Icu */ : 1 /* TNodeType.Text */, text === null ? (ngDevMode ? '{{?}}' : '') : text, null);
|
|
20212
20285
|
addTNodeAndUpdateInsertBeforeIndex(existingTNodes, tNode);
|
|
20213
20286
|
const tNodeIdx = tNode.index;
|
|
20214
20287
|
setCurrentTNode(tNode, false /* Text nodes are self closing */);
|
|
@@ -20314,8 +20387,8 @@ function generateBindingUpdateOpCodes(updateOpCodes, str, destinationNode, attrN
|
|
|
20314
20387
|
updateOpCodes.push(textValue);
|
|
20315
20388
|
}
|
|
20316
20389
|
}
|
|
20317
|
-
updateOpCodes.push(destinationNode << 2 /* SHIFT_REF */ |
|
|
20318
|
-
(attrName ? 1 /* Attr */ : 0 /* Text */));
|
|
20390
|
+
updateOpCodes.push(destinationNode << 2 /* I18nUpdateOpCode.SHIFT_REF */ |
|
|
20391
|
+
(attrName ? 1 /* I18nUpdateOpCode.Attr */ : 0 /* I18nUpdateOpCode.Text */));
|
|
20319
20392
|
if (attrName) {
|
|
20320
20393
|
updateOpCodes.push(attrName, sanitizeFn);
|
|
20321
20394
|
}
|
|
@@ -20466,14 +20539,14 @@ function icuStart(tView, lView, updateOpCodes, parentIdx, icuExpression, anchorI
|
|
|
20466
20539
|
function parseICUBlock(pattern) {
|
|
20467
20540
|
const cases = [];
|
|
20468
20541
|
const values = [];
|
|
20469
|
-
let icuType = 1 /* plural */;
|
|
20542
|
+
let icuType = 1 /* IcuType.plural */;
|
|
20470
20543
|
let mainBinding = 0;
|
|
20471
20544
|
pattern = pattern.replace(ICU_BLOCK_REGEXP, function (str, binding, type) {
|
|
20472
20545
|
if (type === 'select') {
|
|
20473
|
-
icuType = 0 /* select */;
|
|
20546
|
+
icuType = 0 /* IcuType.select */;
|
|
20474
20547
|
}
|
|
20475
20548
|
else {
|
|
20476
|
-
icuType = 1 /* plural */;
|
|
20549
|
+
icuType = 1 /* IcuType.plural */;
|
|
20477
20550
|
}
|
|
20478
20551
|
mainBinding = parseInt(binding.slice(1), 10);
|
|
20479
20552
|
return '';
|
|
@@ -20482,7 +20555,7 @@ function parseICUBlock(pattern) {
|
|
|
20482
20555
|
// Looking for (key block)+ sequence. One of the keys has to be "other".
|
|
20483
20556
|
for (let pos = 0; pos < parts.length;) {
|
|
20484
20557
|
let key = parts[pos++].trim();
|
|
20485
|
-
if (icuType === 1 /* plural */) {
|
|
20558
|
+
if (icuType === 1 /* IcuType.plural */) {
|
|
20486
20559
|
// Key can be "=x", we just want "x"
|
|
20487
20560
|
key = key.replace(/\s*(?:=)?(\w+)\s*/, '$1');
|
|
20488
20561
|
}
|
|
@@ -20661,19 +20734,19 @@ function addRemoveNestedIcu(remove, index, depth) {
|
|
|
20661
20734
|
}
|
|
20662
20735
|
}
|
|
20663
20736
|
function addUpdateIcuSwitch(update, icuExpression, index) {
|
|
20664
|
-
update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* SHIFT_REF */ | 2 /* IcuSwitch */);
|
|
20737
|
+
update.push(toMaskBit(icuExpression.mainBinding), 2, -1 - icuExpression.mainBinding, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 2 /* I18nUpdateOpCode.IcuSwitch */);
|
|
20665
20738
|
}
|
|
20666
20739
|
function addUpdateIcuUpdate(update, bindingMask, index) {
|
|
20667
|
-
update.push(bindingMask, 1, index << 2 /* SHIFT_REF */ | 3 /* IcuUpdate */);
|
|
20740
|
+
update.push(bindingMask, 1, index << 2 /* I18nUpdateOpCode.SHIFT_REF */ | 3 /* I18nUpdateOpCode.IcuUpdate */);
|
|
20668
20741
|
}
|
|
20669
20742
|
function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createAtIdx) {
|
|
20670
20743
|
if (marker !== null) {
|
|
20671
20744
|
create.push(marker);
|
|
20672
20745
|
}
|
|
20673
|
-
create.push(text, createAtIdx, icuCreateOpCode(0 /* AppendChild */, appendToParentIdx, createAtIdx));
|
|
20746
|
+
create.push(text, createAtIdx, icuCreateOpCode(0 /* IcuCreateOpCode.AppendChild */, appendToParentIdx, createAtIdx));
|
|
20674
20747
|
}
|
|
20675
20748
|
function addCreateAttribute(create, newIndex, attr) {
|
|
20676
|
-
create.push(newIndex << 1 /* SHIFT_REF */ | 1 /* Attr */, attr.name, attr.value);
|
|
20749
|
+
create.push(newIndex << 1 /* IcuCreateOpCode.SHIFT_REF */ | 1 /* IcuCreateOpCode.Attr */, attr.name, attr.value);
|
|
20677
20750
|
}
|
|
20678
20751
|
|
|
20679
20752
|
/**
|
|
@@ -20844,7 +20917,7 @@ function ɵɵi18nStart(index, messageIndex, subTemplateIndex = -1) {
|
|
|
20844
20917
|
const parentRNode = getClosestRElement(tView, sameViewParentTNode, lView);
|
|
20845
20918
|
// If `parentTNode` is an `ElementContainer` than it has `<!--ng-container--->`.
|
|
20846
20919
|
// When we do inserts we have to make sure to insert in front of `<!--ng-container--->`.
|
|
20847
|
-
const insertInFrontOf = parentTNode && (parentTNode.type & 8 /* ElementContainer */) ?
|
|
20920
|
+
const insertInFrontOf = parentTNode && (parentTNode.type & 8 /* TNodeType.ElementContainer */) ?
|
|
20848
20921
|
lView[parentTNode.index] :
|
|
20849
20922
|
null;
|
|
20850
20923
|
applyCreateOpCodes(lView, tI18n.create, parentRNode, insertInFrontOf);
|
|
@@ -21015,9 +21088,9 @@ function resolveProvider(provider, tInjectables, lInjectablesBlueprint, isCompon
|
|
|
21015
21088
|
let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);
|
|
21016
21089
|
let providerFactory = providerToFactory(provider);
|
|
21017
21090
|
const tNode = getCurrentTNode();
|
|
21018
|
-
const beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;
|
|
21091
|
+
const beginIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
21019
21092
|
const endIndex = tNode.directiveStart;
|
|
21020
|
-
const cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */;
|
|
21093
|
+
const cptViewProvidersCount = tNode.providerIndexes >> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */;
|
|
21021
21094
|
if (isTypeProvider(provider) || !provider.multi) {
|
|
21022
21095
|
// Single provider case: the factory is created and pushed immediately
|
|
21023
21096
|
const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);
|
|
@@ -21029,7 +21102,7 @@ function resolveProvider(provider, tInjectables, lInjectablesBlueprint, isCompon
|
|
|
21029
21102
|
tNode.directiveStart++;
|
|
21030
21103
|
tNode.directiveEnd++;
|
|
21031
21104
|
if (isViewProvider) {
|
|
21032
|
-
tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;
|
|
21105
|
+
tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;
|
|
21033
21106
|
}
|
|
21034
21107
|
lInjectablesBlueprint.push(factory);
|
|
21035
21108
|
lView.push(factory);
|
|
@@ -21079,7 +21152,7 @@ function resolveProvider(provider, tInjectables, lInjectablesBlueprint, isCompon
|
|
|
21079
21152
|
tNode.directiveStart++;
|
|
21080
21153
|
tNode.directiveEnd++;
|
|
21081
21154
|
if (isViewProvider) {
|
|
21082
|
-
tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;
|
|
21155
|
+
tNode.providerIndexes += 1048576 /* TNodeProviderIndexes.CptViewProvidersCountShifter */;
|
|
21083
21156
|
}
|
|
21084
21157
|
lInjectablesBlueprint.push(factory);
|
|
21085
21158
|
lView.push(factory);
|
|
@@ -21509,7 +21582,7 @@ class Version {
|
|
|
21509
21582
|
/**
|
|
21510
21583
|
* @publicApi
|
|
21511
21584
|
*/
|
|
21512
|
-
const VERSION = new Version('14.0.0-next.
|
|
21585
|
+
const VERSION = new Version('14.0.0-next.16');
|
|
21513
21586
|
|
|
21514
21587
|
/**
|
|
21515
21588
|
* @license
|
|
@@ -21547,7 +21620,7 @@ const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
|
|
|
21547
21620
|
function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
|
|
21548
21621
|
while (tNode !== null) {
|
|
21549
21622
|
ngDevMode &&
|
|
21550
|
-
assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */ | 16 /* Projection */ | 32 /* Icu */);
|
|
21623
|
+
assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 16 /* TNodeType.Projection */ | 32 /* TNodeType.Icu */);
|
|
21551
21624
|
const lNode = lView[tNode.index];
|
|
21552
21625
|
if (lNode !== null) {
|
|
21553
21626
|
result.push(unwrapRNode(lNode));
|
|
@@ -21565,17 +21638,17 @@ function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
|
|
|
21565
21638
|
}
|
|
21566
21639
|
}
|
|
21567
21640
|
const tNodeType = tNode.type;
|
|
21568
|
-
if (tNodeType & 8 /* ElementContainer */) {
|
|
21641
|
+
if (tNodeType & 8 /* TNodeType.ElementContainer */) {
|
|
21569
21642
|
collectNativeNodes(tView, lView, tNode.child, result);
|
|
21570
21643
|
}
|
|
21571
|
-
else if (tNodeType & 32 /* Icu */) {
|
|
21644
|
+
else if (tNodeType & 32 /* TNodeType.Icu */) {
|
|
21572
21645
|
const nextRNode = icuContainerIterate(tNode, lView);
|
|
21573
21646
|
let rNode;
|
|
21574
21647
|
while (rNode = nextRNode()) {
|
|
21575
21648
|
result.push(rNode);
|
|
21576
21649
|
}
|
|
21577
21650
|
}
|
|
21578
|
-
else if (tNodeType & 16 /* Projection */) {
|
|
21651
|
+
else if (tNodeType & 16 /* TNodeType.Projection */) {
|
|
21579
21652
|
const nodesInSlot = getProjectionNodes(lView, tNode);
|
|
21580
21653
|
if (Array.isArray(nodesInSlot)) {
|
|
21581
21654
|
result.push(...nodesInSlot);
|
|
@@ -21636,7 +21709,7 @@ class ViewRef$1 {
|
|
|
21636
21709
|
this._lView[CONTEXT] = value;
|
|
21637
21710
|
}
|
|
21638
21711
|
get destroyed() {
|
|
21639
|
-
return (this._lView[FLAGS] & 256 /* Destroyed */) === 256 /* Destroyed */;
|
|
21712
|
+
return (this._lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;
|
|
21640
21713
|
}
|
|
21641
21714
|
destroy() {
|
|
21642
21715
|
if (this._appRef) {
|
|
@@ -21749,7 +21822,7 @@ class ViewRef$1 {
|
|
|
21749
21822
|
* ```
|
|
21750
21823
|
*/
|
|
21751
21824
|
detach() {
|
|
21752
|
-
this._lView[FLAGS] &= ~128 /* Attached */;
|
|
21825
|
+
this._lView[FLAGS] &= ~128 /* LViewFlags.Attached */;
|
|
21753
21826
|
}
|
|
21754
21827
|
/**
|
|
21755
21828
|
* Re-attaches a view to the change detection tree.
|
|
@@ -21808,7 +21881,7 @@ class ViewRef$1 {
|
|
|
21808
21881
|
* ```
|
|
21809
21882
|
*/
|
|
21810
21883
|
reattach() {
|
|
21811
|
-
this._lView[FLAGS] |= 128 /* Attached */;
|
|
21884
|
+
this._lView[FLAGS] |= 128 /* LViewFlags.Attached */;
|
|
21812
21885
|
}
|
|
21813
21886
|
/**
|
|
21814
21887
|
* Checks the view and its children.
|
|
@@ -21846,7 +21919,7 @@ class ViewRef$1 {
|
|
|
21846
21919
|
attachToViewContainerRef() {
|
|
21847
21920
|
if (this._appRef) {
|
|
21848
21921
|
const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
|
|
21849
|
-
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21922
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21850
21923
|
}
|
|
21851
21924
|
this._attachedToViewContainer = true;
|
|
21852
21925
|
}
|
|
@@ -21857,7 +21930,7 @@ class ViewRef$1 {
|
|
|
21857
21930
|
attachToAppRef(appRef) {
|
|
21858
21931
|
if (this._attachedToViewContainer) {
|
|
21859
21932
|
const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
|
|
21860
|
-
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21933
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21861
21934
|
}
|
|
21862
21935
|
this._appRef = appRef;
|
|
21863
21936
|
}
|
|
@@ -21980,11 +22053,11 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
21980
22053
|
const hostRNode = rootSelectorOrNode ?
|
|
21981
22054
|
locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
|
|
21982
22055
|
createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
|
|
21983
|
-
const rootFlags = this.componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :
|
|
21984
|
-
16 /* CheckAlways */ | 512 /* IsRoot */;
|
|
22056
|
+
const rootFlags = this.componentDef.onPush ? 64 /* LViewFlags.Dirty */ | 512 /* LViewFlags.IsRoot */ :
|
|
22057
|
+
16 /* LViewFlags.CheckAlways */ | 512 /* LViewFlags.IsRoot */;
|
|
21985
22058
|
const rootContext = createRootContext();
|
|
21986
22059
|
// Create the root view. Uses empty TView and ContentTemplate.
|
|
21987
|
-
const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
|
|
22060
|
+
const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
|
|
21988
22061
|
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
21989
22062
|
// rootView is the parent when bootstrapping
|
|
21990
22063
|
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
@@ -22205,9 +22278,9 @@ class StandaloneService {
|
|
|
22205
22278
|
return null;
|
|
22206
22279
|
}
|
|
22207
22280
|
if (!this.cachedInjectors.has(componentDef)) {
|
|
22208
|
-
const providers =
|
|
22281
|
+
const providers = internalImportProvidersFrom(false, componentDef.type);
|
|
22209
22282
|
const standaloneInjector = providers.length > 0 ?
|
|
22210
|
-
createEnvironmentInjector(providers, this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22283
|
+
createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22211
22284
|
null;
|
|
22212
22285
|
this.cachedInjectors.set(componentDef, standaloneInjector);
|
|
22213
22286
|
}
|
|
@@ -22226,6 +22299,7 @@ class StandaloneService {
|
|
|
22226
22299
|
}
|
|
22227
22300
|
}
|
|
22228
22301
|
}
|
|
22302
|
+
/** @nocollapse */
|
|
22229
22303
|
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22230
22304
|
token: StandaloneService,
|
|
22231
22305
|
providedIn: 'environment',
|
|
@@ -22714,7 +22788,7 @@ function getPipeDef(name, registry) {
|
|
|
22714
22788
|
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
|
|
22715
22789
|
const context = declarationLView[CONTEXT];
|
|
22716
22790
|
const component = context ? ` in the '${context.constructor.name}' component` : '';
|
|
22717
|
-
throw new RuntimeError(-302 /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
|
|
22791
|
+
throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
|
|
22718
22792
|
}
|
|
22719
22793
|
}
|
|
22720
22794
|
/**
|
|
@@ -23089,7 +23163,7 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
|
|
|
23089
23163
|
}
|
|
23090
23164
|
createEmbeddedView(context, injector) {
|
|
23091
23165
|
const embeddedTView = this._declarationTContainer.tViews;
|
|
23092
|
-
const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
|
|
23166
|
+
const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* LViewFlags.CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
|
|
23093
23167
|
const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
|
|
23094
23168
|
ngDevMode && assertLContainer(declarationLContainer);
|
|
23095
23169
|
embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
|
|
@@ -23117,7 +23191,7 @@ function injectTemplateRef() {
|
|
|
23117
23191
|
* @returns The TemplateRef instance or null if we can't create a TemplateRef on a given node type
|
|
23118
23192
|
*/
|
|
23119
23193
|
function createTemplateRef(hostTNode, hostLView) {
|
|
23120
|
-
if (hostTNode.type & 4 /* Container */) {
|
|
23194
|
+
if (hostTNode.type & 4 /* TNodeType.Container */) {
|
|
23121
23195
|
ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');
|
|
23122
23196
|
return new R3TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));
|
|
23123
23197
|
}
|
|
@@ -23186,7 +23260,7 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
23186
23260
|
const parentView = getParentInjectorView(parentLocation, this._hostLView);
|
|
23187
23261
|
const injectorIndex = getParentInjectorIndex(parentLocation);
|
|
23188
23262
|
ngDevMode && assertNodeInjector(parentView, injectorIndex);
|
|
23189
|
-
const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* TNODE */];
|
|
23263
|
+
const parentTNode = parentView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
23190
23264
|
return new NodeInjector(parentTNode, parentView);
|
|
23191
23265
|
}
|
|
23192
23266
|
else {
|
|
@@ -23389,7 +23463,7 @@ function getOrCreateViewRefs(lContainer) {
|
|
|
23389
23463
|
* @returns The ViewContainerRef instance to use
|
|
23390
23464
|
*/
|
|
23391
23465
|
function createContainerRef(hostTNode, hostLView) {
|
|
23392
|
-
ngDevMode && assertTNodeType(hostTNode, 12 /* AnyContainer */ | 3 /* AnyRNode */);
|
|
23466
|
+
ngDevMode && assertTNodeType(hostTNode, 12 /* TNodeType.AnyContainer */ | 3 /* TNodeType.AnyRNode */);
|
|
23393
23467
|
let lContainer;
|
|
23394
23468
|
const slotValue = hostLView[hostTNode.index];
|
|
23395
23469
|
if (isLContainer(slotValue)) {
|
|
@@ -23402,7 +23476,7 @@ function createContainerRef(hostTNode, hostLView) {
|
|
|
23402
23476
|
// comment and we can reuse that comment as anchor element for the new LContainer.
|
|
23403
23477
|
// The comment node in question is already part of the DOM structure so we don't need to append
|
|
23404
23478
|
// it again.
|
|
23405
|
-
if (hostTNode.type & 8 /* ElementContainer */) {
|
|
23479
|
+
if (hostTNode.type & 8 /* TNodeType.ElementContainer */) {
|
|
23406
23480
|
commentNode = unwrapRNode(slotValue);
|
|
23407
23481
|
}
|
|
23408
23482
|
else {
|
|
@@ -23598,7 +23672,7 @@ class TQuery_ {
|
|
|
23598
23672
|
}
|
|
23599
23673
|
isApplyingToNode(tNode) {
|
|
23600
23674
|
if (this._appliesToNextNode &&
|
|
23601
|
-
(this.metadata.flags & 1 /* descendants */) !== 1 /* descendants */) {
|
|
23675
|
+
(this.metadata.flags & 1 /* QueryFlags.descendants */) !== 1 /* QueryFlags.descendants */) {
|
|
23602
23676
|
const declarationNodeIdx = this._declarationNodeIndex;
|
|
23603
23677
|
let parent = tNode.parent;
|
|
23604
23678
|
// Determine if a given TNode is a "direct" child of a node on which a content query was
|
|
@@ -23611,7 +23685,7 @@ class TQuery_ {
|
|
|
23611
23685
|
// - <needs-target><ng-container><i #target></i></ng-container></needs-target>: here we need
|
|
23612
23686
|
// to go past `<ng-container>` to determine <i #target> parent node (but we shouldn't traverse
|
|
23613
23687
|
// up past the query's host node!).
|
|
23614
|
-
while (parent !== null && (parent.type & 8 /* ElementContainer */) &&
|
|
23688
|
+
while (parent !== null && (parent.type & 8 /* TNodeType.ElementContainer */) &&
|
|
23615
23689
|
parent.index !== declarationNodeIdx) {
|
|
23616
23690
|
parent = parent.parent;
|
|
23617
23691
|
}
|
|
@@ -23631,7 +23705,7 @@ class TQuery_ {
|
|
|
23631
23705
|
}
|
|
23632
23706
|
else {
|
|
23633
23707
|
if (predicate === TemplateRef) {
|
|
23634
|
-
if (tNode.type & 4 /* Container */) {
|
|
23708
|
+
if (tNode.type & 4 /* TNodeType.Container */) {
|
|
23635
23709
|
this.matchTNodeWithReadOption(tView, tNode, -1);
|
|
23636
23710
|
}
|
|
23637
23711
|
}
|
|
@@ -23645,7 +23719,7 @@ class TQuery_ {
|
|
|
23645
23719
|
const read = this.metadata.read;
|
|
23646
23720
|
if (read !== null) {
|
|
23647
23721
|
if (read === ElementRef || read === ViewContainerRef ||
|
|
23648
|
-
read === TemplateRef && (tNode.type & 4 /* Container */)) {
|
|
23722
|
+
read === TemplateRef && (tNode.type & 4 /* TNodeType.Container */)) {
|
|
23649
23723
|
this.addMatch(tNode.index, -2);
|
|
23650
23724
|
}
|
|
23651
23725
|
else {
|
|
@@ -23689,10 +23763,10 @@ function getIdxOfMatchingSelector(tNode, selector) {
|
|
|
23689
23763
|
return null;
|
|
23690
23764
|
}
|
|
23691
23765
|
function createResultByTNodeType(tNode, currentView) {
|
|
23692
|
-
if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {
|
|
23766
|
+
if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {
|
|
23693
23767
|
return createElementRef(tNode, currentView);
|
|
23694
23768
|
}
|
|
23695
|
-
else if (tNode.type & 4 /* Container */) {
|
|
23769
|
+
else if (tNode.type & 4 /* TNodeType.Container */) {
|
|
23696
23770
|
return createTemplateRef(tNode, currentView);
|
|
23697
23771
|
}
|
|
23698
23772
|
return null;
|
|
@@ -23719,7 +23793,7 @@ function createSpecialToken(lView, tNode, read) {
|
|
|
23719
23793
|
return createTemplateRef(tNode, lView);
|
|
23720
23794
|
}
|
|
23721
23795
|
else if (read === ViewContainerRef) {
|
|
23722
|
-
ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);
|
|
23796
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */);
|
|
23723
23797
|
return createContainerRef(tNode, lView);
|
|
23724
23798
|
}
|
|
23725
23799
|
else {
|
|
@@ -23812,7 +23886,7 @@ function ɵɵqueryRefresh(queryList) {
|
|
|
23812
23886
|
const tQuery = getTQuery(tView, queryIndex);
|
|
23813
23887
|
if (queryList.dirty &&
|
|
23814
23888
|
(isCreationMode(lView) ===
|
|
23815
|
-
((tQuery.metadata.flags & 2 /* isStatic */) === 2 /* isStatic */))) {
|
|
23889
|
+
((tQuery.metadata.flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */))) {
|
|
23816
23890
|
if (tQuery.matches === null) {
|
|
23817
23891
|
queryList.reset([]);
|
|
23818
23892
|
}
|
|
@@ -23841,7 +23915,7 @@ function ɵɵviewQuery(predicate, flags, read) {
|
|
|
23841
23915
|
const tView = getTView();
|
|
23842
23916
|
if (tView.firstCreatePass) {
|
|
23843
23917
|
createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);
|
|
23844
|
-
if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
|
|
23918
|
+
if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {
|
|
23845
23919
|
tView.staticViewQueries = true;
|
|
23846
23920
|
}
|
|
23847
23921
|
}
|
|
@@ -23866,7 +23940,7 @@ function ɵɵcontentQuery(directiveIndex, predicate, flags, read) {
|
|
|
23866
23940
|
const tNode = getCurrentTNode();
|
|
23867
23941
|
createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
|
|
23868
23942
|
saveContentQueryAndDirectiveIndex(tView, directiveIndex);
|
|
23869
|
-
if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
|
|
23943
|
+
if ((flags & 2 /* QueryFlags.isStatic */) === 2 /* QueryFlags.isStatic */) {
|
|
23870
23944
|
tView.staticContentQueries = true;
|
|
23871
23945
|
}
|
|
23872
23946
|
}
|
|
@@ -23887,7 +23961,7 @@ function loadQueryInternal(lView, queryIndex) {
|
|
|
23887
23961
|
return lView[QUERIES].queries[queryIndex].queryList;
|
|
23888
23962
|
}
|
|
23889
23963
|
function createLQuery(tView, lView, flags) {
|
|
23890
|
-
const queryList = new QueryList((flags & 4 /* emitDistinctChangesOnly */) === 4 /* emitDistinctChangesOnly */);
|
|
23964
|
+
const queryList = new QueryList((flags & 4 /* QueryFlags.emitDistinctChangesOnly */) === 4 /* QueryFlags.emitDistinctChangesOnly */);
|
|
23891
23965
|
storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
|
|
23892
23966
|
if (lView[QUERIES] === null)
|
|
23893
23967
|
lView[QUERIES] = new LQueries_();
|
|
@@ -24132,6 +24206,20 @@ function patchModuleCompilation() {
|
|
|
24132
24206
|
// Does nothing, but exists as a target for patching.
|
|
24133
24207
|
}
|
|
24134
24208
|
|
|
24209
|
+
/**
|
|
24210
|
+
* @license
|
|
24211
|
+
* Copyright Google LLC All Rights Reserved.
|
|
24212
|
+
*
|
|
24213
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
24214
|
+
* found in the LICENSE file at https://angular.io/license
|
|
24215
|
+
*/
|
|
24216
|
+
function isModuleWithProviders(value) {
|
|
24217
|
+
return value.ngModule !== undefined;
|
|
24218
|
+
}
|
|
24219
|
+
function isNgModule(value) {
|
|
24220
|
+
return !!getNgModuleDef(value);
|
|
24221
|
+
}
|
|
24222
|
+
|
|
24135
24223
|
/**
|
|
24136
24224
|
* @license
|
|
24137
24225
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -24219,7 +24307,7 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
24219
24307
|
// go into an infinite loop before we've reached the point where we throw all the errors.
|
|
24220
24308
|
throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
|
|
24221
24309
|
}
|
|
24222
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
24310
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'NgModule', type: moduleType });
|
|
24223
24311
|
ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {
|
|
24224
24312
|
type: moduleType,
|
|
24225
24313
|
bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
|
|
@@ -24248,7 +24336,7 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
24248
24336
|
Object.defineProperty(moduleType, NG_FACTORY_DEF, {
|
|
24249
24337
|
get: () => {
|
|
24250
24338
|
if (ngFactoryDef === null) {
|
|
24251
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
24339
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'NgModule', type: moduleType });
|
|
24252
24340
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {
|
|
24253
24341
|
name: moduleType.name,
|
|
24254
24342
|
type: moduleType,
|
|
@@ -24277,7 +24365,7 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
24277
24365
|
(ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),
|
|
24278
24366
|
],
|
|
24279
24367
|
};
|
|
24280
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
|
|
24368
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'NgModule', type: moduleType });
|
|
24281
24369
|
ngInjectorDef =
|
|
24282
24370
|
compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);
|
|
24283
24371
|
}
|
|
@@ -24294,7 +24382,7 @@ function isStandalone(type) {
|
|
|
24294
24382
|
function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
|
|
24295
24383
|
if (verifiedNgModule.get(moduleType))
|
|
24296
24384
|
return;
|
|
24297
|
-
// skip verifications of standalone components,
|
|
24385
|
+
// skip verifications of standalone components, directives and pipes
|
|
24298
24386
|
if (isStandalone(moduleType))
|
|
24299
24387
|
return;
|
|
24300
24388
|
verifiedNgModule.set(moduleType, true);
|
|
@@ -24319,6 +24407,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24319
24407
|
const exports = maybeUnwrapFn(ngModuleDef.exports);
|
|
24320
24408
|
declarations.forEach(verifyDeclarationsHaveDefinitions);
|
|
24321
24409
|
declarations.forEach(verifyDirectivesHaveSelector);
|
|
24410
|
+
declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
|
|
24322
24411
|
const combinedDeclarations = [
|
|
24323
24412
|
...declarations.map(resolveForwardRef),
|
|
24324
24413
|
...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),
|
|
@@ -24357,6 +24446,13 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24357
24446
|
errors.push(`Directive ${stringifyForError(type)} has no selector, please add it!`);
|
|
24358
24447
|
}
|
|
24359
24448
|
}
|
|
24449
|
+
function verifyNotStandalone(type, moduleType) {
|
|
24450
|
+
type = resolveForwardRef(type);
|
|
24451
|
+
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24452
|
+
if (def === null || def === void 0 ? void 0 : def.standalone) {
|
|
24453
|
+
errors.push(`Unexpected "${stringifyForError(type)}" declaration in "${stringifyForError(moduleType)}" NgModule. "${stringifyForError(type)}" is marked as standalone and can't be declared in any NgModule - did you intend to import it?`);
|
|
24454
|
+
}
|
|
24455
|
+
}
|
|
24360
24456
|
function verifyExportsAreDeclaredOrReExported(type) {
|
|
24361
24457
|
type = resolveForwardRef(type);
|
|
24362
24458
|
const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' ||
|
|
@@ -24389,7 +24485,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24389
24485
|
function verifyComponentIsPartOfNgModule(type) {
|
|
24390
24486
|
type = resolveForwardRef(type);
|
|
24391
24487
|
const existingModule = ownerNgModule.get(type);
|
|
24392
|
-
if (!existingModule) {
|
|
24488
|
+
if (!existingModule && !isStandalone(type)) {
|
|
24393
24489
|
errors.push(`Component ${stringifyForError(type)} is not part of any NgModule or the module has not been imported into your module.`);
|
|
24394
24490
|
}
|
|
24395
24491
|
}
|
|
@@ -24398,6 +24494,13 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24398
24494
|
if (!getComponentDef(type)) {
|
|
24399
24495
|
errors.push(`${stringifyForError(type)} cannot be used as an entry component.`);
|
|
24400
24496
|
}
|
|
24497
|
+
if (isStandalone(type)) {
|
|
24498
|
+
// Note: this error should be the same as the
|
|
24499
|
+
// `NGMODULE_BOOTSTRAP_IS_STANDALONE` one in AOT compiler.
|
|
24500
|
+
errors.push(`The \`${stringifyForError(type)}\` class is a standalone component, which can ` +
|
|
24501
|
+
`not be used in the \`@NgModule.bootstrap\` array. Use the \`bootstrapApplication\` ` +
|
|
24502
|
+
`function for bootstrap instead.`);
|
|
24503
|
+
}
|
|
24401
24504
|
}
|
|
24402
24505
|
function verifyComponentEntryComponentsIsPartOfNgModule(type) {
|
|
24403
24506
|
type = resolveForwardRef(type);
|
|
@@ -24641,12 +24744,6 @@ function expandModuleWithProviders(value) {
|
|
|
24641
24744
|
}
|
|
24642
24745
|
return value;
|
|
24643
24746
|
}
|
|
24644
|
-
function isModuleWithProviders(value) {
|
|
24645
|
-
return value.ngModule !== undefined;
|
|
24646
|
-
}
|
|
24647
|
-
function isNgModule(value) {
|
|
24648
|
-
return !!getNgModuleDef(value);
|
|
24649
|
-
}
|
|
24650
24747
|
|
|
24651
24748
|
/**
|
|
24652
24749
|
* @license
|
|
@@ -24692,7 +24789,7 @@ function compileComponent(type, metadata) {
|
|
|
24692
24789
|
Object.defineProperty(type, NG_COMP_DEF, {
|
|
24693
24790
|
get: () => {
|
|
24694
24791
|
if (ngComponentDef === null) {
|
|
24695
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });
|
|
24792
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'component', type: type });
|
|
24696
24793
|
if (componentNeedsResolution(metadata)) {
|
|
24697
24794
|
const error = [`Component '${type.name}' is not resolved:`];
|
|
24698
24795
|
if (metadata.templateUrl) {
|
|
@@ -24791,6 +24888,41 @@ function compileComponent(type, metadata) {
|
|
|
24791
24888
|
configurable: !!ngDevMode,
|
|
24792
24889
|
});
|
|
24793
24890
|
}
|
|
24891
|
+
function getDependencyTypeForError(type) {
|
|
24892
|
+
if (getComponentDef(type))
|
|
24893
|
+
return 'component';
|
|
24894
|
+
if (getDirectiveDef(type))
|
|
24895
|
+
return 'directive';
|
|
24896
|
+
if (getPipeDef$1(type))
|
|
24897
|
+
return 'pipe';
|
|
24898
|
+
return 'type';
|
|
24899
|
+
}
|
|
24900
|
+
function verifyStandaloneImport(depType, importingType) {
|
|
24901
|
+
if (isForwardRef(depType)) {
|
|
24902
|
+
depType = resolveForwardRef(depType);
|
|
24903
|
+
if (!depType) {
|
|
24904
|
+
throw new Error(`Expected forwardRef function, imported from "${stringifyForError(importingType)}", to return a standalone entity or NgModule but got "${stringifyForError(depType) || depType}".`);
|
|
24905
|
+
}
|
|
24906
|
+
}
|
|
24907
|
+
if (getNgModuleDef(depType) == null) {
|
|
24908
|
+
const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);
|
|
24909
|
+
if (def != null) {
|
|
24910
|
+
// if a component, directive or pipe is imported make sure that it is standalone
|
|
24911
|
+
if (!def.standalone) {
|
|
24912
|
+
throw new Error(`The "${stringifyForError(depType)}" ${getDependencyTypeForError(depType)}, imported from "${stringifyForError(importingType)}", is not standalone. Did you forget to add the standalone: true flag?`);
|
|
24913
|
+
}
|
|
24914
|
+
}
|
|
24915
|
+
else {
|
|
24916
|
+
// it can be either a module with provider or an unknown (not annotated) type
|
|
24917
|
+
if (isModuleWithProviders(depType)) {
|
|
24918
|
+
throw new Error(`A module with providers was imported from "${stringifyForError(importingType)}". Modules with providers are not supported in standalone components imports.`);
|
|
24919
|
+
}
|
|
24920
|
+
else {
|
|
24921
|
+
throw new Error(`The "${stringifyForError(depType)}" type, imported from "${stringifyForError(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);
|
|
24922
|
+
}
|
|
24923
|
+
}
|
|
24924
|
+
}
|
|
24925
|
+
}
|
|
24794
24926
|
/**
|
|
24795
24927
|
* Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a
|
|
24796
24928
|
* standalone component, which process `imports` and filter out directives and pipes. The use of
|
|
@@ -24806,6 +24938,7 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
24806
24938
|
// definition in its `directiveDefs`.
|
|
24807
24939
|
cachedDirectiveDefs = [getComponentDef(type)];
|
|
24808
24940
|
for (const rawDep of imports) {
|
|
24941
|
+
ngDevMode && verifyStandaloneImport(rawDep, type);
|
|
24809
24942
|
const dep = resolveForwardRef(rawDep);
|
|
24810
24943
|
if (!!getNgModuleDef(dep)) {
|
|
24811
24944
|
const scope = transitiveScopesFor(dep);
|
|
@@ -24870,7 +25003,7 @@ function compileDirective(type, directive) {
|
|
|
24870
25003
|
// that use `@Directive()` with no selector. In that case, pass empty object to the
|
|
24871
25004
|
// `directiveMetadata` function instead of null.
|
|
24872
25005
|
const meta = getDirectiveMetadata(type, directive || {});
|
|
24873
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
25006
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'directive', type });
|
|
24874
25007
|
ngDirectiveDef =
|
|
24875
25008
|
compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
|
|
24876
25009
|
}
|
|
@@ -24883,7 +25016,7 @@ function compileDirective(type, directive) {
|
|
|
24883
25016
|
function getDirectiveMetadata(type, metadata) {
|
|
24884
25017
|
const name = type && type.name;
|
|
24885
25018
|
const sourceMapUrl = `ng:///${name}/ɵdir.js`;
|
|
24886
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
25019
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'directive', type });
|
|
24887
25020
|
const facade = directiveMetadata(type, metadata);
|
|
24888
25021
|
facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
|
|
24889
25022
|
if (facade.usesInheritance) {
|
|
@@ -24897,7 +25030,7 @@ function addDirectiveFactoryDef(type, metadata) {
|
|
|
24897
25030
|
get: () => {
|
|
24898
25031
|
if (ngFactoryDef === null) {
|
|
24899
25032
|
const meta = getDirectiveMetadata(type, metadata);
|
|
24900
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
|
|
25033
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'directive', type });
|
|
24901
25034
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {
|
|
24902
25035
|
name: meta.metadata.name,
|
|
24903
25036
|
type: meta.metadata.type,
|
|
@@ -25049,7 +25182,7 @@ function compilePipe(type, meta) {
|
|
|
25049
25182
|
get: () => {
|
|
25050
25183
|
if (ngFactoryDef === null) {
|
|
25051
25184
|
const metadata = getPipeMetadata(type, meta);
|
|
25052
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
25185
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'pipe', type: metadata.type });
|
|
25053
25186
|
ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {
|
|
25054
25187
|
name: metadata.name,
|
|
25055
25188
|
type: metadata.type,
|
|
@@ -25067,7 +25200,7 @@ function compilePipe(type, meta) {
|
|
|
25067
25200
|
get: () => {
|
|
25068
25201
|
if (ngPipeDef === null) {
|
|
25069
25202
|
const metadata = getPipeMetadata(type, meta);
|
|
25070
|
-
const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
|
|
25203
|
+
const compiler = getCompilerFacade({ usage: 0 /* JitCompilerUsage.Decorator */, kind: 'pipe', type: metadata.type });
|
|
25071
25204
|
ngPipeDef =
|
|
25072
25205
|
compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);
|
|
25073
25206
|
}
|
|
@@ -26525,7 +26658,7 @@ function compileNgModuleFactory(injector, options, moduleType) {
|
|
|
26525
26658
|
return Promise.resolve(moduleFactory);
|
|
26526
26659
|
}
|
|
26527
26660
|
const compiler = getCompilerFacade({
|
|
26528
|
-
usage: 0 /* Decorator */,
|
|
26661
|
+
usage: 0 /* JitCompilerUsage.Decorator */,
|
|
26529
26662
|
kind: 'NgModule',
|
|
26530
26663
|
type: moduleType,
|
|
26531
26664
|
});
|
|
@@ -26564,7 +26697,7 @@ function createPlatform(injector) {
|
|
|
26564
26697
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26565
26698
|
'There can be only one platform. Destroy the previous one to create a new one.' :
|
|
26566
26699
|
'';
|
|
26567
|
-
throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
|
|
26700
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
|
|
26568
26701
|
}
|
|
26569
26702
|
publishDefaultGlobalUtils();
|
|
26570
26703
|
_platformInjector = injector;
|
|
@@ -26620,7 +26753,7 @@ function bootstrapApplication(config) {
|
|
|
26620
26753
|
const appInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
|
|
26621
26754
|
const exceptionHandler = appInjector.get(ErrorHandler, null);
|
|
26622
26755
|
if (NG_DEV_MODE && !exceptionHandler) {
|
|
26623
|
-
throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
26756
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
26624
26757
|
}
|
|
26625
26758
|
let onErrorSubscription;
|
|
26626
26759
|
ngZone.runOutsideAngular(() => {
|
|
@@ -26685,11 +26818,11 @@ function assertPlatform(requiredToken) {
|
|
|
26685
26818
|
const platform = getPlatform();
|
|
26686
26819
|
if (!platform) {
|
|
26687
26820
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
|
|
26688
|
-
throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);
|
|
26821
|
+
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
|
|
26689
26822
|
}
|
|
26690
26823
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
26691
26824
|
!platform.injector.get(requiredToken, null)) {
|
|
26692
|
-
throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
|
|
26825
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
|
|
26693
26826
|
}
|
|
26694
26827
|
return platform;
|
|
26695
26828
|
}
|
|
@@ -26768,7 +26901,7 @@ class PlatformRef {
|
|
|
26768
26901
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26769
26902
|
'No ErrorHandler. Is platform module (BrowserModule) included?' :
|
|
26770
26903
|
'';
|
|
26771
|
-
throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
26904
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
26772
26905
|
}
|
|
26773
26906
|
ngZone.runOutsideAngular(() => {
|
|
26774
26907
|
const subscription = ngZone.onError.subscribe({
|
|
@@ -26829,7 +26962,7 @@ class PlatformRef {
|
|
|
26829
26962
|
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
26830
26963
|
`Please define one of these.` :
|
|
26831
26964
|
'';
|
|
26832
|
-
throw new RuntimeError(403 /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
26965
|
+
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
26833
26966
|
}
|
|
26834
26967
|
this._modules.push(moduleRef);
|
|
26835
26968
|
}
|
|
@@ -26855,7 +26988,7 @@ class PlatformRef {
|
|
|
26855
26988
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26856
26989
|
'The platform has already been destroyed!' :
|
|
26857
26990
|
'';
|
|
26858
|
-
throw new RuntimeError(404 /* PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
26991
|
+
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
26859
26992
|
}
|
|
26860
26993
|
this._modules.slice().forEach(module => module.destroy());
|
|
26861
26994
|
this._destroyListeners.forEach(listener => listener());
|
|
@@ -27097,6 +27230,10 @@ class ApplicationRef {
|
|
|
27097
27230
|
get destroyed() {
|
|
27098
27231
|
return this._destroyed;
|
|
27099
27232
|
}
|
|
27233
|
+
/** @internal */
|
|
27234
|
+
get injector() {
|
|
27235
|
+
return this._injector;
|
|
27236
|
+
}
|
|
27100
27237
|
/**
|
|
27101
27238
|
* Bootstrap a component onto the element identified by its selector or, optionally, to a
|
|
27102
27239
|
* specified element.
|
|
@@ -27142,7 +27279,7 @@ class ApplicationRef {
|
|
|
27142
27279
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27143
27280
|
(standalone ? '' :
|
|
27144
27281
|
' Bootstrap components in the `ngDoBootstrap` method of the root module.');
|
|
27145
|
-
throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, NG_DEV_MODE && errorMessage);
|
|
27282
|
+
throw new RuntimeError(405 /* RuntimeErrorCode.ASYNC_INITIALIZERS_STILL_RUNNING */, NG_DEV_MODE && errorMessage);
|
|
27146
27283
|
}
|
|
27147
27284
|
let componentFactory;
|
|
27148
27285
|
if (isComponentFactory) {
|
|
@@ -27193,7 +27330,7 @@ class ApplicationRef {
|
|
|
27193
27330
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
27194
27331
|
'ApplicationRef.tick is called recursively' :
|
|
27195
27332
|
'';
|
|
27196
|
-
throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
27333
|
+
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
27197
27334
|
}
|
|
27198
27335
|
try {
|
|
27199
27336
|
this._runningTick = true;
|
|
@@ -27275,9 +27412,14 @@ class ApplicationRef {
|
|
|
27275
27412
|
this._destroyListeners.push(callback);
|
|
27276
27413
|
return () => remove(this._destroyListeners, callback);
|
|
27277
27414
|
}
|
|
27415
|
+
/**
|
|
27416
|
+
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
27417
|
+
* will destroy the associated environnement injectors as well as all the bootstrapped components
|
|
27418
|
+
* with their views.
|
|
27419
|
+
*/
|
|
27278
27420
|
destroy() {
|
|
27279
27421
|
if (this._destroyed) {
|
|
27280
|
-
throw new RuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27422
|
+
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27281
27423
|
}
|
|
27282
27424
|
const injector = this._injector;
|
|
27283
27425
|
// Check that this injector instance supports destroy operation.
|
|
@@ -27295,7 +27437,7 @@ class ApplicationRef {
|
|
|
27295
27437
|
}
|
|
27296
27438
|
warnIfDestroyed() {
|
|
27297
27439
|
if (NG_DEV_MODE && this._destroyed) {
|
|
27298
|
-
console.warn(formatRuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
27440
|
+
console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
27299
27441
|
}
|
|
27300
27442
|
}
|
|
27301
27443
|
}
|
|
@@ -27489,7 +27631,7 @@ class ChangeDetectorRef {
|
|
|
27489
27631
|
ChangeDetectorRef.__NG_ELEMENT_ID__ = injectChangeDetectorRef;
|
|
27490
27632
|
/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */
|
|
27491
27633
|
function injectChangeDetectorRef(flags) {
|
|
27492
|
-
return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* ForPipe */) === 16 /* ForPipe */);
|
|
27634
|
+
return createViewRef(getCurrentTNode(), getLView(), (flags & 16 /* InternalInjectFlags.ForPipe */) === 16 /* InternalInjectFlags.ForPipe */);
|
|
27493
27635
|
}
|
|
27494
27636
|
/**
|
|
27495
27637
|
* Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).
|
|
@@ -27506,7 +27648,7 @@ function createViewRef(tNode, lView, isPipe) {
|
|
|
27506
27648
|
const componentView = getComponentLViewByIndex(tNode.index, lView); // look down
|
|
27507
27649
|
return new ViewRef$1(componentView, componentView);
|
|
27508
27650
|
}
|
|
27509
|
-
else if (tNode.type & (3 /* AnyRNode */ | 12 /* AnyContainer */ | 32 /* Icu */)) {
|
|
27651
|
+
else if (tNode.type & (3 /* TNodeType.AnyRNode */ | 12 /* TNodeType.AnyContainer */ | 32 /* TNodeType.Icu */)) {
|
|
27510
27652
|
// The LView represents the location where the injection is requested from.
|
|
27511
27653
|
// We need to locate the containing LView (in case where the `lView` is an embedded view)
|
|
27512
27654
|
const hostComponentView = lView[DECLARATION_COMPONENT_VIEW]; // look up
|
|
@@ -27981,7 +28123,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
27981
28123
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
27982
28124
|
const nativeNode = getNativeByTNodeOrNull(tNode, lView);
|
|
27983
28125
|
// For each type of TNode, specific logic is executed.
|
|
27984
|
-
if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {
|
|
28126
|
+
if (tNode.type & (3 /* TNodeType.AnyRNode */ | 8 /* TNodeType.ElementContainer */)) {
|
|
27985
28127
|
// Case 1: the TNode is an element
|
|
27986
28128
|
// The native node has to be checked.
|
|
27987
28129
|
_addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);
|
|
@@ -28015,7 +28157,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28015
28157
|
_queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);
|
|
28016
28158
|
}
|
|
28017
28159
|
}
|
|
28018
|
-
else if (tNode.type & 4 /* Container */) {
|
|
28160
|
+
else if (tNode.type & 4 /* TNodeType.Container */) {
|
|
28019
28161
|
// Case 2: the TNode is a container
|
|
28020
28162
|
// The native node has to be checked.
|
|
28021
28163
|
const lContainer = lView[tNode.index];
|
|
@@ -28023,7 +28165,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28023
28165
|
// Each view inside the container has to be processed.
|
|
28024
28166
|
_queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);
|
|
28025
28167
|
}
|
|
28026
|
-
else if (tNode.type & 16 /* Projection */) {
|
|
28168
|
+
else if (tNode.type & 16 /* TNodeType.Projection */) {
|
|
28027
28169
|
// Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).
|
|
28028
28170
|
// The nodes projected at this location all need to be processed.
|
|
28029
28171
|
const componentView = lView[DECLARATION_COMPONENT_VIEW];
|
|
@@ -28048,7 +28190,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
|
|
|
28048
28190
|
if (rootNativeNode !== nativeNode) {
|
|
28049
28191
|
// To determine the next node to be processed, we need to use the next or the projectionNext
|
|
28050
28192
|
// link, depending on whether the current node has been projected.
|
|
28051
|
-
const nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next;
|
|
28193
|
+
const nextTNode = (tNode.flags & 4 /* TNodeFlags.isProjected */) ? tNode.projectionNext : tNode.next;
|
|
28052
28194
|
if (nextTNode) {
|
|
28053
28195
|
_queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);
|
|
28054
28196
|
}
|
|
@@ -28319,7 +28461,7 @@ class DefaultIterableDiffer {
|
|
|
28319
28461
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28320
28462
|
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
|
|
28321
28463
|
'';
|
|
28322
|
-
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
28464
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
28323
28465
|
}
|
|
28324
28466
|
if (this.check(collection)) {
|
|
28325
28467
|
return this;
|
|
@@ -28923,7 +29065,7 @@ class DefaultKeyValueDiffer {
|
|
|
28923
29065
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28924
29066
|
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
|
|
28925
29067
|
'';
|
|
28926
|
-
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
29068
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
28927
29069
|
}
|
|
28928
29070
|
return this.check(map) ? this : null;
|
|
28929
29071
|
}
|
|
@@ -29173,7 +29315,7 @@ class IterableDiffers {
|
|
|
29173
29315
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
29174
29316
|
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
|
|
29175
29317
|
'';
|
|
29176
|
-
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29318
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29177
29319
|
}
|
|
29178
29320
|
}
|
|
29179
29321
|
}
|
|
@@ -29250,7 +29392,7 @@ class KeyValueDiffers {
|
|
|
29250
29392
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
29251
29393
|
`Cannot find a differ supporting object '${kv}'` :
|
|
29252
29394
|
'';
|
|
29253
|
-
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29395
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29254
29396
|
}
|
|
29255
29397
|
}
|
|
29256
29398
|
/** @nocollapse */
|
|
@@ -29351,7 +29493,7 @@ const ɵivyEnabled = true;
|
|
|
29351
29493
|
* @codeGenApi
|
|
29352
29494
|
*/
|
|
29353
29495
|
function ɵɵngDeclareDirective(decl) {
|
|
29354
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });
|
|
29496
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'directive', type: decl.type });
|
|
29355
29497
|
return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
|
|
29356
29498
|
}
|
|
29357
29499
|
/**
|
|
@@ -29369,7 +29511,7 @@ function ɵɵngDeclareClassMetadata(decl) {
|
|
|
29369
29511
|
* @codeGenApi
|
|
29370
29512
|
*/
|
|
29371
29513
|
function ɵɵngDeclareComponent(decl) {
|
|
29372
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });
|
|
29514
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'component', type: decl.type });
|
|
29373
29515
|
return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
|
|
29374
29516
|
}
|
|
29375
29517
|
/**
|
|
@@ -29379,7 +29521,7 @@ function ɵɵngDeclareComponent(decl) {
|
|
|
29379
29521
|
*/
|
|
29380
29522
|
function ɵɵngDeclareFactory(decl) {
|
|
29381
29523
|
const compiler = getCompilerFacade({
|
|
29382
|
-
usage: 1 /* PartialDeclaration */,
|
|
29524
|
+
usage: 1 /* JitCompilerUsage.PartialDeclaration */,
|
|
29383
29525
|
kind: getFactoryKind(decl.target),
|
|
29384
29526
|
type: decl.type
|
|
29385
29527
|
});
|
|
@@ -29405,7 +29547,7 @@ function getFactoryKind(target) {
|
|
|
29405
29547
|
* @codeGenApi
|
|
29406
29548
|
*/
|
|
29407
29549
|
function ɵɵngDeclareInjectable(decl) {
|
|
29408
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });
|
|
29550
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'injectable', type: decl.type });
|
|
29409
29551
|
return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);
|
|
29410
29552
|
}
|
|
29411
29553
|
/**
|
|
@@ -29414,7 +29556,7 @@ function ɵɵngDeclareInjectable(decl) {
|
|
|
29414
29556
|
* @codeGenApi
|
|
29415
29557
|
*/
|
|
29416
29558
|
function ɵɵngDeclareInjector(decl) {
|
|
29417
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
29559
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
29418
29560
|
return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);
|
|
29419
29561
|
}
|
|
29420
29562
|
/**
|
|
@@ -29423,7 +29565,7 @@ function ɵɵngDeclareInjector(decl) {
|
|
|
29423
29565
|
* @codeGenApi
|
|
29424
29566
|
*/
|
|
29425
29567
|
function ɵɵngDeclareNgModule(decl) {
|
|
29426
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
29568
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'NgModule', type: decl.type });
|
|
29427
29569
|
return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);
|
|
29428
29570
|
}
|
|
29429
29571
|
/**
|
|
@@ -29432,7 +29574,7 @@ function ɵɵngDeclareNgModule(decl) {
|
|
|
29432
29574
|
* @codeGenApi
|
|
29433
29575
|
*/
|
|
29434
29576
|
function ɵɵngDeclarePipe(decl) {
|
|
29435
|
-
const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });
|
|
29577
|
+
const compiler = getCompilerFacade({ usage: 1 /* JitCompilerUsage.PartialDeclaration */, kind: 'pipe', type: decl.type });
|
|
29436
29578
|
return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
|
|
29437
29579
|
}
|
|
29438
29580
|
|
|
@@ -29486,5 +29628,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
29486
29628
|
* Generated bundle index. Do not edit.
|
|
29487
29629
|
*/
|
|
29488
29630
|
|
|
29489
|
-
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, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR,
|
|
29631
|
+
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, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bootstrapApplication as ɵbootstrapApplication, 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, 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, renderComponent as ɵrenderComponent, 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 };
|
|
29490
29632
|
//# sourceMappingURL=core.mjs.map
|