@angular/core 14.0.0-next.0 → 14.0.0-next.11
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/core.d.ts +202 -132
- package/esm2020/src/application_init.mjs +4 -3
- package/esm2020/src/application_module.mjs +5 -104
- package/esm2020/src/application_ref.mjs +6 -24
- package/esm2020/src/application_tokens.mjs +14 -2
- package/esm2020/src/change_detection/change_detection.mjs +2 -3
- package/esm2020/src/compiler/compiler_facade_interface.mjs +1 -1
- package/esm2020/src/core.mjs +2 -2
- package/esm2020/src/core_private_export.mjs +2 -1
- package/esm2020/src/core_render3_private_export.mjs +4 -3
- package/esm2020/src/debug/debug_node.mjs +137 -53
- package/esm2020/src/di/injector_compatibility.mjs +2 -2
- package/esm2020/src/di/r3_injector.mjs +5 -15
- package/esm2020/src/di/reflective_injector.mjs +1 -1
- package/esm2020/src/di/reflective_provider.mjs +4 -4
- package/esm2020/src/errors.mjs +22 -5
- package/esm2020/src/i18n/tokens.mjs +39 -3
- package/esm2020/src/linker/compiler.mjs +4 -3
- package/esm2020/src/linker/ng_module_factory_loader.mjs +2 -2
- package/esm2020/src/linker/ng_module_registration.mjs +55 -0
- package/esm2020/src/linker/template_ref.mjs +3 -3
- package/esm2020/src/linker/view_container_ref.mjs +35 -8
- package/esm2020/src/metadata/directives.mjs +14 -5
- package/esm2020/src/reflection/platform_reflection_capabilities.mjs +1 -1
- package/esm2020/src/reflection/reflection_capabilities.mjs +1 -37
- package/esm2020/src/render3/component.mjs +3 -3
- package/esm2020/src/render3/component_ref.mjs +22 -26
- package/esm2020/src/render3/context_discovery.mjs +34 -30
- package/esm2020/src/render3/definition.mjs +3 -1
- package/esm2020/src/render3/di.mjs +177 -97
- package/esm2020/src/render3/hooks.mjs +3 -3
- package/esm2020/src/render3/i18n/i18n_parse.mjs +3 -3
- package/esm2020/src/render3/index.mjs +2 -2
- package/esm2020/src/render3/instructions/element.mjs +28 -7
- package/esm2020/src/render3/instructions/element_container.mjs +7 -1
- package/esm2020/src/render3/instructions/lview_debug.mjs +7 -4
- package/esm2020/src/render3/instructions/shared.mjs +26 -12
- package/esm2020/src/render3/interfaces/context.mjs +35 -2
- package/esm2020/src/render3/interfaces/definition.mjs +1 -1
- package/esm2020/src/render3/interfaces/injector.mjs +1 -1
- package/esm2020/src/render3/interfaces/lview_tracking.mjs +33 -0
- package/esm2020/src/render3/interfaces/renderer_dom.mjs +1 -1
- package/esm2020/src/render3/interfaces/view.mjs +4 -2
- package/esm2020/src/render3/jit/directive.mjs +5 -2
- package/esm2020/src/render3/jit/environment.mjs +4 -1
- package/esm2020/src/render3/jit/module.mjs +7 -1
- package/esm2020/src/render3/jit/module_patch.mjs +11 -0
- package/esm2020/src/render3/jit/pipe.mjs +5 -2
- package/esm2020/src/render3/ng_module_ref.mjs +1 -29
- package/esm2020/src/render3/node_manipulation.mjs +12 -3
- package/esm2020/src/render3/state.mjs +16 -2
- package/esm2020/src/render3/styling/styling_parser.mjs +2 -2
- package/esm2020/src/render3/util/discovery_utils.mjs +33 -22
- package/esm2020/src/util/coercion.mjs +12 -0
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/fake_async.mjs +3 -2
- 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 +13 -2
- package/fesm2015/core.mjs +798 -604
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +15 -3
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +798 -597
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +15 -3
- package/fesm2020/testing.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/migrations/entry-components/util.js +2 -2
- package/schematics/migrations/{router-link-empty-expression → path-match-type}/index.d.ts +2 -2
- package/schematics/migrations/path-match-type/index.js +95 -0
- package/schematics/migrations/path-match-type/transform.d.ts +19 -0
- package/schematics/migrations/path-match-type/transform.js +48 -0
- package/schematics/migrations/path-match-type/update_recorder.d.ts +18 -0
- package/schematics/migrations/path-match-type/update_recorder.js +20 -0
- package/schematics/migrations/path-match-type/util.d.ts +11 -0
- package/schematics/migrations/path-match-type/util.js +106 -0
- package/schematics/migrations/typed-forms/index.d.ts +1 -5
- package/schematics/migrations/typed-forms/index.js +12 -34
- package/schematics/migrations/typed-forms/util.d.ts +8 -10
- package/schematics/migrations/typed-forms/util.js +99 -52
- package/schematics/migrations.json +11 -16
- package/schematics/utils/import_manager.js +11 -22
- package/schematics/utils/typescript/imports.js +5 -9
- package/schematics/utils/typescript/parse_tsconfig.js +6 -2
- package/schematics/utils/typescript/symbol.js +4 -3
- package/testing/testing.d.ts +3 -2
- package/esm2020/src/di/util.mjs +0 -51
- package/esm2020/src/linker/ng_module_factory_registration.mjs +0 -59
- package/esm2020/src/reflection/reflection.mjs +0 -16
- package/esm2020/src/reflection/reflector.mjs +0 -56
- package/esm2020/src/reflection/types.mjs +0 -9
- package/schematics/migrations/router-link-empty-expression/analyze_template.d.ts +0 -11
- package/schematics/migrations/router-link-empty-expression/analyze_template.js +0 -34
- package/schematics/migrations/router-link-empty-expression/angular/html_routerlink_empty_expr_visitor.d.ts +0 -20
- package/schematics/migrations/router-link-empty-expression/angular/html_routerlink_empty_expr_visitor.js +0 -47
- package/schematics/migrations/router-link-empty-expression/index.js +0 -170
- package/schematics/migrations/testbed-teardown/index.d.ts +0 -11
- package/schematics/migrations/testbed-teardown/index.js +0 -92
- package/schematics/migrations/testbed-teardown/util.d.ts +0 -35
- package/schematics/migrations/testbed-teardown/util.js +0 -188
package/fesm2020/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.11
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -152,20 +152,37 @@ const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
|
|
|
152
152
|
* Use of this source code is governed by an MIT-style license that can be
|
|
153
153
|
* found in the LICENSE file at https://angular.io/license
|
|
154
154
|
*/
|
|
155
|
+
/**
|
|
156
|
+
* Class that represents a runtime error.
|
|
157
|
+
* Formats and outputs the error message in a consistent way.
|
|
158
|
+
*
|
|
159
|
+
* Example:
|
|
160
|
+
* ```
|
|
161
|
+
* throw new RuntimeError(
|
|
162
|
+
* RuntimeErrorCode.INJECTOR_ALREADY_DESTROYED,
|
|
163
|
+
* ngDevMode && 'Injector has already been destroyed.');
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* Note: the `message` argument contains a descriptive error message as a string in development
|
|
167
|
+
* mode (when the `ngDevMode` is defined). In production mode (after tree-shaking pass), the
|
|
168
|
+
* `message` argument becomes `false`, thus we account for it in the typings and the runtime logic.
|
|
169
|
+
*/
|
|
155
170
|
class RuntimeError extends Error {
|
|
156
171
|
constructor(code, message) {
|
|
157
172
|
super(formatRuntimeError(code, message));
|
|
158
173
|
this.code = code;
|
|
159
174
|
}
|
|
160
175
|
}
|
|
161
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Called to format a runtime error.
|
|
178
|
+
* See additional info on the `message` argument type in the `RuntimeError` class description.
|
|
179
|
+
*/
|
|
162
180
|
function formatRuntimeError(code, message) {
|
|
163
|
-
const codeAsNumber = code;
|
|
164
181
|
// Error code might be a negative number, which is a special marker that instructs the logic to
|
|
165
182
|
// generate a link to the error details page on angular.io.
|
|
166
|
-
const fullCode = `NG0${Math.abs(
|
|
183
|
+
const fullCode = `NG0${Math.abs(code)}`;
|
|
167
184
|
let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;
|
|
168
|
-
if (ngDevMode &&
|
|
185
|
+
if (ngDevMode && code < 0) {
|
|
169
186
|
errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
|
|
170
187
|
}
|
|
171
188
|
return errorMessage;
|
|
@@ -888,6 +905,7 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
888
905
|
onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,
|
|
889
906
|
directiveDefs: null,
|
|
890
907
|
pipeDefs: null,
|
|
908
|
+
standalone: componentDefinition.standalone === true,
|
|
891
909
|
selectors: componentDefinition.selectors || EMPTY_ARRAY,
|
|
892
910
|
viewQuery: componentDefinition.viewQuery || null,
|
|
893
911
|
features: componentDefinition.features || null,
|
|
@@ -1099,6 +1117,7 @@ function ɵɵdefinePipe(pipeDef) {
|
|
|
1099
1117
|
name: pipeDef.name,
|
|
1100
1118
|
factory: null,
|
|
1101
1119
|
pure: pipeDef.pure !== false,
|
|
1120
|
+
standalone: pipeDef.standalone === true,
|
|
1102
1121
|
onDestroy: pipeDef.type.prototype.ngOnDestroy || null
|
|
1103
1122
|
};
|
|
1104
1123
|
}
|
|
@@ -1155,6 +1174,8 @@ const DECLARATION_COMPONENT_VIEW = 16;
|
|
|
1155
1174
|
const DECLARATION_LCONTAINER = 17;
|
|
1156
1175
|
const PREORDER_HOOK_FLAGS = 18;
|
|
1157
1176
|
const QUERIES = 19;
|
|
1177
|
+
const ID = 20;
|
|
1178
|
+
const EMBEDDED_VIEW_INJECTOR = 21;
|
|
1158
1179
|
/**
|
|
1159
1180
|
* Size of LView's header. Necessary to adjust for it when setting slots.
|
|
1160
1181
|
*
|
|
@@ -1162,7 +1183,7 @@ const QUERIES = 19;
|
|
|
1162
1183
|
* instruction index into `LView` index. All other indexes should be in the `LView` index space and
|
|
1163
1184
|
* there should be no need to refer to `HEADER_OFFSET` anywhere else.
|
|
1164
1185
|
*/
|
|
1165
|
-
const HEADER_OFFSET =
|
|
1186
|
+
const HEADER_OFFSET = 22;
|
|
1166
1187
|
/**
|
|
1167
1188
|
* Converts `TViewType` into human readable text.
|
|
1168
1189
|
* Make sure this matches with `TViewType`
|
|
@@ -1911,6 +1932,7 @@ function getLView() {
|
|
|
1911
1932
|
function getTView() {
|
|
1912
1933
|
return instructionState.lFrame.tView;
|
|
1913
1934
|
}
|
|
1935
|
+
// TODO(crisbeto): revert the @noinline once Closure issue is resolved.
|
|
1914
1936
|
/**
|
|
1915
1937
|
* Restores `contextViewData` to the given OpaqueViewState instance.
|
|
1916
1938
|
*
|
|
@@ -1922,11 +1944,22 @@ function getTView() {
|
|
|
1922
1944
|
* @returns Context of the restored OpaqueViewState instance.
|
|
1923
1945
|
*
|
|
1924
1946
|
* @codeGenApi
|
|
1947
|
+
* @noinline Disable inlining due to issue with Closure in listeners inside embedded views.
|
|
1925
1948
|
*/
|
|
1926
1949
|
function ɵɵrestoreView(viewToRestore) {
|
|
1927
1950
|
instructionState.lFrame.contextLView = viewToRestore;
|
|
1928
1951
|
return viewToRestore[CONTEXT];
|
|
1929
1952
|
}
|
|
1953
|
+
/**
|
|
1954
|
+
* Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in
|
|
1955
|
+
* value so that it can be used as a return value of an instruction.
|
|
1956
|
+
*
|
|
1957
|
+
* @codeGenApi
|
|
1958
|
+
*/
|
|
1959
|
+
function ɵɵresetView(value) {
|
|
1960
|
+
instructionState.lFrame.contextLView = null;
|
|
1961
|
+
return value;
|
|
1962
|
+
}
|
|
1930
1963
|
function getCurrentTNode() {
|
|
1931
1964
|
let currentTNode = getCurrentTNodePlaceholderOk();
|
|
1932
1965
|
while (currentTNode !== null && currentTNode.type === 64 /* Placeholder */) {
|
|
@@ -1958,7 +1991,9 @@ function setCurrentTNodeAsParent() {
|
|
|
1958
1991
|
instructionState.lFrame.isParent = true;
|
|
1959
1992
|
}
|
|
1960
1993
|
function getContextLView() {
|
|
1961
|
-
|
|
1994
|
+
const contextLView = instructionState.lFrame.contextLView;
|
|
1995
|
+
ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');
|
|
1996
|
+
return contextLView;
|
|
1962
1997
|
}
|
|
1963
1998
|
function isInCheckNoChangesMode() {
|
|
1964
1999
|
// TODO(misko): remove this from the LView since it is ngDevMode=true mode only.
|
|
@@ -2457,7 +2492,7 @@ function incrementInitPhaseFlags(lView, initPhase) {
|
|
|
2457
2492
|
assertNotEqual(initPhase, 3 /* InitPhaseCompleted */, 'Init hooks phase should not be incremented after all init hooks have been run.');
|
|
2458
2493
|
let flags = lView[FLAGS];
|
|
2459
2494
|
if ((flags & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
2460
|
-
flags &=
|
|
2495
|
+
flags &= 4095 /* IndexWithinInitPhaseReset */;
|
|
2461
2496
|
flags += 1 /* InitPhaseStateIncrementer */;
|
|
2462
2497
|
lView[FLAGS] = flags;
|
|
2463
2498
|
}
|
|
@@ -2521,12 +2556,12 @@ function callHook(currentView, initPhase, arr, i) {
|
|
|
2521
2556
|
const directiveIndex = isInitHook ? -arr[i] : arr[i];
|
|
2522
2557
|
const directive = currentView[directiveIndex];
|
|
2523
2558
|
if (isInitHook) {
|
|
2524
|
-
const indexWithintInitPhase = currentView[FLAGS] >>
|
|
2559
|
+
const indexWithintInitPhase = currentView[FLAGS] >> 12 /* IndexWithinInitPhaseShift */;
|
|
2525
2560
|
// The init phase state must be always checked here as it may have been recursively updated.
|
|
2526
2561
|
if (indexWithintInitPhase <
|
|
2527
2562
|
(currentView[PREORDER_HOOK_FLAGS] >> 16 /* NumberOfInitHooksCalledShift */) &&
|
|
2528
2563
|
(currentView[FLAGS] & 3 /* InitPhaseStateMask */) === initPhase) {
|
|
2529
|
-
currentView[FLAGS] +=
|
|
2564
|
+
currentView[FLAGS] += 4096 /* IndexWithinInitPhaseIncrementer */;
|
|
2530
2565
|
profiler(4 /* LifecycleHookStart */, directive, hook);
|
|
2531
2566
|
try {
|
|
2532
2567
|
hook.call(directive);
|
|
@@ -3087,6 +3122,8 @@ const BLOOM_MASK = BLOOM_SIZE - 1;
|
|
|
3087
3122
|
const BLOOM_BUCKET_BITS = 5;
|
|
3088
3123
|
/** Counter used to generate unique IDs for directives. */
|
|
3089
3124
|
let nextNgElementId = 0;
|
|
3125
|
+
/** Value used when something wasn't found by an injector. */
|
|
3126
|
+
const NOT_FOUND = {};
|
|
3090
3127
|
/**
|
|
3091
3128
|
* Registers this directive as present in its node's injector by flipping the directive's
|
|
3092
3129
|
* corresponding bit in the injector's bloom filter.
|
|
@@ -3198,23 +3235,7 @@ function getParentInjectorLocation(tNode, lView) {
|
|
|
3198
3235
|
// `LView` hierarchy and look for it. If we walk of the top, that means that there is no parent
|
|
3199
3236
|
// `NodeInjector`.
|
|
3200
3237
|
while (lViewCursor !== null) {
|
|
3201
|
-
|
|
3202
|
-
const tView = lViewCursor[TVIEW];
|
|
3203
|
-
const tViewType = tView.type;
|
|
3204
|
-
if (tViewType === 2 /* Embedded */) {
|
|
3205
|
-
ngDevMode &&
|
|
3206
|
-
assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
3207
|
-
parentTNode = tView.declTNode;
|
|
3208
|
-
}
|
|
3209
|
-
else if (tViewType === 1 /* Component */) {
|
|
3210
|
-
// Components don't have `TView.declTNode` because each instance of component could be
|
|
3211
|
-
// inserted in different location, hence `TView.declTNode` is meaningless.
|
|
3212
|
-
parentTNode = lViewCursor[T_HOST];
|
|
3213
|
-
}
|
|
3214
|
-
else {
|
|
3215
|
-
ngDevMode && assertEqual(tView.type, 0 /* Root */, 'Root type expected');
|
|
3216
|
-
parentTNode = null;
|
|
3217
|
-
}
|
|
3238
|
+
parentTNode = getTNodeFromLView(lViewCursor);
|
|
3218
3239
|
if (parentTNode === null) {
|
|
3219
3240
|
// If we have no parent, than we are done.
|
|
3220
3241
|
return NO_PARENT_INJECTOR;
|
|
@@ -3375,93 +3396,116 @@ function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {
|
|
|
3375
3396
|
*/
|
|
3376
3397
|
function getOrCreateInjectable(tNode, lView, token, flags = InjectFlags.Default, notFoundValue) {
|
|
3377
3398
|
if (tNode !== null) {
|
|
3378
|
-
|
|
3379
|
-
//
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
if (
|
|
3383
|
-
|
|
3384
|
-
// flag, the module injector is not searched for that token in Ivy.
|
|
3385
|
-
return (flags & InjectFlags.Host) ?
|
|
3386
|
-
notFoundValueOrThrow(notFoundValue, token, flags) :
|
|
3387
|
-
lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
3399
|
+
// If the view or any of its ancestors have an embedded
|
|
3400
|
+
// view injector, we have to look it up there first.
|
|
3401
|
+
if (lView[FLAGS] & 2048 /* HasEmbeddedViewInjector */) {
|
|
3402
|
+
const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);
|
|
3403
|
+
if (embeddedInjectorValue !== NOT_FOUND) {
|
|
3404
|
+
return embeddedInjectorValue;
|
|
3388
3405
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3406
|
+
}
|
|
3407
|
+
// Otherwise try the node injector.
|
|
3408
|
+
const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);
|
|
3409
|
+
if (value !== NOT_FOUND) {
|
|
3410
|
+
return value;
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
// Finally, fall back to the module injector.
|
|
3414
|
+
return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
3415
|
+
}
|
|
3416
|
+
/**
|
|
3417
|
+
* Returns the value associated to the given token from the node injector.
|
|
3418
|
+
*
|
|
3419
|
+
* @param tNode The Node where the search for the injector should start
|
|
3420
|
+
* @param lView The `LView` that contains the `tNode`
|
|
3421
|
+
* @param token The token to look for
|
|
3422
|
+
* @param flags Injection flags
|
|
3423
|
+
* @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`
|
|
3424
|
+
* @returns the value from the injector, `null` when not found, or `notFoundValue` if provided
|
|
3425
|
+
*/
|
|
3426
|
+
function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {
|
|
3427
|
+
const bloomHash = bloomHashBitOrFactory(token);
|
|
3428
|
+
// If the ID stored here is a function, this is a special object like ElementRef or TemplateRef
|
|
3429
|
+
// so just call the factory function to create it.
|
|
3430
|
+
if (typeof bloomHash === 'function') {
|
|
3431
|
+
if (!enterDI(lView, tNode, flags)) {
|
|
3432
|
+
// Failed to enter DI, try module injector instead. If a token is injected with the @Host
|
|
3433
|
+
// flag, the module injector is not searched for that token in Ivy.
|
|
3434
|
+
return (flags & InjectFlags.Host) ?
|
|
3435
|
+
notFoundValueOrThrow(notFoundValue, token, flags) :
|
|
3436
|
+
lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);
|
|
3437
|
+
}
|
|
3438
|
+
try {
|
|
3439
|
+
const value = bloomHash(flags);
|
|
3440
|
+
if (value == null && !(flags & InjectFlags.Optional)) {
|
|
3441
|
+
throwProviderNotFoundError(token);
|
|
3397
3442
|
}
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
}
|
|
3401
|
-
}
|
|
3402
|
-
else if (typeof bloomHash === 'number') {
|
|
3403
|
-
// A reference to the previous injector TView that was found while climbing the element
|
|
3404
|
-
// injector tree. This is used to know if viewProviders can be accessed on the current
|
|
3405
|
-
// injector.
|
|
3406
|
-
let previousTView = null;
|
|
3407
|
-
let injectorIndex = getInjectorIndex(tNode, lView);
|
|
3408
|
-
let parentLocation = NO_PARENT_INJECTOR;
|
|
3409
|
-
let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
|
|
3410
|
-
// If we should skip this injector, or if there is no injector on this node, start by
|
|
3411
|
-
// searching the parent injector.
|
|
3412
|
-
if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {
|
|
3413
|
-
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :
|
|
3414
|
-
lView[injectorIndex + 8 /* PARENT */];
|
|
3415
|
-
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
|
|
3416
|
-
injectorIndex = -1;
|
|
3417
|
-
}
|
|
3418
|
-
else {
|
|
3419
|
-
previousTView = lView[TVIEW];
|
|
3420
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
3421
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
3422
|
-
}
|
|
3443
|
+
else {
|
|
3444
|
+
return value;
|
|
3423
3445
|
}
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3446
|
+
}
|
|
3447
|
+
finally {
|
|
3448
|
+
leaveDI();
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
else if (typeof bloomHash === 'number') {
|
|
3452
|
+
// A reference to the previous injector TView that was found while climbing the element
|
|
3453
|
+
// injector tree. This is used to know if viewProviders can be accessed on the current
|
|
3454
|
+
// injector.
|
|
3455
|
+
let previousTView = null;
|
|
3456
|
+
let injectorIndex = getInjectorIndex(tNode, lView);
|
|
3457
|
+
let parentLocation = NO_PARENT_INJECTOR;
|
|
3458
|
+
let hostTElementNode = flags & InjectFlags.Host ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;
|
|
3459
|
+
// If we should skip this injector, or if there is no injector on this node, start by
|
|
3460
|
+
// searching the parent injector.
|
|
3461
|
+
if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {
|
|
3462
|
+
parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :
|
|
3463
|
+
lView[injectorIndex + 8 /* PARENT */];
|
|
3464
|
+
if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {
|
|
3465
|
+
injectorIndex = -1;
|
|
3466
|
+
}
|
|
3467
|
+
else {
|
|
3468
|
+
previousTView = lView[TVIEW];
|
|
3469
|
+
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
3470
|
+
lView = getParentInjectorView(parentLocation, lView);
|
|
3471
|
+
}
|
|
3472
|
+
}
|
|
3473
|
+
// Traverse up the injector tree until we find a potential match or until we know there
|
|
3474
|
+
// *isn't* a match.
|
|
3475
|
+
while (injectorIndex !== -1) {
|
|
3476
|
+
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
3477
|
+
// Check the current injector. If it matches, see if it contains token.
|
|
3478
|
+
const tView = lView[TVIEW];
|
|
3479
|
+
ngDevMode &&
|
|
3480
|
+
assertTNodeForLView(tView.data[injectorIndex + 8 /* TNODE */], lView);
|
|
3481
|
+
if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {
|
|
3482
|
+
// At this point, we have an injector which *may* contain the token, so we step through
|
|
3483
|
+
// the providers and directives associated with the injector's corresponding node to get
|
|
3484
|
+
// the instance.
|
|
3485
|
+
const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);
|
|
3486
|
+
if (instance !== NOT_FOUND) {
|
|
3487
|
+
return instance;
|
|
3456
3488
|
}
|
|
3457
3489
|
}
|
|
3490
|
+
parentLocation = lView[injectorIndex + 8 /* PARENT */];
|
|
3491
|
+
if (parentLocation !== NO_PARENT_INJECTOR &&
|
|
3492
|
+
shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + 8 /* TNODE */] === hostTElementNode) &&
|
|
3493
|
+
bloomHasToken(bloomHash, injectorIndex, lView)) {
|
|
3494
|
+
// The def wasn't found anywhere on this node, so it was a false positive.
|
|
3495
|
+
// Traverse up the tree and continue searching.
|
|
3496
|
+
previousTView = tView;
|
|
3497
|
+
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
3498
|
+
lView = getParentInjectorView(parentLocation, lView);
|
|
3499
|
+
}
|
|
3500
|
+
else {
|
|
3501
|
+
// If we should not search parent OR If the ancestor bloom filter value does not have the
|
|
3502
|
+
// bit corresponding to the directive we can give up on traversing up to find the specific
|
|
3503
|
+
// injector.
|
|
3504
|
+
injectorIndex = -1;
|
|
3505
|
+
}
|
|
3458
3506
|
}
|
|
3459
3507
|
}
|
|
3460
|
-
return
|
|
3461
|
-
}
|
|
3462
|
-
const NOT_FOUND = {};
|
|
3463
|
-
function createNodeInjector() {
|
|
3464
|
-
return new NodeInjector(getCurrentTNode(), getLView());
|
|
3508
|
+
return notFoundValue;
|
|
3465
3509
|
}
|
|
3466
3510
|
function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {
|
|
3467
3511
|
const currentTView = lView[TVIEW];
|
|
@@ -3635,6 +3679,10 @@ class NodeInjector {
|
|
|
3635
3679
|
return getOrCreateInjectable(this._tNode, this._lView, token, flags, notFoundValue);
|
|
3636
3680
|
}
|
|
3637
3681
|
}
|
|
3682
|
+
/** Creates a `NodeInjector` for the current node. */
|
|
3683
|
+
function createNodeInjector() {
|
|
3684
|
+
return new NodeInjector(getCurrentTNode(), getLView());
|
|
3685
|
+
}
|
|
3638
3686
|
/**
|
|
3639
3687
|
* @codeGenApi
|
|
3640
3688
|
*/
|
|
@@ -3673,6 +3721,73 @@ function getFactoryOf(type) {
|
|
|
3673
3721
|
}
|
|
3674
3722
|
return getFactoryDef(type);
|
|
3675
3723
|
}
|
|
3724
|
+
/**
|
|
3725
|
+
* Returns a value from the closest embedded or node injector.
|
|
3726
|
+
*
|
|
3727
|
+
* @param tNode The Node where the search for the injector should start
|
|
3728
|
+
* @param lView The `LView` that contains the `tNode`
|
|
3729
|
+
* @param token The token to look for
|
|
3730
|
+
* @param flags Injection flags
|
|
3731
|
+
* @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`
|
|
3732
|
+
* @returns the value from the injector, `null` when not found, or `notFoundValue` if provided
|
|
3733
|
+
*/
|
|
3734
|
+
function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {
|
|
3735
|
+
let currentTNode = tNode;
|
|
3736
|
+
let currentLView = lView;
|
|
3737
|
+
// When an LView with an embedded view injector is inserted, it'll likely be interlaced with
|
|
3738
|
+
// nodes who may have injectors (e.g. node injector -> embedded view injector -> node injector).
|
|
3739
|
+
// Since the bloom filters for the node injectors have already been constructed and we don't
|
|
3740
|
+
// have a way of extracting the records from an injector, the only way to maintain the correct
|
|
3741
|
+
// hierarchy when resolving the value is to walk it node-by-node while attempting to resolve
|
|
3742
|
+
// the token at each level.
|
|
3743
|
+
while (currentTNode !== null && currentLView !== null &&
|
|
3744
|
+
(currentLView[FLAGS] & 2048 /* HasEmbeddedViewInjector */) &&
|
|
3745
|
+
!(currentLView[FLAGS] & 512 /* IsRoot */)) {
|
|
3746
|
+
ngDevMode && assertTNodeForLView(currentTNode, currentLView);
|
|
3747
|
+
// Note that this lookup on the node injector is using the `Self` flag, because
|
|
3748
|
+
// we don't want the node injector to look at any parent injectors since we
|
|
3749
|
+
// may hit the embedded view injector first.
|
|
3750
|
+
const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | InjectFlags.Self, NOT_FOUND);
|
|
3751
|
+
if (nodeInjectorValue !== NOT_FOUND) {
|
|
3752
|
+
return nodeInjectorValue;
|
|
3753
|
+
}
|
|
3754
|
+
// Has an explicit type due to a TS bug: https://github.com/microsoft/TypeScript/issues/33191
|
|
3755
|
+
let parentTNode = currentTNode.parent;
|
|
3756
|
+
// `TNode.parent` includes the parent within the current view only. If it doesn't exist,
|
|
3757
|
+
// it means that we've hit the view boundary and we need to go up to the next view.
|
|
3758
|
+
if (!parentTNode) {
|
|
3759
|
+
// Before we go to the next LView, check if the token exists on the current embedded injector.
|
|
3760
|
+
const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];
|
|
3761
|
+
if (embeddedViewInjector) {
|
|
3762
|
+
const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);
|
|
3763
|
+
if (embeddedViewInjectorValue !== NOT_FOUND) {
|
|
3764
|
+
return embeddedViewInjectorValue;
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
// Otherwise keep going up the tree.
|
|
3768
|
+
parentTNode = getTNodeFromLView(currentLView);
|
|
3769
|
+
currentLView = currentLView[DECLARATION_VIEW];
|
|
3770
|
+
}
|
|
3771
|
+
currentTNode = parentTNode;
|
|
3772
|
+
}
|
|
3773
|
+
return notFoundValue;
|
|
3774
|
+
}
|
|
3775
|
+
/** Gets the TNode associated with an LView inside of the declaration view. */
|
|
3776
|
+
function getTNodeFromLView(lView) {
|
|
3777
|
+
const tView = lView[TVIEW];
|
|
3778
|
+
const tViewType = tView.type;
|
|
3779
|
+
// The parent pointer differs based on `TView.type`.
|
|
3780
|
+
if (tViewType === 2 /* Embedded */) {
|
|
3781
|
+
ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');
|
|
3782
|
+
return tView.declTNode;
|
|
3783
|
+
}
|
|
3784
|
+
else if (tViewType === 1 /* Component */) {
|
|
3785
|
+
// Components don't have `TView.declTNode` because each instance of component could be
|
|
3786
|
+
// inserted in different location, hence `TView.declTNode` is meaningless.
|
|
3787
|
+
return lView[T_HOST];
|
|
3788
|
+
}
|
|
3789
|
+
return null;
|
|
3790
|
+
}
|
|
3676
3791
|
|
|
3677
3792
|
/**
|
|
3678
3793
|
* @license
|
|
@@ -4496,9 +4611,6 @@ class ReflectionCapabilities {
|
|
|
4496
4611
|
constructor(reflect) {
|
|
4497
4612
|
this._reflect = reflect || _global['Reflect'];
|
|
4498
4613
|
}
|
|
4499
|
-
isReflectionEnabled() {
|
|
4500
|
-
return true;
|
|
4501
|
-
}
|
|
4502
4614
|
factory(t) {
|
|
4503
4615
|
return (...args) => new t(...args);
|
|
4504
4616
|
}
|
|
@@ -4670,38 +4782,6 @@ class ReflectionCapabilities {
|
|
|
4670
4782
|
hasLifecycleHook(type, lcProperty) {
|
|
4671
4783
|
return type instanceof Type && lcProperty in type.prototype;
|
|
4672
4784
|
}
|
|
4673
|
-
guards(type) {
|
|
4674
|
-
return {};
|
|
4675
|
-
}
|
|
4676
|
-
getter(name) {
|
|
4677
|
-
return new Function('o', 'return o.' + name + ';');
|
|
4678
|
-
}
|
|
4679
|
-
setter(name) {
|
|
4680
|
-
return new Function('o', 'v', 'return o.' + name + ' = v;');
|
|
4681
|
-
}
|
|
4682
|
-
method(name) {
|
|
4683
|
-
const functionBody = `if (!o.${name}) throw new Error('"${name}" is undefined');
|
|
4684
|
-
return o.${name}.apply(o, args);`;
|
|
4685
|
-
return new Function('o', 'args', functionBody);
|
|
4686
|
-
}
|
|
4687
|
-
// There is not a concept of import uri in Js, but this is useful in developing Dart applications.
|
|
4688
|
-
importUri(type) {
|
|
4689
|
-
// StaticSymbol
|
|
4690
|
-
if (typeof type === 'object' && type['filePath']) {
|
|
4691
|
-
return type['filePath'];
|
|
4692
|
-
}
|
|
4693
|
-
// Runtime type
|
|
4694
|
-
return `./${stringify(type)}`;
|
|
4695
|
-
}
|
|
4696
|
-
resourceUri(type) {
|
|
4697
|
-
return `./${stringify(type)}`;
|
|
4698
|
-
}
|
|
4699
|
-
resolveIdentifier(name, moduleUrl, members, runtime) {
|
|
4700
|
-
return runtime;
|
|
4701
|
-
}
|
|
4702
|
-
resolveEnum(enumIdentifier, name) {
|
|
4703
|
-
return enumIdentifier[name];
|
|
4704
|
-
}
|
|
4705
4785
|
}
|
|
4706
4786
|
function convertTsickleDecoratorIntoMetadata(decoratorInvocations) {
|
|
4707
4787
|
if (!decoratorInvocations) {
|
|
@@ -4889,7 +4969,7 @@ function catchInjectorError(e, token, injectorErrorName, source) {
|
|
|
4889
4969
|
throw e;
|
|
4890
4970
|
}
|
|
4891
4971
|
function formatError(text, obj, injectorErrorName, source = null) {
|
|
4892
|
-
text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.
|
|
4972
|
+
text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.slice(2) : text;
|
|
4893
4973
|
let context = stringify(obj);
|
|
4894
4974
|
if (Array.isArray(obj)) {
|
|
4895
4975
|
context = obj.map(stringify).join(' -> ');
|
|
@@ -5148,6 +5228,60 @@ function componentDefResolved(type) {
|
|
|
5148
5228
|
componentDefPendingResolution.delete(type);
|
|
5149
5229
|
}
|
|
5150
5230
|
|
|
5231
|
+
/**
|
|
5232
|
+
* @license
|
|
5233
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5234
|
+
*
|
|
5235
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
5236
|
+
* found in the LICENSE file at https://angular.io/license
|
|
5237
|
+
*/
|
|
5238
|
+
/**
|
|
5239
|
+
* Map of module-id to the corresponding NgModule.
|
|
5240
|
+
*/
|
|
5241
|
+
const modules = new Map();
|
|
5242
|
+
/**
|
|
5243
|
+
* Whether to check for duplicate NgModule registrations.
|
|
5244
|
+
*
|
|
5245
|
+
* This can be disabled for testing.
|
|
5246
|
+
*/
|
|
5247
|
+
let checkForDuplicateNgModules = true;
|
|
5248
|
+
function assertSameOrNotExisting(id, type, incoming) {
|
|
5249
|
+
if (type && type !== incoming && checkForDuplicateNgModules) {
|
|
5250
|
+
throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);
|
|
5251
|
+
}
|
|
5252
|
+
}
|
|
5253
|
+
/**
|
|
5254
|
+
* Adds the given NgModule type to Angular's NgModule registry.
|
|
5255
|
+
*
|
|
5256
|
+
* This is generated as a side-effect of NgModule compilation. Note that the `id` is passed in
|
|
5257
|
+
* explicitly and not read from the NgModule definition. This is for two reasons: it avoids a
|
|
5258
|
+
* megamorphic read, and in JIT there's a chicken-and-egg problem where the NgModule may not be
|
|
5259
|
+
* fully resolved when it's registered.
|
|
5260
|
+
*
|
|
5261
|
+
* @codeGenApi
|
|
5262
|
+
*/
|
|
5263
|
+
function registerNgModuleType(ngModuleType, id) {
|
|
5264
|
+
const existing = modules.get(id) || null;
|
|
5265
|
+
assertSameOrNotExisting(id, existing, ngModuleType);
|
|
5266
|
+
modules.set(id, ngModuleType);
|
|
5267
|
+
}
|
|
5268
|
+
function clearModulesForTest() {
|
|
5269
|
+
modules.clear();
|
|
5270
|
+
}
|
|
5271
|
+
function getRegisteredNgModuleType(id) {
|
|
5272
|
+
return modules.get(id);
|
|
5273
|
+
}
|
|
5274
|
+
/**
|
|
5275
|
+
* Control whether the NgModule registration system enforces that each NgModule type registered has
|
|
5276
|
+
* a unique id.
|
|
5277
|
+
*
|
|
5278
|
+
* This is useful for testing as the NgModule registry cannot be properly reset between tests with
|
|
5279
|
+
* Angular's current API.
|
|
5280
|
+
*/
|
|
5281
|
+
function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
5282
|
+
checkForDuplicateNgModules = !allowDuplicates;
|
|
5283
|
+
}
|
|
5284
|
+
|
|
5151
5285
|
/**
|
|
5152
5286
|
* @license
|
|
5153
5287
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6153,6 +6287,78 @@ function getSanitizer() {
|
|
|
6153
6287
|
return lView && lView[SANITIZER];
|
|
6154
6288
|
}
|
|
6155
6289
|
|
|
6290
|
+
/**
|
|
6291
|
+
* @license
|
|
6292
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6293
|
+
*
|
|
6294
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6295
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6296
|
+
*/
|
|
6297
|
+
// Keeps track of the currently-active LViews.
|
|
6298
|
+
const TRACKED_LVIEWS = new Map();
|
|
6299
|
+
// Used for generating unique IDs for LViews.
|
|
6300
|
+
let uniqueIdCounter = 0;
|
|
6301
|
+
/** Gets a unique ID that can be assigned to an LView. */
|
|
6302
|
+
function getUniqueLViewId() {
|
|
6303
|
+
return uniqueIdCounter++;
|
|
6304
|
+
}
|
|
6305
|
+
/** Starts tracking an LView. */
|
|
6306
|
+
function registerLView(lView) {
|
|
6307
|
+
ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');
|
|
6308
|
+
TRACKED_LVIEWS.set(lView[ID], lView);
|
|
6309
|
+
}
|
|
6310
|
+
/** Gets an LView by its unique ID. */
|
|
6311
|
+
function getLViewById(id) {
|
|
6312
|
+
ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');
|
|
6313
|
+
return TRACKED_LVIEWS.get(id) || null;
|
|
6314
|
+
}
|
|
6315
|
+
/** Stops tracking an LView. */
|
|
6316
|
+
function unregisterLView(lView) {
|
|
6317
|
+
ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');
|
|
6318
|
+
TRACKED_LVIEWS.delete(lView[ID]);
|
|
6319
|
+
}
|
|
6320
|
+
|
|
6321
|
+
/**
|
|
6322
|
+
* @license
|
|
6323
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6324
|
+
*
|
|
6325
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6326
|
+
* found in the LICENSE file at https://angular.io/license
|
|
6327
|
+
*/
|
|
6328
|
+
/**
|
|
6329
|
+
* The internal view context which is specific to a given DOM element, directive or
|
|
6330
|
+
* component instance. Each value in here (besides the LView and element node details)
|
|
6331
|
+
* can be present, null or undefined. If undefined then it implies the value has not been
|
|
6332
|
+
* looked up yet, otherwise, if null, then a lookup was executed and nothing was found.
|
|
6333
|
+
*
|
|
6334
|
+
* Each value will get filled when the respective value is examined within the getContext
|
|
6335
|
+
* function. The component, element and each directive instance will share the same instance
|
|
6336
|
+
* of the context.
|
|
6337
|
+
*/
|
|
6338
|
+
class LContext {
|
|
6339
|
+
constructor(
|
|
6340
|
+
/**
|
|
6341
|
+
* ID of the component's parent view data.
|
|
6342
|
+
*/
|
|
6343
|
+
lViewId,
|
|
6344
|
+
/**
|
|
6345
|
+
* The index instance of the node.
|
|
6346
|
+
*/
|
|
6347
|
+
nodeIndex,
|
|
6348
|
+
/**
|
|
6349
|
+
* The instance of the DOM node that is attached to the lNode.
|
|
6350
|
+
*/
|
|
6351
|
+
native) {
|
|
6352
|
+
this.lViewId = lViewId;
|
|
6353
|
+
this.nodeIndex = nodeIndex;
|
|
6354
|
+
this.native = native;
|
|
6355
|
+
}
|
|
6356
|
+
/** Component's parent view data. */
|
|
6357
|
+
get lView() {
|
|
6358
|
+
return getLViewById(this.lViewId);
|
|
6359
|
+
}
|
|
6360
|
+
}
|
|
6361
|
+
|
|
6156
6362
|
/**
|
|
6157
6363
|
* @license
|
|
6158
6364
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6185,7 +6391,7 @@ function getLContext(target) {
|
|
|
6185
6391
|
if (mpValue) {
|
|
6186
6392
|
// only when it's an array is it considered an LView instance
|
|
6187
6393
|
// ... otherwise it's an already constructed LContext instance
|
|
6188
|
-
if (
|
|
6394
|
+
if (isLView(mpValue)) {
|
|
6189
6395
|
const lView = mpValue;
|
|
6190
6396
|
let nodeIndex;
|
|
6191
6397
|
let component = undefined;
|
|
@@ -6244,13 +6450,7 @@ function getLContext(target) {
|
|
|
6244
6450
|
while (parent = parent.parentNode) {
|
|
6245
6451
|
const parentContext = readPatchedData(parent);
|
|
6246
6452
|
if (parentContext) {
|
|
6247
|
-
|
|
6248
|
-
if (Array.isArray(parentContext)) {
|
|
6249
|
-
lView = parentContext;
|
|
6250
|
-
}
|
|
6251
|
-
else {
|
|
6252
|
-
lView = parentContext.lView;
|
|
6253
|
-
}
|
|
6453
|
+
const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;
|
|
6254
6454
|
// the edge of the app was also reached here through another means
|
|
6255
6455
|
// (maybe because the DOM was changed manually).
|
|
6256
6456
|
if (!lView) {
|
|
@@ -6273,14 +6473,7 @@ function getLContext(target) {
|
|
|
6273
6473
|
* Creates an empty instance of a `LContext` context
|
|
6274
6474
|
*/
|
|
6275
6475
|
function createLContext(lView, nodeIndex, native) {
|
|
6276
|
-
return
|
|
6277
|
-
lView,
|
|
6278
|
-
nodeIndex,
|
|
6279
|
-
native,
|
|
6280
|
-
component: undefined,
|
|
6281
|
-
directives: undefined,
|
|
6282
|
-
localRefs: undefined,
|
|
6283
|
-
};
|
|
6476
|
+
return new LContext(lView[ID], nodeIndex, native);
|
|
6284
6477
|
}
|
|
6285
6478
|
/**
|
|
6286
6479
|
* Takes a component instance and returns the view for that component.
|
|
@@ -6289,21 +6482,24 @@ function createLContext(lView, nodeIndex, native) {
|
|
|
6289
6482
|
* @returns The component's view
|
|
6290
6483
|
*/
|
|
6291
6484
|
function getComponentViewByInstance(componentInstance) {
|
|
6292
|
-
let
|
|
6293
|
-
let
|
|
6294
|
-
if (
|
|
6295
|
-
const
|
|
6296
|
-
|
|
6297
|
-
|
|
6485
|
+
let patchedData = readPatchedData(componentInstance);
|
|
6486
|
+
let lView;
|
|
6487
|
+
if (isLView(patchedData)) {
|
|
6488
|
+
const contextLView = patchedData;
|
|
6489
|
+
const nodeIndex = findViaComponent(contextLView, componentInstance);
|
|
6490
|
+
lView = getComponentLViewByIndex(nodeIndex, contextLView);
|
|
6491
|
+
const context = createLContext(contextLView, nodeIndex, lView[HOST]);
|
|
6298
6492
|
context.component = componentInstance;
|
|
6299
6493
|
attachPatchData(componentInstance, context);
|
|
6300
6494
|
attachPatchData(context.native, context);
|
|
6301
6495
|
}
|
|
6302
6496
|
else {
|
|
6303
|
-
const context =
|
|
6304
|
-
|
|
6497
|
+
const context = patchedData;
|
|
6498
|
+
const contextLView = context.lView;
|
|
6499
|
+
ngDevMode && assertLView(contextLView);
|
|
6500
|
+
lView = getComponentLViewByIndex(context.nodeIndex, contextLView);
|
|
6305
6501
|
}
|
|
6306
|
-
return
|
|
6502
|
+
return lView;
|
|
6307
6503
|
}
|
|
6308
6504
|
/**
|
|
6309
6505
|
* This property will be monkey-patched on elements, components and directives.
|
|
@@ -6315,7 +6511,16 @@ const MONKEY_PATCH_KEY_NAME = '__ngContext__';
|
|
|
6315
6511
|
*/
|
|
6316
6512
|
function attachPatchData(target, data) {
|
|
6317
6513
|
ngDevMode && assertDefined(target, 'Target expected');
|
|
6318
|
-
|
|
6514
|
+
// Only attach the ID of the view in order to avoid memory leaks (see #41047). We only do this
|
|
6515
|
+
// for `LView`, because we have control over when an `LView` is created and destroyed, whereas
|
|
6516
|
+
// we can't know when to remove an `LContext`.
|
|
6517
|
+
if (isLView(data)) {
|
|
6518
|
+
target[MONKEY_PATCH_KEY_NAME] = data[ID];
|
|
6519
|
+
registerLView(data);
|
|
6520
|
+
}
|
|
6521
|
+
else {
|
|
6522
|
+
target[MONKEY_PATCH_KEY_NAME] = data;
|
|
6523
|
+
}
|
|
6319
6524
|
}
|
|
6320
6525
|
/**
|
|
6321
6526
|
* Returns the monkey-patch value data present on the target (which could be
|
|
@@ -6323,12 +6528,13 @@ function attachPatchData(target, data) {
|
|
|
6323
6528
|
*/
|
|
6324
6529
|
function readPatchedData(target) {
|
|
6325
6530
|
ngDevMode && assertDefined(target, 'Target expected');
|
|
6326
|
-
|
|
6531
|
+
const data = target[MONKEY_PATCH_KEY_NAME];
|
|
6532
|
+
return (typeof data === 'number') ? getLViewById(data) : data || null;
|
|
6327
6533
|
}
|
|
6328
6534
|
function readPatchedLView(target) {
|
|
6329
6535
|
const value = readPatchedData(target);
|
|
6330
6536
|
if (value) {
|
|
6331
|
-
return
|
|
6537
|
+
return isLView(value) ? value : value.lView;
|
|
6332
6538
|
}
|
|
6333
6539
|
return null;
|
|
6334
6540
|
}
|
|
@@ -7275,6 +7481,8 @@ function cleanUpView(tView, lView) {
|
|
|
7275
7481
|
lQueries.detachView(tView);
|
|
7276
7482
|
}
|
|
7277
7483
|
}
|
|
7484
|
+
// Unregister the view once everything else has been cleaned up.
|
|
7485
|
+
unregisterLView(lView);
|
|
7278
7486
|
}
|
|
7279
7487
|
}
|
|
7280
7488
|
/** Removes listeners and unsubscribes from output subscriptions */
|
|
@@ -7442,7 +7650,8 @@ function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
|
7442
7650
|
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
7443
7651
|
}
|
|
7444
7652
|
else {
|
|
7445
|
-
parent.
|
|
7653
|
+
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7654
|
+
targetParent.insertBefore(child, beforeNode, isMove);
|
|
7446
7655
|
}
|
|
7447
7656
|
}
|
|
7448
7657
|
function nativeAppendChild(renderer, parent, child) {
|
|
@@ -7452,7 +7661,8 @@ function nativeAppendChild(renderer, parent, child) {
|
|
|
7452
7661
|
renderer.appendChild(parent, child);
|
|
7453
7662
|
}
|
|
7454
7663
|
else {
|
|
7455
|
-
parent.
|
|
7664
|
+
const targetParent = isTemplateNode(parent) ? parent.content : parent;
|
|
7665
|
+
targetParent.appendChild(child);
|
|
7456
7666
|
}
|
|
7457
7667
|
}
|
|
7458
7668
|
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
@@ -7472,6 +7682,10 @@ function nativeRemoveChild(renderer, parent, child, isHostElement) {
|
|
|
7472
7682
|
parent.removeChild(child);
|
|
7473
7683
|
}
|
|
7474
7684
|
}
|
|
7685
|
+
/** Checks if an element is a `<template>` node. */
|
|
7686
|
+
function isTemplateNode(node) {
|
|
7687
|
+
return node.tagName === 'TEMPLATE' && node.content !== undefined;
|
|
7688
|
+
}
|
|
7475
7689
|
/**
|
|
7476
7690
|
* Returns a native parent of a given native node.
|
|
7477
7691
|
*/
|
|
@@ -8641,7 +8855,7 @@ function nameSuffix(text) {
|
|
|
8641
8855
|
if (text == null)
|
|
8642
8856
|
return '';
|
|
8643
8857
|
const index = text.lastIndexOf('_Template');
|
|
8644
|
-
return '_' + (index === -1 ? text : text.
|
|
8858
|
+
return '_' + (index === -1 ? text : text.slice(0, index));
|
|
8645
8859
|
}
|
|
8646
8860
|
/**
|
|
8647
8861
|
* This class is a debug version of Object literal so that we can have constructor name show up
|
|
@@ -8992,7 +9206,7 @@ class LViewDebug {
|
|
|
8992
9206
|
attached: !!(flags & 128 /* Attached */),
|
|
8993
9207
|
destroyed: !!(flags & 256 /* Destroyed */),
|
|
8994
9208
|
isRoot: !!(flags & 512 /* IsRoot */),
|
|
8995
|
-
indexWithinInitPhase: flags >>
|
|
9209
|
+
indexWithinInitPhase: flags >> 12 /* IndexWithinInitPhaseShift */,
|
|
8996
9210
|
};
|
|
8997
9211
|
}
|
|
8998
9212
|
get parent() {
|
|
@@ -9055,6 +9269,9 @@ class LViewDebug {
|
|
|
9055
9269
|
get tHost() {
|
|
9056
9270
|
return this._raw_lView[T_HOST];
|
|
9057
9271
|
}
|
|
9272
|
+
get id() {
|
|
9273
|
+
return this._raw_lView[ID];
|
|
9274
|
+
}
|
|
9058
9275
|
get decls() {
|
|
9059
9276
|
return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);
|
|
9060
9277
|
}
|
|
@@ -9284,10 +9501,14 @@ function renderChildComponents(hostLView, components) {
|
|
|
9284
9501
|
renderComponent$1(hostLView, components[i]);
|
|
9285
9502
|
}
|
|
9286
9503
|
}
|
|
9287
|
-
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector) {
|
|
9504
|
+
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
9288
9505
|
const lView = ngDevMode ? cloneToLViewFromTViewBlueprint(tView) : tView.blueprint.slice();
|
|
9289
9506
|
lView[HOST] = host;
|
|
9290
9507
|
lView[FLAGS] = flags | 4 /* CreationMode */ | 128 /* Attached */ | 8 /* FirstLViewPass */;
|
|
9508
|
+
if (embeddedViewInjector !== null ||
|
|
9509
|
+
(parentLView && (parentLView[FLAGS] & 2048 /* HasEmbeddedViewInjector */))) {
|
|
9510
|
+
lView[FLAGS] |= 2048 /* HasEmbeddedViewInjector */;
|
|
9511
|
+
}
|
|
9291
9512
|
resetPreOrderHookFlags(lView);
|
|
9292
9513
|
ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);
|
|
9293
9514
|
lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;
|
|
@@ -9299,6 +9520,8 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
|
|
|
9299
9520
|
lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null;
|
|
9300
9521
|
lView[INJECTOR$1] = injector || parentLView && parentLView[INJECTOR$1] || null;
|
|
9301
9522
|
lView[T_HOST] = tHostNode;
|
|
9523
|
+
lView[ID] = getUniqueLViewId();
|
|
9524
|
+
lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
|
|
9302
9525
|
ngDevMode &&
|
|
9303
9526
|
assertEqual(tView.type == 2 /* Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
9304
9527
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
@@ -10050,7 +10273,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
|
|
|
10050
10273
|
else if (tNode.type & 12 /* AnyContainer */) {
|
|
10051
10274
|
// If the node is a container and the property didn't
|
|
10052
10275
|
// match any of the inputs or schemas we should throw.
|
|
10053
|
-
if (ngDevMode && !matchingSchemas(tView, tNode.value)) {
|
|
10276
|
+
if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
|
|
10054
10277
|
logUnknownPropertyError(propName, tNode);
|
|
10055
10278
|
}
|
|
10056
10279
|
}
|
|
@@ -10112,15 +10335,20 @@ function validateProperty(tView, element, propName, tNode) {
|
|
|
10112
10335
|
return true;
|
|
10113
10336
|
// The property is considered valid if the element matches the schema, it exists on the element
|
|
10114
10337
|
// or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
|
|
10115
|
-
if (matchingSchemas(tView, tNode.value) || propName in element ||
|
|
10338
|
+
if (matchingSchemas(tView.schemas, tNode.value) || propName in element ||
|
|
10339
|
+
isAnimationProp(propName)) {
|
|
10116
10340
|
return true;
|
|
10117
10341
|
}
|
|
10118
10342
|
// Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
|
|
10119
10343
|
// need to account for both here, while being careful for `typeof null` also returning 'object'.
|
|
10120
10344
|
return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
|
|
10121
10345
|
}
|
|
10122
|
-
|
|
10123
|
-
|
|
10346
|
+
/**
|
|
10347
|
+
* Returns true if the tag name is allowed by specified schemas.
|
|
10348
|
+
* @param schemas Array of schemas
|
|
10349
|
+
* @param tagName Name of the tag
|
|
10350
|
+
*/
|
|
10351
|
+
function matchingSchemas(schemas, tagName) {
|
|
10124
10352
|
if (schemas !== null) {
|
|
10125
10353
|
for (let i = 0; i < schemas.length; i++) {
|
|
10126
10354
|
const schema = schemas[i];
|
|
@@ -10307,7 +10535,6 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
|
|
|
10307
10535
|
function invokeDirectivesHostBindings(tView, lView, tNode) {
|
|
10308
10536
|
const start = tNode.directiveStart;
|
|
10309
10537
|
const end = tNode.directiveEnd;
|
|
10310
|
-
const firstCreatePass = tView.firstCreatePass;
|
|
10311
10538
|
const elementIndex = tNode.index;
|
|
10312
10539
|
const currentDirectiveIndex = getCurrentDirectiveIndex();
|
|
10313
10540
|
try {
|
|
@@ -10392,7 +10619,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
|
10392
10619
|
for (let i = 0; i < localRefs.length; i += 2) {
|
|
10393
10620
|
const index = exportsMap[localRefs[i + 1]];
|
|
10394
10621
|
if (index == null)
|
|
10395
|
-
throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
|
|
10622
|
+
throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);
|
|
10396
10623
|
localNames.push(localRefs[i], index);
|
|
10397
10624
|
}
|
|
10398
10625
|
}
|
|
@@ -10454,7 +10681,7 @@ function addComponentLogic(lView, hostTNode, def) {
|
|
|
10454
10681
|
// Only component views should be added to the view tree directly. Embedded views are
|
|
10455
10682
|
// accessed through their containers because they may be removed / re-added later.
|
|
10456
10683
|
const rendererFactory = lView[RENDERER_FACTORY];
|
|
10457
|
-
const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null));
|
|
10684
|
+
const componentView = addToViewTree(lView, createLView(lView, tView, null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, native, hostTNode, rendererFactory, rendererFactory.createRenderer(native, def), null, null, null));
|
|
10458
10685
|
// Component view will always be created before any injected LContainers,
|
|
10459
10686
|
// so this is a regular element, wrap it with the component view
|
|
10460
10687
|
lView[hostTNode.index] = componentView;
|
|
@@ -10823,8 +11050,11 @@ function tickRootContext(rootContext) {
|
|
|
10823
11050
|
for (let i = 0; i < rootContext.components.length; i++) {
|
|
10824
11051
|
const rootComponent = rootContext.components[i];
|
|
10825
11052
|
const lView = readPatchedLView(rootComponent);
|
|
10826
|
-
|
|
10827
|
-
|
|
11053
|
+
// We might not have an `LView` if the component was destroyed.
|
|
11054
|
+
if (lView !== null) {
|
|
11055
|
+
const tView = lView[TVIEW];
|
|
11056
|
+
renderComponentOrTemplate(tView, lView, tView.template, rootComponent);
|
|
11057
|
+
}
|
|
10828
11058
|
}
|
|
10829
11059
|
}
|
|
10830
11060
|
function detectChangesInternal(tView, lView, context) {
|
|
@@ -11318,10 +11548,7 @@ class R3Injector {
|
|
|
11318
11548
|
}
|
|
11319
11549
|
assertNotDestroyed() {
|
|
11320
11550
|
if (this._destroyed) {
|
|
11321
|
-
|
|
11322
|
-
'Injector has already been destroyed.' :
|
|
11323
|
-
'';
|
|
11324
|
-
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
|
|
11551
|
+
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
|
|
11325
11552
|
}
|
|
11326
11553
|
}
|
|
11327
11554
|
/**
|
|
@@ -11485,28 +11712,21 @@ function injectableDefOrInjectorDefFactory(token) {
|
|
|
11485
11712
|
// InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
|
|
11486
11713
|
// If it's missing that, it's an error.
|
|
11487
11714
|
if (token instanceof InjectionToken) {
|
|
11488
|
-
|
|
11489
|
-
`Token ${stringify(token)} is missing a ɵprov definition.` :
|
|
11490
|
-
'';
|
|
11491
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11715
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && `Token ${stringify(token)} is missing a ɵprov definition.`);
|
|
11492
11716
|
}
|
|
11493
11717
|
// Undecorated types can sometimes be created if they have no constructor arguments.
|
|
11494
11718
|
if (token instanceof Function) {
|
|
11495
11719
|
return getUndecoratedInjectableFactory(token);
|
|
11496
11720
|
}
|
|
11497
11721
|
// There was no way to resolve a factory for this token.
|
|
11498
|
-
|
|
11499
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11722
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && 'unreachable');
|
|
11500
11723
|
}
|
|
11501
11724
|
function getUndecoratedInjectableFactory(token) {
|
|
11502
11725
|
// If the token has parameters then it has dependencies that we cannot resolve implicitly.
|
|
11503
11726
|
const paramLength = token.length;
|
|
11504
11727
|
if (paramLength > 0) {
|
|
11505
11728
|
const args = newArray(paramLength, '?');
|
|
11506
|
-
|
|
11507
|
-
`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
|
|
11508
|
-
'';
|
|
11509
|
-
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11729
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
|
|
11510
11730
|
}
|
|
11511
11731
|
// The constructor function appears to have no parameters.
|
|
11512
11732
|
// This might be because it inherits from a super-class. In which case, use an injectable
|
|
@@ -11692,12 +11912,16 @@ Injector.__NG_ELEMENT_ID__ = -1 /* Injector */;
|
|
|
11692
11912
|
* @globalApi ng
|
|
11693
11913
|
*/
|
|
11694
11914
|
function getComponent$1(element) {
|
|
11695
|
-
assertDomElement(element);
|
|
11915
|
+
ngDevMode && assertDomElement(element);
|
|
11696
11916
|
const context = getLContext(element);
|
|
11697
11917
|
if (context === null)
|
|
11698
11918
|
return null;
|
|
11699
11919
|
if (context.component === undefined) {
|
|
11700
|
-
|
|
11920
|
+
const lView = context.lView;
|
|
11921
|
+
if (lView === null) {
|
|
11922
|
+
return null;
|
|
11923
|
+
}
|
|
11924
|
+
context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
|
|
11701
11925
|
}
|
|
11702
11926
|
return context.component;
|
|
11703
11927
|
}
|
|
@@ -11716,7 +11940,8 @@ function getComponent$1(element) {
|
|
|
11716
11940
|
function getContext(element) {
|
|
11717
11941
|
assertDomElement(element);
|
|
11718
11942
|
const context = getLContext(element);
|
|
11719
|
-
|
|
11943
|
+
const lView = context ? context.lView : null;
|
|
11944
|
+
return lView === null ? null : lView[CONTEXT];
|
|
11720
11945
|
}
|
|
11721
11946
|
/**
|
|
11722
11947
|
* Retrieves the component instance whose view contains the DOM element.
|
|
@@ -11735,11 +11960,10 @@ function getContext(element) {
|
|
|
11735
11960
|
*/
|
|
11736
11961
|
function getOwningComponent(elementOrDir) {
|
|
11737
11962
|
const context = getLContext(elementOrDir);
|
|
11738
|
-
|
|
11963
|
+
let lView = context ? context.lView : null;
|
|
11964
|
+
if (lView === null)
|
|
11739
11965
|
return null;
|
|
11740
|
-
let lView = context.lView;
|
|
11741
11966
|
let parent;
|
|
11742
|
-
ngDevMode && assertLView(lView);
|
|
11743
11967
|
while (lView[TVIEW].type === 2 /* Embedded */ && (parent = getLViewParent(lView))) {
|
|
11744
11968
|
lView = parent;
|
|
11745
11969
|
}
|
|
@@ -11757,7 +11981,8 @@ function getOwningComponent(elementOrDir) {
|
|
|
11757
11981
|
* @globalApi ng
|
|
11758
11982
|
*/
|
|
11759
11983
|
function getRootComponents(elementOrDir) {
|
|
11760
|
-
|
|
11984
|
+
const lView = readPatchedLView(elementOrDir);
|
|
11985
|
+
return lView !== null ? [...getRootContext(lView).components] : [];
|
|
11761
11986
|
}
|
|
11762
11987
|
/**
|
|
11763
11988
|
* Retrieves an `Injector` associated with an element, component or directive instance.
|
|
@@ -11771,10 +11996,11 @@ function getRootComponents(elementOrDir) {
|
|
|
11771
11996
|
*/
|
|
11772
11997
|
function getInjector(elementOrDir) {
|
|
11773
11998
|
const context = getLContext(elementOrDir);
|
|
11774
|
-
|
|
11999
|
+
const lView = context ? context.lView : null;
|
|
12000
|
+
if (lView === null)
|
|
11775
12001
|
return Injector.NULL;
|
|
11776
|
-
const tNode =
|
|
11777
|
-
return new NodeInjector(tNode,
|
|
12002
|
+
const tNode = lView[TVIEW].data[context.nodeIndex];
|
|
12003
|
+
return new NodeInjector(tNode, lView);
|
|
11778
12004
|
}
|
|
11779
12005
|
/**
|
|
11780
12006
|
* Retrieve a set of injection tokens at a given DOM node.
|
|
@@ -11783,9 +12009,9 @@ function getInjector(elementOrDir) {
|
|
|
11783
12009
|
*/
|
|
11784
12010
|
function getInjectionTokens(element) {
|
|
11785
12011
|
const context = getLContext(element);
|
|
11786
|
-
|
|
12012
|
+
const lView = context ? context.lView : null;
|
|
12013
|
+
if (lView === null)
|
|
11787
12014
|
return [];
|
|
11788
|
-
const lView = context.lView;
|
|
11789
12015
|
const tView = lView[TVIEW];
|
|
11790
12016
|
const tNode = tView.data[context.nodeIndex];
|
|
11791
12017
|
const providerTokens = [];
|
|
@@ -11835,10 +12061,10 @@ function getDirectives(node) {
|
|
|
11835
12061
|
return [];
|
|
11836
12062
|
}
|
|
11837
12063
|
const context = getLContext(node);
|
|
11838
|
-
|
|
12064
|
+
const lView = context ? context.lView : null;
|
|
12065
|
+
if (lView === null) {
|
|
11839
12066
|
return [];
|
|
11840
12067
|
}
|
|
11841
|
-
const lView = context.lView;
|
|
11842
12068
|
const tView = lView[TVIEW];
|
|
11843
12069
|
const nodeIndex = context.nodeIndex;
|
|
11844
12070
|
if (!tView?.data[nodeIndex]) {
|
|
@@ -11898,7 +12124,11 @@ function getLocalRefs(target) {
|
|
|
11898
12124
|
if (context === null)
|
|
11899
12125
|
return {};
|
|
11900
12126
|
if (context.localRefs === undefined) {
|
|
11901
|
-
|
|
12127
|
+
const lView = context.lView;
|
|
12128
|
+
if (lView === null) {
|
|
12129
|
+
return {};
|
|
12130
|
+
}
|
|
12131
|
+
context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
|
|
11902
12132
|
}
|
|
11903
12133
|
return context.localRefs || {};
|
|
11904
12134
|
}
|
|
@@ -11962,11 +12192,11 @@ function getRenderedText(component) {
|
|
|
11962
12192
|
* @globalApi ng
|
|
11963
12193
|
*/
|
|
11964
12194
|
function getListeners(element) {
|
|
11965
|
-
assertDomElement(element);
|
|
12195
|
+
ngDevMode && assertDomElement(element);
|
|
11966
12196
|
const lContext = getLContext(element);
|
|
11967
|
-
|
|
12197
|
+
const lView = lContext === null ? null : lContext.lView;
|
|
12198
|
+
if (lView === null)
|
|
11968
12199
|
return [];
|
|
11969
|
-
const lView = lContext.lView;
|
|
11970
12200
|
const tView = lView[TVIEW];
|
|
11971
12201
|
const lCleanup = lView[CLEANUP];
|
|
11972
12202
|
const tCleanup = tView.cleanup;
|
|
@@ -12017,10 +12247,10 @@ function getDebugNode$1(element) {
|
|
|
12017
12247
|
throw new Error('Expecting instance of DOM Element');
|
|
12018
12248
|
}
|
|
12019
12249
|
const lContext = getLContext(element);
|
|
12020
|
-
|
|
12250
|
+
const lView = lContext ? lContext.lView : null;
|
|
12251
|
+
if (lView === null) {
|
|
12021
12252
|
return null;
|
|
12022
12253
|
}
|
|
12023
|
-
const lView = lContext.lView;
|
|
12024
12254
|
const nodeIndex = lContext.nodeIndex;
|
|
12025
12255
|
if (nodeIndex !== -1) {
|
|
12026
12256
|
const valueInLView = lView[nodeIndex];
|
|
@@ -12045,6 +12275,7 @@ function getComponentLView(target) {
|
|
|
12045
12275
|
const lContext = getLContext(target);
|
|
12046
12276
|
const nodeIndx = lContext.nodeIndex;
|
|
12047
12277
|
const lView = lContext.lView;
|
|
12278
|
+
ngDevMode && assertLView(lView);
|
|
12048
12279
|
const componentLView = lView[nodeIndx];
|
|
12049
12280
|
ngDevMode && assertLView(componentLView);
|
|
12050
12281
|
return componentLView;
|
|
@@ -12192,7 +12423,7 @@ function renderComponent(componentType /* Type as workaround for: Microsoft/Type
|
|
|
12192
12423
|
const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
|
|
12193
12424
|
const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
|
|
12194
12425
|
const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
|
|
12195
|
-
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null);
|
|
12426
|
+
const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
|
|
12196
12427
|
enterView(rootView);
|
|
12197
12428
|
let component;
|
|
12198
12429
|
try {
|
|
@@ -12247,7 +12478,7 @@ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRend
|
|
|
12247
12478
|
}
|
|
12248
12479
|
}
|
|
12249
12480
|
const viewRenderer = rendererFactory.createRenderer(rNode, def);
|
|
12250
|
-
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null);
|
|
12481
|
+
const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 64 /* Dirty */ : 16 /* CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
|
|
12251
12482
|
if (tView.firstCreatePass) {
|
|
12252
12483
|
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
|
|
12253
12484
|
markAsComponentHost(tView, tNode);
|
|
@@ -13792,75 +14023,6 @@ class KeyRegistry {
|
|
|
13792
14023
|
}
|
|
13793
14024
|
const _globalKeyRegistry = new KeyRegistry();
|
|
13794
14025
|
|
|
13795
|
-
/**
|
|
13796
|
-
* @license
|
|
13797
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13798
|
-
*
|
|
13799
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
13800
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13801
|
-
*/
|
|
13802
|
-
/**
|
|
13803
|
-
* Provides access to reflection data about symbols. Used internally by Angular
|
|
13804
|
-
* to power dependency injection and compilation.
|
|
13805
|
-
*/
|
|
13806
|
-
class Reflector {
|
|
13807
|
-
constructor(reflectionCapabilities) {
|
|
13808
|
-
this.reflectionCapabilities = reflectionCapabilities;
|
|
13809
|
-
}
|
|
13810
|
-
updateCapabilities(caps) {
|
|
13811
|
-
this.reflectionCapabilities = caps;
|
|
13812
|
-
}
|
|
13813
|
-
factory(type) {
|
|
13814
|
-
return this.reflectionCapabilities.factory(type);
|
|
13815
|
-
}
|
|
13816
|
-
parameters(typeOrFunc) {
|
|
13817
|
-
return this.reflectionCapabilities.parameters(typeOrFunc);
|
|
13818
|
-
}
|
|
13819
|
-
annotations(typeOrFunc) {
|
|
13820
|
-
return this.reflectionCapabilities.annotations(typeOrFunc);
|
|
13821
|
-
}
|
|
13822
|
-
propMetadata(typeOrFunc) {
|
|
13823
|
-
return this.reflectionCapabilities.propMetadata(typeOrFunc);
|
|
13824
|
-
}
|
|
13825
|
-
hasLifecycleHook(type, lcProperty) {
|
|
13826
|
-
return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
|
|
13827
|
-
}
|
|
13828
|
-
getter(name) {
|
|
13829
|
-
return this.reflectionCapabilities.getter(name);
|
|
13830
|
-
}
|
|
13831
|
-
setter(name) {
|
|
13832
|
-
return this.reflectionCapabilities.setter(name);
|
|
13833
|
-
}
|
|
13834
|
-
method(name) {
|
|
13835
|
-
return this.reflectionCapabilities.method(name);
|
|
13836
|
-
}
|
|
13837
|
-
importUri(type) {
|
|
13838
|
-
return this.reflectionCapabilities.importUri(type);
|
|
13839
|
-
}
|
|
13840
|
-
resourceUri(type) {
|
|
13841
|
-
return this.reflectionCapabilities.resourceUri(type);
|
|
13842
|
-
}
|
|
13843
|
-
resolveIdentifier(name, moduleUrl, members, runtime) {
|
|
13844
|
-
return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);
|
|
13845
|
-
}
|
|
13846
|
-
resolveEnum(identifier, name) {
|
|
13847
|
-
return this.reflectionCapabilities.resolveEnum(identifier, name);
|
|
13848
|
-
}
|
|
13849
|
-
}
|
|
13850
|
-
|
|
13851
|
-
/**
|
|
13852
|
-
* @license
|
|
13853
|
-
* Copyright Google LLC All Rights Reserved.
|
|
13854
|
-
*
|
|
13855
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
13856
|
-
* found in the LICENSE file at https://angular.io/license
|
|
13857
|
-
*/
|
|
13858
|
-
/**
|
|
13859
|
-
* The {@link Reflector} used internally in Angular to access metadata
|
|
13860
|
-
* about symbols.
|
|
13861
|
-
*/
|
|
13862
|
-
const reflector = new Reflector(new ReflectionCapabilities());
|
|
13863
|
-
|
|
13864
14026
|
/**
|
|
13865
14027
|
* @license
|
|
13866
14028
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -13917,7 +14079,7 @@ function resolveReflectiveFactory(provider) {
|
|
|
13917
14079
|
let resolvedDeps;
|
|
13918
14080
|
if (provider.useClass) {
|
|
13919
14081
|
const useClass = resolveForwardRef(provider.useClass);
|
|
13920
|
-
factoryFn =
|
|
14082
|
+
factoryFn = getReflect().factory(useClass);
|
|
13921
14083
|
resolvedDeps = _dependenciesFor(useClass);
|
|
13922
14084
|
}
|
|
13923
14085
|
else if (provider.useExisting) {
|
|
@@ -14013,7 +14175,7 @@ function constructDependencies(typeOrFunc, dependencies) {
|
|
|
14013
14175
|
}
|
|
14014
14176
|
}
|
|
14015
14177
|
function _dependenciesFor(typeOrFunc) {
|
|
14016
|
-
const params =
|
|
14178
|
+
const params = getReflect().parameters(typeOrFunc);
|
|
14017
14179
|
if (!params)
|
|
14018
14180
|
return [];
|
|
14019
14181
|
if (params.some(p => p == null)) {
|
|
@@ -14480,7 +14642,7 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
|
|
|
14480
14642
|
const attrs = getConstant(tViewConsts, attrsIndex);
|
|
14481
14643
|
const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
|
|
14482
14644
|
const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
|
|
14483
|
-
ngDevMode &&
|
|
14645
|
+
ngDevMode && validateElementIsKnown(native, tNode.value, tView.schemas, hasDirectives);
|
|
14484
14646
|
if (tNode.attrs !== null) {
|
|
14485
14647
|
computeStaticStyling(tNode, tNode.attrs, false);
|
|
14486
14648
|
}
|
|
@@ -14499,6 +14661,7 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
|
|
|
14499
14661
|
* @param name Name of the DOM Node
|
|
14500
14662
|
* @param attrsIndex Index of the element's attributes in the `consts` array.
|
|
14501
14663
|
* @param localRefsIndex Index of the element's local references in the `consts` array.
|
|
14664
|
+
* @returns This function returns itself so that it may be chained.
|
|
14502
14665
|
*
|
|
14503
14666
|
* Attributes and localRefs are passed as an array of strings where elements with an even index
|
|
14504
14667
|
* hold an attribute name and elements with an odd index hold an attribute value, ex.:
|
|
@@ -14550,9 +14713,11 @@ function ɵɵelementStart(index, name, attrsIndex, localRefsIndex) {
|
|
|
14550
14713
|
if (localRefsIndex !== null) {
|
|
14551
14714
|
saveResolvedLocalsInData(lView, tNode);
|
|
14552
14715
|
}
|
|
14716
|
+
return ɵɵelementStart;
|
|
14553
14717
|
}
|
|
14554
14718
|
/**
|
|
14555
14719
|
* Mark the end of the element.
|
|
14720
|
+
* @returns This function returns itself so that it may be chained.
|
|
14556
14721
|
*
|
|
14557
14722
|
* @codeGenApi
|
|
14558
14723
|
*/
|
|
@@ -14583,6 +14748,7 @@ function ɵɵelementEnd() {
|
|
|
14583
14748
|
if (tNode.stylesWithoutHost != null && hasStyleInput(tNode)) {
|
|
14584
14749
|
setDirectiveInputsWhichShadowsStyling(tView, tNode, getLView(), tNode.stylesWithoutHost, false);
|
|
14585
14750
|
}
|
|
14751
|
+
return ɵɵelementEnd;
|
|
14586
14752
|
}
|
|
14587
14753
|
/**
|
|
14588
14754
|
* Creates an empty element using {@link elementStart} and {@link elementEnd}
|
|
@@ -14591,25 +14757,42 @@ function ɵɵelementEnd() {
|
|
|
14591
14757
|
* @param name Name of the DOM Node
|
|
14592
14758
|
* @param attrsIndex Index of the element's attributes in the `consts` array.
|
|
14593
14759
|
* @param localRefsIndex Index of the element's local references in the `consts` array.
|
|
14760
|
+
* @returns This function returns itself so that it may be chained.
|
|
14594
14761
|
*
|
|
14595
14762
|
* @codeGenApi
|
|
14596
14763
|
*/
|
|
14597
14764
|
function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
|
|
14598
14765
|
ɵɵelementStart(index, name, attrsIndex, localRefsIndex);
|
|
14599
14766
|
ɵɵelementEnd();
|
|
14767
|
+
return ɵɵelement;
|
|
14600
14768
|
}
|
|
14601
|
-
|
|
14602
|
-
|
|
14769
|
+
/**
|
|
14770
|
+
* Validates that the element is known at runtime and produces
|
|
14771
|
+
* an error if it's not the case.
|
|
14772
|
+
* This check is relevant for JIT-compiled components (for AOT-compiled
|
|
14773
|
+
* ones this check happens at build time).
|
|
14774
|
+
*
|
|
14775
|
+
* The element is considered known if either:
|
|
14776
|
+
* - it's a known HTML element
|
|
14777
|
+
* - it's a known custom element
|
|
14778
|
+
* - the element matches any directive
|
|
14779
|
+
* - the element is allowed by one of the schemas
|
|
14780
|
+
*
|
|
14781
|
+
* @param element Element to validate
|
|
14782
|
+
* @param tagName Name of the tag to check
|
|
14783
|
+
* @param schemas Array of schemas
|
|
14784
|
+
* @param hasDirectives Boolean indicating that the element matches any directive
|
|
14785
|
+
*/
|
|
14786
|
+
function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
|
|
14603
14787
|
// If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
|
|
14604
14788
|
// mode where this check happens at compile time. In JIT mode, `schemas` is always present and
|
|
14605
14789
|
// defined as an array (as an empty array in case `schemas` field is not defined) and we should
|
|
14606
14790
|
// execute the check below.
|
|
14607
14791
|
if (schemas === null)
|
|
14608
14792
|
return;
|
|
14609
|
-
const tagName = tNode.value;
|
|
14610
14793
|
// If the element matches any directive, it's considered as valid.
|
|
14611
14794
|
if (!hasDirectives && tagName !== null) {
|
|
14612
|
-
// The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered
|
|
14795
|
+
// The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
|
|
14613
14796
|
// as a custom element. Note that unknown elements with a dash in their name won't be instances
|
|
14614
14797
|
// of HTMLUnknownElement in browsers that support web components.
|
|
14615
14798
|
const isUnknown =
|
|
@@ -14619,7 +14802,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
|
|
|
14619
14802
|
element instanceof HTMLUnknownElement) ||
|
|
14620
14803
|
(typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
|
|
14621
14804
|
!customElements.get(tagName));
|
|
14622
|
-
if (isUnknown && !matchingSchemas(
|
|
14805
|
+
if (isUnknown && !matchingSchemas(schemas, tagName)) {
|
|
14623
14806
|
let message = `'${tagName}' is not a known element:\n`;
|
|
14624
14807
|
message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`;
|
|
14625
14808
|
if (tagName && tagName.indexOf('-') > -1) {
|
|
@@ -14665,6 +14848,7 @@ function elementContainerStartFirstCreatePass(index, tView, lView, attrsIndex, l
|
|
|
14665
14848
|
* @param index Index of the element in the LView array
|
|
14666
14849
|
* @param attrsIndex Index of the container attributes in the `consts` array.
|
|
14667
14850
|
* @param localRefsIndex Index of the container's local references in the `consts` array.
|
|
14851
|
+
* @returns This function returns itself so that it may be chained.
|
|
14668
14852
|
*
|
|
14669
14853
|
* Even if this instruction accepts a set of attributes no actual attribute values are propagated to
|
|
14670
14854
|
* the DOM (as a comment node can't have attributes). Attributes are here only for directive
|
|
@@ -14695,9 +14879,11 @@ function ɵɵelementContainerStart(index, attrsIndex, localRefsIndex) {
|
|
|
14695
14879
|
if (localRefsIndex != null) {
|
|
14696
14880
|
saveResolvedLocalsInData(lView, tNode);
|
|
14697
14881
|
}
|
|
14882
|
+
return ɵɵelementContainerStart;
|
|
14698
14883
|
}
|
|
14699
14884
|
/**
|
|
14700
14885
|
* Mark the end of the <ng-container>.
|
|
14886
|
+
* @returns This function returns itself so that it may be chained.
|
|
14701
14887
|
*
|
|
14702
14888
|
* @codeGenApi
|
|
14703
14889
|
*/
|
|
@@ -14719,6 +14905,7 @@ function ɵɵelementContainerEnd() {
|
|
|
14719
14905
|
tView.queries.elementEnd(currentTNode);
|
|
14720
14906
|
}
|
|
14721
14907
|
}
|
|
14908
|
+
return ɵɵelementContainerEnd;
|
|
14722
14909
|
}
|
|
14723
14910
|
/**
|
|
14724
14911
|
* Creates an empty logical container using {@link elementContainerStart}
|
|
@@ -14727,12 +14914,14 @@ function ɵɵelementContainerEnd() {
|
|
|
14727
14914
|
* @param index Index of the element in the LView array
|
|
14728
14915
|
* @param attrsIndex Index of the container attributes in the `consts` array.
|
|
14729
14916
|
* @param localRefsIndex Index of the container's local references in the `consts` array.
|
|
14917
|
+
* @returns This function returns itself so that it may be chained.
|
|
14730
14918
|
*
|
|
14731
14919
|
* @codeGenApi
|
|
14732
14920
|
*/
|
|
14733
14921
|
function ɵɵelementContainer(index, attrsIndex, localRefsIndex) {
|
|
14734
14922
|
ɵɵelementContainerStart(index, attrsIndex, localRefsIndex);
|
|
14735
14923
|
ɵɵelementContainerEnd();
|
|
14924
|
+
return ɵɵelementContainer;
|
|
14736
14925
|
}
|
|
14737
14926
|
|
|
14738
14927
|
/**
|
|
@@ -16301,7 +16490,7 @@ function consumeQuotedText(text, quoteCharCode, startIndex, endIndex) {
|
|
|
16301
16490
|
function malformedStyleError(text, expecting, index) {
|
|
16302
16491
|
ngDevMode && assertEqual(typeof text === 'string', true, 'String expected here');
|
|
16303
16492
|
throw throwError(`Malformed style at location ${index} in string '` + text.substring(0, index) + '[>>' +
|
|
16304
|
-
text.substring(index, index + 1) + '<<]' + text.
|
|
16493
|
+
text.substring(index, index + 1) + '<<]' + text.slice(index + 1) +
|
|
16305
16494
|
`'. Expecting '${expecting}'.`);
|
|
16306
16495
|
}
|
|
16307
16496
|
|
|
@@ -19986,7 +20175,7 @@ function removeInnerTemplateTranslation(message) {
|
|
|
19986
20175
|
}
|
|
19987
20176
|
ngDevMode &&
|
|
19988
20177
|
assertEqual(inTemplate, false, `Tag mismatch: unable to find the end of the sub-template in the translation "${message}"`);
|
|
19989
|
-
res += message.
|
|
20178
|
+
res += message.slice(index);
|
|
19990
20179
|
return res;
|
|
19991
20180
|
}
|
|
19992
20181
|
/**
|
|
@@ -20078,7 +20267,7 @@ function parseICUBlock(pattern) {
|
|
|
20078
20267
|
else {
|
|
20079
20268
|
icuType = 1 /* plural */;
|
|
20080
20269
|
}
|
|
20081
|
-
mainBinding = parseInt(binding.
|
|
20270
|
+
mainBinding = parseInt(binding.slice(1), 10);
|
|
20082
20271
|
return '';
|
|
20083
20272
|
});
|
|
20084
20273
|
const parts = i18nParseTextIntoPartsAndICU(pattern);
|
|
@@ -21083,7 +21272,7 @@ class Version {
|
|
|
21083
21272
|
/**
|
|
21084
21273
|
* @publicApi
|
|
21085
21274
|
*/
|
|
21086
|
-
const VERSION = new Version('14.0.0-next.
|
|
21275
|
+
const VERSION = new Version('14.0.0-next.11');
|
|
21087
21276
|
|
|
21088
21277
|
/**
|
|
21089
21278
|
* @license
|
|
@@ -21489,29 +21678,27 @@ function getNamespace(elementName) {
|
|
|
21489
21678
|
return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
|
|
21490
21679
|
}
|
|
21491
21680
|
/**
|
|
21492
|
-
*
|
|
21493
|
-
*
|
|
21681
|
+
* Injector that looks up a value using a specific injector, before falling back to the module
|
|
21682
|
+
* injector. Used primarily when creating components or embedded views dynamically.
|
|
21494
21683
|
*/
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
get
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
return value;
|
|
21511
|
-
}
|
|
21512
|
-
return moduleInjector.get(token, notFoundValue, flags);
|
|
21684
|
+
class ChainedInjector {
|
|
21685
|
+
constructor(injector, parentInjector) {
|
|
21686
|
+
this.injector = injector;
|
|
21687
|
+
this.parentInjector = parentInjector;
|
|
21688
|
+
}
|
|
21689
|
+
get(token, notFoundValue, flags) {
|
|
21690
|
+
const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
|
|
21691
|
+
if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
|
|
21692
|
+
notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
|
|
21693
|
+
// Return the value from the root element injector when
|
|
21694
|
+
// - it provides it
|
|
21695
|
+
// (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21696
|
+
// - the module injector should not be checked
|
|
21697
|
+
// (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
|
|
21698
|
+
return value;
|
|
21513
21699
|
}
|
|
21514
|
-
|
|
21700
|
+
return this.parentInjector.get(token, notFoundValue, flags);
|
|
21701
|
+
}
|
|
21515
21702
|
}
|
|
21516
21703
|
/**
|
|
21517
21704
|
* Render3 implementation of {@link viewEngine_ComponentFactory}.
|
|
@@ -21539,7 +21726,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
21539
21726
|
}
|
|
21540
21727
|
create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
|
|
21541
21728
|
ngModule = ngModule || this.ngModule;
|
|
21542
|
-
const rootViewInjector = ngModule ?
|
|
21729
|
+
const rootViewInjector = ngModule ? new ChainedInjector(injector, ngModule.injector) : injector;
|
|
21543
21730
|
const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
|
|
21544
21731
|
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
21545
21732
|
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
@@ -21554,7 +21741,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
21554
21741
|
const rootContext = createRootContext();
|
|
21555
21742
|
// Create the root view. Uses empty TView and ContentTemplate.
|
|
21556
21743
|
const rootTView = createTView(0 /* Root */, null, null, 1, 0, null, null, null, null, null);
|
|
21557
|
-
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector);
|
|
21744
|
+
const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
|
|
21558
21745
|
// rootView is the parent when bootstrapping
|
|
21559
21746
|
// TODO(misko): it looks like we are entering view here but we don't really need to as
|
|
21560
21747
|
// `renderView` does that. However as the code is written it is needed because
|
|
@@ -21724,62 +21911,6 @@ class NgModuleRef$1 {
|
|
|
21724
21911
|
class NgModuleFactory$1 {
|
|
21725
21912
|
}
|
|
21726
21913
|
|
|
21727
|
-
/**
|
|
21728
|
-
* @license
|
|
21729
|
-
* Copyright Google LLC All Rights Reserved.
|
|
21730
|
-
*
|
|
21731
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
21732
|
-
* found in the LICENSE file at https://angular.io/license
|
|
21733
|
-
*/
|
|
21734
|
-
/**
|
|
21735
|
-
* Map of module-id to the corresponding NgModule.
|
|
21736
|
-
* - In pre Ivy we track NgModuleFactory,
|
|
21737
|
-
* - In post Ivy we track the NgModuleType
|
|
21738
|
-
*/
|
|
21739
|
-
const modules = new Map();
|
|
21740
|
-
/**
|
|
21741
|
-
* Registers a loaded module. Should only be called from generated NgModuleFactory code.
|
|
21742
|
-
* @publicApi
|
|
21743
|
-
*/
|
|
21744
|
-
function registerModuleFactory(id, factory) {
|
|
21745
|
-
const existing = modules.get(id);
|
|
21746
|
-
assertSameOrNotExisting(id, existing && existing.moduleType, factory.moduleType);
|
|
21747
|
-
modules.set(id, factory);
|
|
21748
|
-
}
|
|
21749
|
-
function assertSameOrNotExisting(id, type, incoming) {
|
|
21750
|
-
if (type && type !== incoming) {
|
|
21751
|
-
throw new Error(`Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);
|
|
21752
|
-
}
|
|
21753
|
-
}
|
|
21754
|
-
function registerNgModuleType(ngModuleType) {
|
|
21755
|
-
const visited = new Set();
|
|
21756
|
-
recurse(ngModuleType);
|
|
21757
|
-
function recurse(ngModuleType) {
|
|
21758
|
-
// The imports array of an NgModule must refer to other NgModules,
|
|
21759
|
-
// so an error is thrown if no module definition is available.
|
|
21760
|
-
const def = getNgModuleDef(ngModuleType, /* throwNotFound */ true);
|
|
21761
|
-
const id = def.id;
|
|
21762
|
-
if (id !== null) {
|
|
21763
|
-
const existing = modules.get(id);
|
|
21764
|
-
assertSameOrNotExisting(id, existing, ngModuleType);
|
|
21765
|
-
modules.set(id, ngModuleType);
|
|
21766
|
-
}
|
|
21767
|
-
const imports = maybeUnwrapFn(def.imports);
|
|
21768
|
-
for (const i of imports) {
|
|
21769
|
-
if (!visited.has(i)) {
|
|
21770
|
-
visited.add(i);
|
|
21771
|
-
recurse(i);
|
|
21772
|
-
}
|
|
21773
|
-
}
|
|
21774
|
-
}
|
|
21775
|
-
}
|
|
21776
|
-
function clearModulesForTest() {
|
|
21777
|
-
modules.clear();
|
|
21778
|
-
}
|
|
21779
|
-
function getRegisteredNgModuleType(id) {
|
|
21780
|
-
return (modules.get(id) || autoRegisterModuleById[id]);
|
|
21781
|
-
}
|
|
21782
|
-
|
|
21783
21914
|
/**
|
|
21784
21915
|
* @license
|
|
21785
21916
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -21850,33 +21981,6 @@ class NgModuleFactory extends NgModuleFactory$1 {
|
|
|
21850
21981
|
constructor(moduleType) {
|
|
21851
21982
|
super();
|
|
21852
21983
|
this.moduleType = moduleType;
|
|
21853
|
-
const ngModuleDef = getNgModuleDef(moduleType);
|
|
21854
|
-
if (ngModuleDef !== null) {
|
|
21855
|
-
// Register the NgModule with Angular's module registry. The location (and hence timing) of
|
|
21856
|
-
// this call is critical to ensure this works correctly (modules get registered when expected)
|
|
21857
|
-
// without bloating bundles (modules are registered when otherwise not referenced).
|
|
21858
|
-
//
|
|
21859
|
-
// In View Engine, registration occurs in the .ngfactory.js file as a side effect. This has
|
|
21860
|
-
// several practical consequences:
|
|
21861
|
-
//
|
|
21862
|
-
// - If an .ngfactory file is not imported from, the module won't be registered (and can be
|
|
21863
|
-
// tree shaken).
|
|
21864
|
-
// - If an .ngfactory file is imported from, the module will be registered even if an instance
|
|
21865
|
-
// is not actually created (via `create` below).
|
|
21866
|
-
// - Since an .ngfactory file in View Engine references the .ngfactory files of the NgModule's
|
|
21867
|
-
// imports,
|
|
21868
|
-
//
|
|
21869
|
-
// In Ivy, things are a bit different. .ngfactory files still exist for compatibility, but are
|
|
21870
|
-
// not a required API to use - there are other ways to obtain an NgModuleFactory for a given
|
|
21871
|
-
// NgModule. Thus, relying on a side effect in the .ngfactory file is not sufficient. Instead,
|
|
21872
|
-
// the side effect of registration is added here, in the constructor of NgModuleFactory,
|
|
21873
|
-
// ensuring no matter how a factory is created, the module is registered correctly.
|
|
21874
|
-
//
|
|
21875
|
-
// An alternative would be to include the registration side effect inline following the actual
|
|
21876
|
-
// NgModule definition. This also has the correct timing, but breaks tree-shaking - modules
|
|
21877
|
-
// will be registered and retained even if they're otherwise never referenced.
|
|
21878
|
-
registerNgModuleType(moduleType);
|
|
21879
|
-
}
|
|
21880
21984
|
}
|
|
21881
21985
|
create(parentInjector) {
|
|
21882
21986
|
return new NgModuleRef(this.moduleType, parentInjector);
|
|
@@ -22674,9 +22778,9 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
|
|
|
22674
22778
|
this._declarationTContainer = _declarationTContainer;
|
|
22675
22779
|
this.elementRef = elementRef;
|
|
22676
22780
|
}
|
|
22677
|
-
createEmbeddedView(context) {
|
|
22781
|
+
createEmbeddedView(context, injector) {
|
|
22678
22782
|
const embeddedTView = this._declarationTContainer.tViews;
|
|
22679
|
-
const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null);
|
|
22783
|
+
const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null, injector || null);
|
|
22680
22784
|
const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
|
|
22681
22785
|
ngDevMode && assertLContainer(declarationLContainer);
|
|
22682
22786
|
embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
|
|
@@ -22792,8 +22896,17 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
22792
22896
|
get length() {
|
|
22793
22897
|
return this._lContainer.length - CONTAINER_HEADER_OFFSET;
|
|
22794
22898
|
}
|
|
22795
|
-
createEmbeddedView(templateRef, context,
|
|
22796
|
-
|
|
22899
|
+
createEmbeddedView(templateRef, context, indexOrOptions) {
|
|
22900
|
+
let index;
|
|
22901
|
+
let injector;
|
|
22902
|
+
if (typeof indexOrOptions === 'number') {
|
|
22903
|
+
index = indexOrOptions;
|
|
22904
|
+
}
|
|
22905
|
+
else if (indexOrOptions != null) {
|
|
22906
|
+
index = indexOrOptions.index;
|
|
22907
|
+
injector = indexOrOptions.injector;
|
|
22908
|
+
}
|
|
22909
|
+
const viewRef = templateRef.createEmbeddedView(context || {}, injector);
|
|
22797
22910
|
this.insert(viewRef, index);
|
|
22798
22911
|
return viewRef;
|
|
22799
22912
|
}
|
|
@@ -22834,11 +22947,29 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
22834
22947
|
componentFactoryOrType :
|
|
22835
22948
|
new ComponentFactory(getComponentDef(componentFactoryOrType));
|
|
22836
22949
|
const contextInjector = injector || this.parentInjector;
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
//
|
|
22840
|
-
//
|
|
22841
|
-
|
|
22950
|
+
// If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.
|
|
22951
|
+
if (!ngModuleRef && componentFactory.ngModule == null) {
|
|
22952
|
+
// For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that
|
|
22953
|
+
// an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an
|
|
22954
|
+
// `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based
|
|
22955
|
+
// use-cases. For the `ComponentFactory` case we preserve backwards-compatibility and try
|
|
22956
|
+
// using a provided injector first, then fall back to the parent injector of this
|
|
22957
|
+
// `ViewContainerRef` instance.
|
|
22958
|
+
//
|
|
22959
|
+
// For the factory-less case, it's critical to establish a connection with the module
|
|
22960
|
+
// injector tree (by retrieving an instance of an `NgModuleRef` and accessing its injector),
|
|
22961
|
+
// so that a component can use DI tokens provided in MgModules. For this reason, we can not
|
|
22962
|
+
// rely on the provided injector, since it might be detached from the DI tree (for example, if
|
|
22963
|
+
// it was created via `Injector.create` without specifying a parent injector, or if an
|
|
22964
|
+
// injector is retrieved from an `NgModuleRef` created via `createNgModuleRef` using an
|
|
22965
|
+
// NgModule outside of a module tree). Instead, we always use `ViewContainerRef`'s parent
|
|
22966
|
+
// injector, which is normally connected to the DI tree, which includes module injector
|
|
22967
|
+
// subtree.
|
|
22968
|
+
const _injector = isComponentFactory ? contextInjector : this.parentInjector;
|
|
22969
|
+
// DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||
|
|
22970
|
+
// undefined` expression which seems to cause internal google apps to fail. This is documented
|
|
22971
|
+
// in the following internal bug issue: go/b/142967802
|
|
22972
|
+
const result = _injector.get(NgModuleRef$1, null);
|
|
22842
22973
|
if (result) {
|
|
22843
22974
|
ngModuleRef = result;
|
|
22844
22975
|
}
|
|
@@ -23528,6 +23659,7 @@ const angularCoreEnv = (() => ({
|
|
|
23528
23659
|
'ɵɵinvalidFactory': ɵɵinvalidFactory,
|
|
23529
23660
|
'ɵɵinvalidFactoryDep': ɵɵinvalidFactoryDep,
|
|
23530
23661
|
'ɵɵtemplateRefExtractor': ɵɵtemplateRefExtractor,
|
|
23662
|
+
'ɵɵresetView': ɵɵresetView,
|
|
23531
23663
|
'ɵɵNgOnChangesFeature': ɵɵNgOnChangesFeature,
|
|
23532
23664
|
'ɵɵProvidersFeature': ɵɵProvidersFeature,
|
|
23533
23665
|
'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,
|
|
@@ -23640,6 +23772,7 @@ const angularCoreEnv = (() => ({
|
|
|
23640
23772
|
'ɵɵresolveBody': ɵɵresolveBody,
|
|
23641
23773
|
'ɵɵsetComponentScope': ɵɵsetComponentScope,
|
|
23642
23774
|
'ɵɵsetNgModuleScope': ɵɵsetNgModuleScope,
|
|
23775
|
+
'ɵɵregisterNgModuleType': registerNgModuleType,
|
|
23643
23776
|
'ɵɵsanitizeHtml': ɵɵsanitizeHtml,
|
|
23644
23777
|
'ɵɵsanitizeStyle': ɵɵsanitizeStyle,
|
|
23645
23778
|
'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,
|
|
@@ -23675,6 +23808,17 @@ function resetJitOptions() {
|
|
|
23675
23808
|
jitOptions = null;
|
|
23676
23809
|
}
|
|
23677
23810
|
|
|
23811
|
+
/**
|
|
23812
|
+
* @license
|
|
23813
|
+
* Copyright Google LLC All Rights Reserved.
|
|
23814
|
+
*
|
|
23815
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
23816
|
+
* found in the LICENSE file at https://angular.io/license
|
|
23817
|
+
*/
|
|
23818
|
+
function patchModuleCompilation() {
|
|
23819
|
+
// Does nothing, but exists as a target for patching.
|
|
23820
|
+
}
|
|
23821
|
+
|
|
23678
23822
|
/**
|
|
23679
23823
|
* @license
|
|
23680
23824
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -23731,7 +23875,11 @@ function isResolvedDeclaration(declaration) {
|
|
|
23731
23875
|
* This function automatically gets called when a class has a `@NgModule` decorator.
|
|
23732
23876
|
*/
|
|
23733
23877
|
function compileNgModule(moduleType, ngModule = {}) {
|
|
23878
|
+
patchModuleCompilation();
|
|
23734
23879
|
compileNgModuleDefs(moduleType, ngModule);
|
|
23880
|
+
if (ngModule.id !== undefined) {
|
|
23881
|
+
registerNgModuleType(moduleType, ngModule.id);
|
|
23882
|
+
}
|
|
23735
23883
|
// Because we don't know if all declarations have resolved yet at the moment the
|
|
23736
23884
|
// NgModule decorator is executing, we're enqueueing the setting of module scope
|
|
23737
23885
|
// on its declarations to be run at a later time when all declarations for the module,
|
|
@@ -24355,7 +24503,10 @@ function directiveMetadata(type, metadata) {
|
|
|
24355
24503
|
usesInheritance: !extendsDirectlyFromObject(type),
|
|
24356
24504
|
exportAs: extractExportAs(metadata.exportAs),
|
|
24357
24505
|
providers: metadata.providers || null,
|
|
24358
|
-
viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery)
|
|
24506
|
+
viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
|
|
24507
|
+
// TODO(alxhub): pass through the standalone flag from the directive metadata once standalone
|
|
24508
|
+
// functionality is fully rolled out.
|
|
24509
|
+
isStandalone: false,
|
|
24359
24510
|
};
|
|
24360
24511
|
}
|
|
24361
24512
|
/**
|
|
@@ -24499,7 +24650,10 @@ function getPipeMetadata(type, meta) {
|
|
|
24499
24650
|
type: type,
|
|
24500
24651
|
name: type.name,
|
|
24501
24652
|
pipeName: meta.name,
|
|
24502
|
-
pure: meta.pure !== undefined ? meta.pure : true
|
|
24653
|
+
pure: meta.pure !== undefined ? meta.pure : true,
|
|
24654
|
+
// TODO(alxhub): pass through the standalone flag from the pipe metadata once standalone
|
|
24655
|
+
// functionality is fully rolled out.
|
|
24656
|
+
isStandalone: false,
|
|
24503
24657
|
};
|
|
24504
24658
|
}
|
|
24505
24659
|
|
|
@@ -24574,19 +24728,20 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
|
|
|
24574
24728
|
*
|
|
24575
24729
|
* ```
|
|
24576
24730
|
*
|
|
24577
|
-
* The following example registers another DOM event handler that listens for key-press
|
|
24731
|
+
* The following example registers another DOM event handler that listens for `Enter` key-press
|
|
24732
|
+
* events on the global `window`.
|
|
24578
24733
|
* ``` ts
|
|
24579
24734
|
* import { HostListener, Component } from "@angular/core";
|
|
24580
24735
|
*
|
|
24581
24736
|
* @Component({
|
|
24582
24737
|
* selector: 'app',
|
|
24583
|
-
* template: `<h1>Hello, you have pressed
|
|
24584
|
-
* increment the counter.
|
|
24738
|
+
* template: `<h1>Hello, you have pressed enter {{counter}} number of times!</h1> Press enter key
|
|
24739
|
+
* to increment the counter.
|
|
24585
24740
|
* <button (click)="resetCounter()">Reset Counter</button>`
|
|
24586
24741
|
* })
|
|
24587
24742
|
* class AppComponent {
|
|
24588
24743
|
* counter = 0;
|
|
24589
|
-
* @HostListener('window:keydown', ['$event'])
|
|
24744
|
+
* @HostListener('window:keydown.enter', ['$event'])
|
|
24590
24745
|
* handleKeyDown(event: KeyboardEvent) {
|
|
24591
24746
|
* this.counter++;
|
|
24592
24747
|
* }
|
|
@@ -24595,6 +24750,14 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
|
|
|
24595
24750
|
* }
|
|
24596
24751
|
* }
|
|
24597
24752
|
* ```
|
|
24753
|
+
* The list of valid key names for `keydown` and `keyup` events
|
|
24754
|
+
* can be found here:
|
|
24755
|
+
* https://www.w3.org/TR/DOM-Level-3-Events-key/#named-key-attribute-values
|
|
24756
|
+
*
|
|
24757
|
+
* Note that keys can also be combined, e.g. `@HostListener('keydown.shift.a')`.
|
|
24758
|
+
*
|
|
24759
|
+
* The global target names that can be used to prefix an event name are
|
|
24760
|
+
* `document:`, `window:` and `body:`.
|
|
24598
24761
|
*
|
|
24599
24762
|
* @Annotation
|
|
24600
24763
|
* @publicApi
|
|
@@ -24792,9 +24955,10 @@ class ApplicationInitStatus {
|
|
|
24792
24955
|
}
|
|
24793
24956
|
}
|
|
24794
24957
|
ApplicationInitStatus.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(ɵɵinject(APP_INITIALIZER, 8)); };
|
|
24795
|
-
ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac });
|
|
24958
|
+
ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' });
|
|
24796
24959
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
|
|
24797
|
-
type: Injectable
|
|
24960
|
+
type: Injectable,
|
|
24961
|
+
args: [{ providedIn: 'root' }]
|
|
24798
24962
|
}], function () { return [{ type: undefined, decorators: [{
|
|
24799
24963
|
type: Inject,
|
|
24800
24964
|
args: [APP_INITIALIZER]
|
|
@@ -24820,7 +24984,10 @@ ApplicationInitStatus.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Appli
|
|
|
24820
24984
|
*
|
|
24821
24985
|
* @publicApi
|
|
24822
24986
|
*/
|
|
24823
|
-
const APP_ID = new InjectionToken('AppId'
|
|
24987
|
+
const APP_ID = new InjectionToken('AppId', {
|
|
24988
|
+
providedIn: 'root',
|
|
24989
|
+
factory: _appIdRandomProviderFactory,
|
|
24990
|
+
});
|
|
24824
24991
|
function _appIdRandomProviderFactory() {
|
|
24825
24992
|
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
|
24826
24993
|
}
|
|
@@ -24863,6 +25030,15 @@ const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
|
|
|
24863
25030
|
* @publicApi
|
|
24864
25031
|
*/
|
|
24865
25032
|
const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
|
|
25033
|
+
// We keep this token here, rather than the animations package, so that modules that only care
|
|
25034
|
+
// about which animations module is loaded (e.g. the CDK) can retrieve it without having to
|
|
25035
|
+
// include extra dependencies. See #44970 for more context.
|
|
25036
|
+
/**
|
|
25037
|
+
* A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
|
|
25038
|
+
* module has been loaded.
|
|
25039
|
+
* @publicApi
|
|
25040
|
+
*/
|
|
25041
|
+
const ANIMATION_MODULE_TYPE = new InjectionToken('AnimationModuleType');
|
|
24866
25042
|
|
|
24867
25043
|
/**
|
|
24868
25044
|
* @license
|
|
@@ -24895,6 +25071,33 @@ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: C
|
|
|
24895
25071
|
* Use of this source code is governed by an MIT-style license that can be
|
|
24896
25072
|
* found in the LICENSE file at https://angular.io/license
|
|
24897
25073
|
*/
|
|
25074
|
+
/**
|
|
25075
|
+
* Work out the locale from the potential global properties.
|
|
25076
|
+
*
|
|
25077
|
+
* * Closure Compiler: use `goog.LOCALE`.
|
|
25078
|
+
* * Ivy enabled: use `$localize.locale`
|
|
25079
|
+
*/
|
|
25080
|
+
function getGlobalLocale() {
|
|
25081
|
+
if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
|
|
25082
|
+
typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
|
|
25083
|
+
// * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
|
|
25084
|
+
// * In order to preserve backwards compatibility, we use Angular default value over
|
|
25085
|
+
// Closure Compiler's one.
|
|
25086
|
+
return goog.LOCALE;
|
|
25087
|
+
}
|
|
25088
|
+
else {
|
|
25089
|
+
// KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
|
|
25090
|
+
// COMPILE-TIME INLINER.
|
|
25091
|
+
//
|
|
25092
|
+
// * During compile time inlining of translations the expression will be replaced
|
|
25093
|
+
// with a string literal that is the current locale. Other forms of this expression are not
|
|
25094
|
+
// guaranteed to be replaced.
|
|
25095
|
+
//
|
|
25096
|
+
// * During runtime translation evaluation, the developer is required to set `$localize.locale`
|
|
25097
|
+
// if required, or just to provide their own `LOCALE_ID` provider.
|
|
25098
|
+
return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
|
|
25099
|
+
}
|
|
25100
|
+
}
|
|
24898
25101
|
/**
|
|
24899
25102
|
* Provide this token to set the locale of your application.
|
|
24900
25103
|
* It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
|
|
@@ -24917,7 +25120,10 @@ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: C
|
|
|
24917
25120
|
*
|
|
24918
25121
|
* @publicApi
|
|
24919
25122
|
*/
|
|
24920
|
-
const LOCALE_ID = new InjectionToken('LocaleId'
|
|
25123
|
+
const LOCALE_ID = new InjectionToken('LocaleId', {
|
|
25124
|
+
providedIn: 'root',
|
|
25125
|
+
factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
|
|
25126
|
+
});
|
|
24921
25127
|
/**
|
|
24922
25128
|
* Provide this token to set the default currency code your application uses for
|
|
24923
25129
|
* CurrencyPipe when there is no currency code passed into it. This is only used by
|
|
@@ -24956,7 +25162,10 @@ const LOCALE_ID = new InjectionToken('LocaleId');
|
|
|
24956
25162
|
*
|
|
24957
25163
|
* @publicApi
|
|
24958
25164
|
*/
|
|
24959
|
-
const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode'
|
|
25165
|
+
const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
|
|
25166
|
+
providedIn: 'root',
|
|
25167
|
+
factory: () => USD_CURRENCY_CODE,
|
|
25168
|
+
});
|
|
24960
25169
|
/**
|
|
24961
25170
|
* Use this token at bootstrap to provide the content of your translation file (`xtb`,
|
|
24962
25171
|
* `xlf` or `xlf2`) when you want to translate your application in another language.
|
|
@@ -25123,9 +25332,10 @@ class Compiler {
|
|
|
25123
25332
|
}
|
|
25124
25333
|
}
|
|
25125
25334
|
Compiler.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); };
|
|
25126
|
-
Compiler.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac });
|
|
25335
|
+
Compiler.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' });
|
|
25127
25336
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
|
|
25128
|
-
type: Injectable
|
|
25337
|
+
type: Injectable,
|
|
25338
|
+
args: [{ providedIn: 'root' }]
|
|
25129
25339
|
}], null, null); })();
|
|
25130
25340
|
/**
|
|
25131
25341
|
* Token to provide CompilerOptions in the platform injector.
|
|
@@ -25998,26 +26208,7 @@ class PlatformRef {
|
|
|
25998
26208
|
this._destroyed = false;
|
|
25999
26209
|
}
|
|
26000
26210
|
/**
|
|
26001
|
-
* Creates an instance of an `@NgModule` for the given platform
|
|
26002
|
-
*
|
|
26003
|
-
* @usageNotes
|
|
26004
|
-
*
|
|
26005
|
-
* The following example creates the NgModule for a browser platform.
|
|
26006
|
-
*
|
|
26007
|
-
* ```typescript
|
|
26008
|
-
* my_module.ts:
|
|
26009
|
-
*
|
|
26010
|
-
* @NgModule({
|
|
26011
|
-
* imports: [BrowserModule]
|
|
26012
|
-
* })
|
|
26013
|
-
* class MyModule {}
|
|
26014
|
-
*
|
|
26015
|
-
* main.ts:
|
|
26016
|
-
* import {MyModuleNgFactory} from './my_module.ngfactory';
|
|
26017
|
-
* import {platformBrowser} from '@angular/platform-browser';
|
|
26018
|
-
*
|
|
26019
|
-
* let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);
|
|
26020
|
-
* ```
|
|
26211
|
+
* Creates an instance of an `@NgModule` for the given platform.
|
|
26021
26212
|
*
|
|
26022
26213
|
* @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
|
|
26023
26214
|
* argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
|
|
@@ -26071,7 +26262,7 @@ class PlatformRef {
|
|
|
26071
26262
|
});
|
|
26072
26263
|
}
|
|
26073
26264
|
/**
|
|
26074
|
-
* Creates an instance of an `@NgModule` for a given platform
|
|
26265
|
+
* Creates an instance of an `@NgModule` for a given platform.
|
|
26075
26266
|
*
|
|
26076
26267
|
* @usageNotes
|
|
26077
26268
|
* ### Simple Example
|
|
@@ -26505,9 +26696,10 @@ class ApplicationRef {
|
|
|
26505
26696
|
}
|
|
26506
26697
|
}
|
|
26507
26698
|
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver$1), ɵɵinject(ApplicationInitStatus)); };
|
|
26508
|
-
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac });
|
|
26699
|
+
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
26509
26700
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
26510
|
-
type: Injectable
|
|
26701
|
+
type: Injectable,
|
|
26702
|
+
args: [{ providedIn: 'root' }]
|
|
26511
26703
|
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver$1 }, { type: ApplicationInitStatus }]; }, null); })();
|
|
26512
26704
|
function remove(list, el) {
|
|
26513
26705
|
const index = list.indexOf(el);
|
|
@@ -26814,8 +27006,6 @@ var ng_module_factory_loader_impl = {};
|
|
|
26814
27006
|
* Use of this source code is governed by an MIT-style license that can be
|
|
26815
27007
|
* found in the LICENSE file at https://angular.io/license
|
|
26816
27008
|
*/
|
|
26817
|
-
// TODO(alxhub): recombine the interfaces and implementations here and move the docs back onto the
|
|
26818
|
-
// original classes.
|
|
26819
27009
|
/**
|
|
26820
27010
|
* @publicApi
|
|
26821
27011
|
*/
|
|
@@ -26831,47 +27021,92 @@ class DebugEventListener {
|
|
|
26831
27021
|
function asNativeElements(debugEls) {
|
|
26832
27022
|
return debugEls.map((el) => el.nativeElement);
|
|
26833
27023
|
}
|
|
26834
|
-
|
|
27024
|
+
/**
|
|
27025
|
+
* @publicApi
|
|
27026
|
+
*/
|
|
27027
|
+
class DebugNode {
|
|
26835
27028
|
constructor(nativeNode) {
|
|
26836
27029
|
this.nativeNode = nativeNode;
|
|
26837
27030
|
}
|
|
27031
|
+
/**
|
|
27032
|
+
* The `DebugElement` parent. Will be `null` if this is the root element.
|
|
27033
|
+
*/
|
|
26838
27034
|
get parent() {
|
|
26839
27035
|
const parent = this.nativeNode.parentNode;
|
|
26840
|
-
return parent ? new
|
|
27036
|
+
return parent ? new DebugElement(parent) : null;
|
|
26841
27037
|
}
|
|
27038
|
+
/**
|
|
27039
|
+
* The host dependency injector. For example, the root element's component instance injector.
|
|
27040
|
+
*/
|
|
26842
27041
|
get injector() {
|
|
26843
27042
|
return getInjector(this.nativeNode);
|
|
26844
27043
|
}
|
|
27044
|
+
/**
|
|
27045
|
+
* The element's own component instance, if it has one.
|
|
27046
|
+
*/
|
|
26845
27047
|
get componentInstance() {
|
|
26846
27048
|
const nativeElement = this.nativeNode;
|
|
26847
27049
|
return nativeElement &&
|
|
26848
27050
|
(getComponent$1(nativeElement) || getOwningComponent(nativeElement));
|
|
26849
27051
|
}
|
|
27052
|
+
/**
|
|
27053
|
+
* An object that provides parent context for this element. Often an ancestor component instance
|
|
27054
|
+
* that governs this element.
|
|
27055
|
+
*
|
|
27056
|
+
* When an element is repeated within *ngFor, the context is an `NgForOf` whose `$implicit`
|
|
27057
|
+
* property is the value of the row instance value. For example, the `hero` in `*ngFor="let hero
|
|
27058
|
+
* of heroes"`.
|
|
27059
|
+
*/
|
|
26850
27060
|
get context() {
|
|
26851
27061
|
return getComponent$1(this.nativeNode) || getContext(this.nativeNode);
|
|
26852
27062
|
}
|
|
27063
|
+
/**
|
|
27064
|
+
* The callbacks attached to the component's @Output properties and/or the element's event
|
|
27065
|
+
* properties.
|
|
27066
|
+
*/
|
|
26853
27067
|
get listeners() {
|
|
26854
27068
|
return getListeners(this.nativeNode).filter(listener => listener.type === 'dom');
|
|
26855
27069
|
}
|
|
27070
|
+
/**
|
|
27071
|
+
* Dictionary of objects associated with template local variables (e.g. #foo), keyed by the local
|
|
27072
|
+
* variable name.
|
|
27073
|
+
*/
|
|
26856
27074
|
get references() {
|
|
26857
27075
|
return getLocalRefs(this.nativeNode);
|
|
26858
27076
|
}
|
|
27077
|
+
/**
|
|
27078
|
+
* This component's injector lookup tokens. Includes the component itself plus the tokens that the
|
|
27079
|
+
* component lists in its providers metadata.
|
|
27080
|
+
*/
|
|
26859
27081
|
get providerTokens() {
|
|
26860
27082
|
return getInjectionTokens(this.nativeNode);
|
|
26861
27083
|
}
|
|
26862
27084
|
}
|
|
26863
|
-
|
|
27085
|
+
/**
|
|
27086
|
+
* @publicApi
|
|
27087
|
+
*
|
|
27088
|
+
* @see [Component testing scenarios](guide/testing-components-scenarios)
|
|
27089
|
+
* @see [Basics of testing components](guide/testing-components-basics)
|
|
27090
|
+
* @see [Testing utility APIs](guide/testing-utility-apis)
|
|
27091
|
+
*/
|
|
27092
|
+
class DebugElement extends DebugNode {
|
|
26864
27093
|
constructor(nativeNode) {
|
|
26865
27094
|
ngDevMode && assertDomNode(nativeNode);
|
|
26866
27095
|
super(nativeNode);
|
|
26867
27096
|
}
|
|
27097
|
+
/**
|
|
27098
|
+
* The underlying DOM element at the root of the component.
|
|
27099
|
+
*/
|
|
26868
27100
|
get nativeElement() {
|
|
26869
27101
|
return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode : null;
|
|
26870
27102
|
}
|
|
27103
|
+
/**
|
|
27104
|
+
* The element tag name, if it is an element.
|
|
27105
|
+
*/
|
|
26871
27106
|
get name() {
|
|
26872
27107
|
const context = getLContext(this.nativeNode);
|
|
26873
|
-
|
|
26874
|
-
|
|
27108
|
+
const lView = context ? context.lView : null;
|
|
27109
|
+
if (lView !== null) {
|
|
26875
27110
|
const tData = lView[TVIEW].data;
|
|
26876
27111
|
const tNode = tData[context.nodeIndex];
|
|
26877
27112
|
return tNode.value;
|
|
@@ -26894,10 +27129,10 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26894
27129
|
*/
|
|
26895
27130
|
get properties() {
|
|
26896
27131
|
const context = getLContext(this.nativeNode);
|
|
26897
|
-
|
|
27132
|
+
const lView = context ? context.lView : null;
|
|
27133
|
+
if (lView === null) {
|
|
26898
27134
|
return {};
|
|
26899
27135
|
}
|
|
26900
|
-
const lView = context.lView;
|
|
26901
27136
|
const tData = lView[TVIEW].data;
|
|
26902
27137
|
const tNode = tData[context.nodeIndex];
|
|
26903
27138
|
const properties = {};
|
|
@@ -26908,6 +27143,9 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26908
27143
|
collectPropertyBindings(properties, tNode, lView, tData);
|
|
26909
27144
|
return properties;
|
|
26910
27145
|
}
|
|
27146
|
+
/**
|
|
27147
|
+
* A map of attribute names to attribute values for an element.
|
|
27148
|
+
*/
|
|
26911
27149
|
get attributes() {
|
|
26912
27150
|
const attributes = {};
|
|
26913
27151
|
const element = this.nativeElement;
|
|
@@ -26915,10 +27153,10 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26915
27153
|
return attributes;
|
|
26916
27154
|
}
|
|
26917
27155
|
const context = getLContext(element);
|
|
26918
|
-
|
|
27156
|
+
const lView = context ? context.lView : null;
|
|
27157
|
+
if (lView === null) {
|
|
26919
27158
|
return {};
|
|
26920
27159
|
}
|
|
26921
|
-
const lView = context.lView;
|
|
26922
27160
|
const tNodeAttrs = lView[TVIEW].data[context.nodeIndex].attrs;
|
|
26923
27161
|
const lowercaseTNodeAttrs = [];
|
|
26924
27162
|
// For debug nodes we take the element's attribute directly from the DOM since it allows us
|
|
@@ -26956,12 +27194,29 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26956
27194
|
}
|
|
26957
27195
|
return attributes;
|
|
26958
27196
|
}
|
|
27197
|
+
/**
|
|
27198
|
+
* The inline styles of the DOM element.
|
|
27199
|
+
*
|
|
27200
|
+
* Will be `null` if there is no `style` property on the underlying DOM element.
|
|
27201
|
+
*
|
|
27202
|
+
* @see [ElementCSSInlineStyle](https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style)
|
|
27203
|
+
*/
|
|
26959
27204
|
get styles() {
|
|
26960
27205
|
if (this.nativeElement && this.nativeElement.style) {
|
|
26961
27206
|
return this.nativeElement.style;
|
|
26962
27207
|
}
|
|
26963
27208
|
return {};
|
|
26964
27209
|
}
|
|
27210
|
+
/**
|
|
27211
|
+
* A map containing the class names on the element as keys.
|
|
27212
|
+
*
|
|
27213
|
+
* This map is derived from the `className` property of the DOM element.
|
|
27214
|
+
*
|
|
27215
|
+
* Note: The values of this object will always be `true`. The class key will not appear in the KV
|
|
27216
|
+
* object if it does not exist on the element.
|
|
27217
|
+
*
|
|
27218
|
+
* @see [Element.className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className)
|
|
27219
|
+
*/
|
|
26965
27220
|
get classes() {
|
|
26966
27221
|
const result = {};
|
|
26967
27222
|
const element = this.nativeElement;
|
|
@@ -26971,15 +27226,23 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26971
27226
|
classes.forEach((value) => result[value] = true);
|
|
26972
27227
|
return result;
|
|
26973
27228
|
}
|
|
27229
|
+
/**
|
|
27230
|
+
* The `childNodes` of the DOM element as a `DebugNode` array.
|
|
27231
|
+
*
|
|
27232
|
+
* @see [Node.childNodes](https://developer.mozilla.org/en-US/docs/Web/API/Node/childNodes)
|
|
27233
|
+
*/
|
|
26974
27234
|
get childNodes() {
|
|
26975
27235
|
const childNodes = this.nativeNode.childNodes;
|
|
26976
27236
|
const children = [];
|
|
26977
27237
|
for (let i = 0; i < childNodes.length; i++) {
|
|
26978
27238
|
const element = childNodes[i];
|
|
26979
|
-
children.push(
|
|
27239
|
+
children.push(getDebugNode(element));
|
|
26980
27240
|
}
|
|
26981
27241
|
return children;
|
|
26982
27242
|
}
|
|
27243
|
+
/**
|
|
27244
|
+
* The immediate `DebugElement` children. Walk the tree by descending through `children`.
|
|
27245
|
+
*/
|
|
26983
27246
|
get children() {
|
|
26984
27247
|
const nativeElement = this.nativeElement;
|
|
26985
27248
|
if (!nativeElement)
|
|
@@ -26988,24 +27251,45 @@ class DebugElement__POST_R3__ extends DebugNode__POST_R3__ {
|
|
|
26988
27251
|
const children = [];
|
|
26989
27252
|
for (let i = 0; i < childNodes.length; i++) {
|
|
26990
27253
|
const element = childNodes[i];
|
|
26991
|
-
children.push(
|
|
27254
|
+
children.push(getDebugNode(element));
|
|
26992
27255
|
}
|
|
26993
27256
|
return children;
|
|
26994
27257
|
}
|
|
27258
|
+
/**
|
|
27259
|
+
* @returns the first `DebugElement` that matches the predicate at any depth in the subtree.
|
|
27260
|
+
*/
|
|
26995
27261
|
query(predicate) {
|
|
26996
27262
|
const results = this.queryAll(predicate);
|
|
26997
27263
|
return results[0] || null;
|
|
26998
27264
|
}
|
|
27265
|
+
/**
|
|
27266
|
+
* @returns All `DebugElement` matches for the predicate at any depth in the subtree.
|
|
27267
|
+
*/
|
|
26999
27268
|
queryAll(predicate) {
|
|
27000
27269
|
const matches = [];
|
|
27001
|
-
|
|
27270
|
+
_queryAll(this, predicate, matches, true);
|
|
27002
27271
|
return matches;
|
|
27003
27272
|
}
|
|
27273
|
+
/**
|
|
27274
|
+
* @returns All `DebugNode` matches for the predicate at any depth in the subtree.
|
|
27275
|
+
*/
|
|
27004
27276
|
queryAllNodes(predicate) {
|
|
27005
27277
|
const matches = [];
|
|
27006
|
-
|
|
27278
|
+
_queryAll(this, predicate, matches, false);
|
|
27007
27279
|
return matches;
|
|
27008
27280
|
}
|
|
27281
|
+
/**
|
|
27282
|
+
* Triggers the event by its name if there is a corresponding listener in the element's
|
|
27283
|
+
* `listeners` collection.
|
|
27284
|
+
*
|
|
27285
|
+
* If the event lacks a listener or there's some other problem, consider
|
|
27286
|
+
* calling `nativeElement.dispatchEvent(eventObject)`.
|
|
27287
|
+
*
|
|
27288
|
+
* @param eventName The name of the event to trigger
|
|
27289
|
+
* @param eventObj The _event object_ expected by the handler
|
|
27290
|
+
*
|
|
27291
|
+
* @see [Testing components scenarios](guide/testing-components-scenarios#trigger-event-handler)
|
|
27292
|
+
*/
|
|
27009
27293
|
triggerEventHandler(eventName, eventObj) {
|
|
27010
27294
|
const node = this.nativeNode;
|
|
27011
27295
|
const invokedListeners = [];
|
|
@@ -27064,11 +27348,12 @@ function isPrimitiveValue(value) {
|
|
|
27064
27348
|
return typeof value === 'string' || typeof value === 'boolean' || typeof value === 'number' ||
|
|
27065
27349
|
value === null;
|
|
27066
27350
|
}
|
|
27067
|
-
function
|
|
27351
|
+
function _queryAll(parentElement, predicate, matches, elementsOnly) {
|
|
27068
27352
|
const context = getLContext(parentElement.nativeNode);
|
|
27069
|
-
|
|
27070
|
-
|
|
27071
|
-
|
|
27353
|
+
const lView = context ? context.lView : null;
|
|
27354
|
+
if (lView !== null) {
|
|
27355
|
+
const parentTNode = lView[TVIEW].data[context.nodeIndex];
|
|
27356
|
+
_queryNodeChildren(parentTNode, lView, predicate, matches, elementsOnly, parentElement.nativeNode);
|
|
27072
27357
|
}
|
|
27073
27358
|
else {
|
|
27074
27359
|
// If the context is null, then `parentElement` was either created with Renderer2 or native DOM
|
|
@@ -27086,26 +27371,26 @@ function _queryAllR3(parentElement, predicate, matches, elementsOnly) {
|
|
|
27086
27371
|
* @param elementsOnly whether only elements should be searched
|
|
27087
27372
|
* @param rootNativeNode the root native node on which predicate should not be matched
|
|
27088
27373
|
*/
|
|
27089
|
-
function
|
|
27374
|
+
function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {
|
|
27090
27375
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
27091
27376
|
const nativeNode = getNativeByTNodeOrNull(tNode, lView);
|
|
27092
27377
|
// For each type of TNode, specific logic is executed.
|
|
27093
27378
|
if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {
|
|
27094
27379
|
// Case 1: the TNode is an element
|
|
27095
27380
|
// The native node has to be checked.
|
|
27096
|
-
|
|
27381
|
+
_addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);
|
|
27097
27382
|
if (isComponentHost(tNode)) {
|
|
27098
27383
|
// If the element is the host of a component, then all nodes in its view have to be processed.
|
|
27099
27384
|
// Note: the component's content (tNode.child) will be processed from the insertion points.
|
|
27100
27385
|
const componentView = getComponentLViewByIndex(tNode.index, lView);
|
|
27101
27386
|
if (componentView && componentView[TVIEW].firstChild) {
|
|
27102
|
-
|
|
27387
|
+
_queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27103
27388
|
}
|
|
27104
27389
|
}
|
|
27105
27390
|
else {
|
|
27106
27391
|
if (tNode.child) {
|
|
27107
27392
|
// Otherwise, its children have to be processed.
|
|
27108
|
-
|
|
27393
|
+
_queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27109
27394
|
}
|
|
27110
27395
|
// We also have to query the DOM directly in order to catch elements inserted through
|
|
27111
27396
|
// Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple
|
|
@@ -27121,16 +27406,16 @@ function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, ro
|
|
|
27121
27406
|
// processed.
|
|
27122
27407
|
const nodeOrContainer = lView[tNode.index];
|
|
27123
27408
|
if (isLContainer(nodeOrContainer)) {
|
|
27124
|
-
|
|
27409
|
+
_queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);
|
|
27125
27410
|
}
|
|
27126
27411
|
}
|
|
27127
27412
|
else if (tNode.type & 4 /* Container */) {
|
|
27128
27413
|
// Case 2: the TNode is a container
|
|
27129
27414
|
// The native node has to be checked.
|
|
27130
27415
|
const lContainer = lView[tNode.index];
|
|
27131
|
-
|
|
27416
|
+
_addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);
|
|
27132
27417
|
// Each view inside the container has to be processed.
|
|
27133
|
-
|
|
27418
|
+
_queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);
|
|
27134
27419
|
}
|
|
27135
27420
|
else if (tNode.type & 16 /* Projection */) {
|
|
27136
27421
|
// Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).
|
|
@@ -27140,18 +27425,18 @@ function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, ro
|
|
|
27140
27425
|
const head = componentHost.projection[tNode.projection];
|
|
27141
27426
|
if (Array.isArray(head)) {
|
|
27142
27427
|
for (let nativeNode of head) {
|
|
27143
|
-
|
|
27428
|
+
_addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);
|
|
27144
27429
|
}
|
|
27145
27430
|
}
|
|
27146
27431
|
else if (head) {
|
|
27147
27432
|
const nextLView = componentView[PARENT];
|
|
27148
27433
|
const nextTNode = nextLView[TVIEW].data[head.index];
|
|
27149
|
-
|
|
27434
|
+
_queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27150
27435
|
}
|
|
27151
27436
|
}
|
|
27152
27437
|
else if (tNode.child) {
|
|
27153
27438
|
// Case 4: the TNode is a view.
|
|
27154
|
-
|
|
27439
|
+
_queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27155
27440
|
}
|
|
27156
27441
|
// We don't want to go to the next sibling of the root node.
|
|
27157
27442
|
if (rootNativeNode !== nativeNode) {
|
|
@@ -27159,7 +27444,7 @@ function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, ro
|
|
|
27159
27444
|
// link, depending on whether the current node has been projected.
|
|
27160
27445
|
const nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next;
|
|
27161
27446
|
if (nextTNode) {
|
|
27162
|
-
|
|
27447
|
+
_queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27163
27448
|
}
|
|
27164
27449
|
}
|
|
27165
27450
|
}
|
|
@@ -27172,12 +27457,12 @@ function _queryNodeChildrenR3(tNode, lView, predicate, matches, elementsOnly, ro
|
|
|
27172
27457
|
* @param elementsOnly whether only elements should be searched
|
|
27173
27458
|
* @param rootNativeNode the root native node on which predicate should not be matched
|
|
27174
27459
|
*/
|
|
27175
|
-
function
|
|
27460
|
+
function _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {
|
|
27176
27461
|
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
27177
27462
|
const childView = lContainer[i];
|
|
27178
27463
|
const firstChild = childView[TVIEW].firstChild;
|
|
27179
27464
|
if (firstChild) {
|
|
27180
|
-
|
|
27465
|
+
_queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);
|
|
27181
27466
|
}
|
|
27182
27467
|
}
|
|
27183
27468
|
}
|
|
@@ -27190,7 +27475,7 @@ function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, element
|
|
|
27190
27475
|
* @param elementsOnly whether only elements should be searched
|
|
27191
27476
|
* @param rootNativeNode the root native node on which predicate should not be matched
|
|
27192
27477
|
*/
|
|
27193
|
-
function
|
|
27478
|
+
function _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode) {
|
|
27194
27479
|
if (rootNativeNode !== nativeNode) {
|
|
27195
27480
|
const debugNode = getDebugNode(nativeNode);
|
|
27196
27481
|
if (!debugNode) {
|
|
@@ -27199,7 +27484,7 @@ function _addQueryMatchR3(nativeNode, predicate, matches, elementsOnly, rootNati
|
|
|
27199
27484
|
// Type of the "predicate and "matches" array are set based on the value of
|
|
27200
27485
|
// the "elementsOnly" parameter. TypeScript is not able to properly infer these
|
|
27201
27486
|
// types with generics, so we manually cast the parameters accordingly.
|
|
27202
|
-
if (elementsOnly && debugNode instanceof
|
|
27487
|
+
if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&
|
|
27203
27488
|
matches.indexOf(debugNode) === -1) {
|
|
27204
27489
|
matches.push(debugNode);
|
|
27205
27490
|
}
|
|
@@ -27224,7 +27509,7 @@ function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnl
|
|
|
27224
27509
|
const node = nodes[i];
|
|
27225
27510
|
const debugNode = getDebugNode(node);
|
|
27226
27511
|
if (debugNode) {
|
|
27227
|
-
if (elementsOnly && debugNode instanceof
|
|
27512
|
+
if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&
|
|
27228
27513
|
matches.indexOf(debugNode) === -1) {
|
|
27229
27514
|
matches.push(debugNode);
|
|
27230
27515
|
}
|
|
@@ -27265,25 +27550,24 @@ function collectPropertyBindings(properties, tNode, lView, tData) {
|
|
|
27265
27550
|
// Need to keep the nodes in a global Map so that multiple angular apps are supported.
|
|
27266
27551
|
const _nativeNodeToDebugNode = new Map();
|
|
27267
27552
|
const NG_DEBUG_PROPERTY = '__ng_debug__';
|
|
27268
|
-
|
|
27553
|
+
/**
|
|
27554
|
+
* @publicApi
|
|
27555
|
+
*/
|
|
27556
|
+
function getDebugNode(nativeNode) {
|
|
27269
27557
|
if (nativeNode instanceof Node) {
|
|
27270
27558
|
if (!(nativeNode.hasOwnProperty(NG_DEBUG_PROPERTY))) {
|
|
27271
27559
|
nativeNode[NG_DEBUG_PROPERTY] = nativeNode.nodeType == Node.ELEMENT_NODE ?
|
|
27272
|
-
new
|
|
27273
|
-
new
|
|
27560
|
+
new DebugElement(nativeNode) :
|
|
27561
|
+
new DebugNode(nativeNode);
|
|
27274
27562
|
}
|
|
27275
27563
|
return nativeNode[NG_DEBUG_PROPERTY];
|
|
27276
27564
|
}
|
|
27277
27565
|
return null;
|
|
27278
27566
|
}
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
*/
|
|
27282
|
-
const getDebugNode = getDebugNode__POST_R3__;
|
|
27283
|
-
function getDebugNodeR2__POST_R3__(_nativeNode) {
|
|
27567
|
+
// TODO: cleanup all references to this function and remove it.
|
|
27568
|
+
function getDebugNodeR2(_nativeNode) {
|
|
27284
27569
|
return null;
|
|
27285
27570
|
}
|
|
27286
|
-
const getDebugNodeR2 = getDebugNodeR2__POST_R3__;
|
|
27287
27571
|
function getAllDebugNodes() {
|
|
27288
27572
|
return Array.from(_nativeNodeToDebugNode.values());
|
|
27289
27573
|
}
|
|
@@ -27293,14 +27577,6 @@ function indexDebugNode(node) {
|
|
|
27293
27577
|
function removeDebugNodeFromIndex(node) {
|
|
27294
27578
|
_nativeNodeToDebugNode.delete(node.nativeNode);
|
|
27295
27579
|
}
|
|
27296
|
-
/**
|
|
27297
|
-
* @publicApi
|
|
27298
|
-
*/
|
|
27299
|
-
const DebugNode = DebugNode__POST_R3__;
|
|
27300
|
-
/**
|
|
27301
|
-
* @publicApi
|
|
27302
|
-
*/
|
|
27303
|
-
const DebugElement = DebugElement__POST_R3__;
|
|
27304
27580
|
|
|
27305
27581
|
/**
|
|
27306
27582
|
* @license
|
|
@@ -28428,96 +28704,10 @@ const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDER
|
|
|
28428
28704
|
* Use of this source code is governed by an MIT-style license that can be
|
|
28429
28705
|
* found in the LICENSE file at https://angular.io/license
|
|
28430
28706
|
*/
|
|
28431
|
-
function _iterableDiffersFactory() {
|
|
28432
|
-
return defaultIterableDiffers;
|
|
28433
|
-
}
|
|
28434
|
-
function _keyValueDiffersFactory() {
|
|
28435
|
-
return defaultKeyValueDiffers;
|
|
28436
|
-
}
|
|
28437
|
-
function _localeFactory(locale) {
|
|
28438
|
-
return locale || getGlobalLocale();
|
|
28439
|
-
}
|
|
28440
|
-
/**
|
|
28441
|
-
* Work out the locale from the potential global properties.
|
|
28442
|
-
*
|
|
28443
|
-
* * Closure Compiler: use `goog.getLocale()`.
|
|
28444
|
-
* * Ivy enabled: use `$localize.locale`
|
|
28445
|
-
*/
|
|
28446
|
-
function getGlobalLocale() {
|
|
28447
|
-
if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
|
|
28448
|
-
typeof goog !== 'undefined' && goog.getLocale() !== 'en') {
|
|
28449
|
-
// * The default `goog.getLocale()` value is `en`, while Angular used `en-US`.
|
|
28450
|
-
// * In order to preserve backwards compatibility, we use Angular default value over
|
|
28451
|
-
// Closure Compiler's one.
|
|
28452
|
-
return goog.getLocale();
|
|
28453
|
-
}
|
|
28454
|
-
else {
|
|
28455
|
-
// KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
|
|
28456
|
-
// COMPILE-TIME INLINER.
|
|
28457
|
-
//
|
|
28458
|
-
// * During compile time inlining of translations the expression will be replaced
|
|
28459
|
-
// with a string literal that is the current locale. Other forms of this expression are not
|
|
28460
|
-
// guaranteed to be replaced.
|
|
28461
|
-
//
|
|
28462
|
-
// * During runtime translation evaluation, the developer is required to set `$localize.locale`
|
|
28463
|
-
// if required, or just to provide their own `LOCALE_ID` provider.
|
|
28464
|
-
return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
|
|
28465
|
-
}
|
|
28466
|
-
}
|
|
28467
|
-
/**
|
|
28468
|
-
* A built-in [dependency injection token](guide/glossary#di-token)
|
|
28469
|
-
* that is used to configure the root injector for bootstrapping.
|
|
28470
|
-
*/
|
|
28471
|
-
const APPLICATION_MODULE_PROVIDERS = [
|
|
28472
|
-
{
|
|
28473
|
-
provide: ApplicationRef,
|
|
28474
|
-
useClass: ApplicationRef,
|
|
28475
|
-
deps: [NgZone, Injector, ErrorHandler, ComponentFactoryResolver$1, ApplicationInitStatus]
|
|
28476
|
-
},
|
|
28477
|
-
{ provide: SCHEDULER, deps: [NgZone], useFactory: zoneSchedulerFactory },
|
|
28478
|
-
{
|
|
28479
|
-
provide: ApplicationInitStatus,
|
|
28480
|
-
useClass: ApplicationInitStatus,
|
|
28481
|
-
deps: [[new Optional(), APP_INITIALIZER]]
|
|
28482
|
-
},
|
|
28483
|
-
{ provide: Compiler, useClass: Compiler, deps: [] },
|
|
28484
|
-
APP_ID_RANDOM_PROVIDER,
|
|
28485
|
-
{ provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: [] },
|
|
28486
|
-
{ provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: [] },
|
|
28487
|
-
{
|
|
28488
|
-
provide: LOCALE_ID,
|
|
28489
|
-
useFactory: _localeFactory,
|
|
28490
|
-
deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]
|
|
28491
|
-
},
|
|
28492
|
-
{ provide: DEFAULT_CURRENCY_CODE, useValue: USD_CURRENCY_CODE },
|
|
28493
|
-
];
|
|
28494
|
-
/**
|
|
28495
|
-
* Schedule work at next available slot.
|
|
28496
|
-
*
|
|
28497
|
-
* In Ivy this is just `requestAnimationFrame`. For compatibility reasons when bootstrapped
|
|
28498
|
-
* using `platformRef.bootstrap` we need to use `NgZone.onStable` as the scheduling mechanism.
|
|
28499
|
-
* This overrides the scheduling mechanism in Ivy to `NgZone.onStable`.
|
|
28500
|
-
*
|
|
28501
|
-
* @param ngZone NgZone to use for scheduling.
|
|
28502
|
-
*/
|
|
28503
|
-
function zoneSchedulerFactory(ngZone) {
|
|
28504
|
-
let queue = [];
|
|
28505
|
-
ngZone.onStable.subscribe(() => {
|
|
28506
|
-
while (queue.length) {
|
|
28507
|
-
queue.pop()();
|
|
28508
|
-
}
|
|
28509
|
-
});
|
|
28510
|
-
return function (fn) {
|
|
28511
|
-
queue.push(fn);
|
|
28512
|
-
};
|
|
28513
|
-
}
|
|
28514
28707
|
/**
|
|
28515
|
-
* Configures the root injector for an app with
|
|
28516
|
-
* providers of `@angular/core` dependencies that `ApplicationRef` needs
|
|
28517
|
-
* to bootstrap components.
|
|
28518
|
-
*
|
|
28519
28708
|
* Re-exported by `BrowserModule`, which is included automatically in the root
|
|
28520
|
-
* `AppModule` when you create a new app with the CLI `new` command.
|
|
28709
|
+
* `AppModule` when you create a new app with the CLI `new` command. Eagerly injects
|
|
28710
|
+
* `ApplicationRef` to instantiate it.
|
|
28521
28711
|
*
|
|
28522
28712
|
* @publicApi
|
|
28523
28713
|
*/
|
|
@@ -28527,12 +28717,23 @@ class ApplicationModule {
|
|
|
28527
28717
|
}
|
|
28528
28718
|
ApplicationModule.ɵfac = function ApplicationModule_Factory(t) { return new (t || ApplicationModule)(ɵɵinject(ApplicationRef)); };
|
|
28529
28719
|
ApplicationModule.ɵmod = /*@__PURE__*/ ɵɵdefineNgModule({ type: ApplicationModule });
|
|
28530
|
-
ApplicationModule.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({
|
|
28720
|
+
ApplicationModule.ɵinj = /*@__PURE__*/ ɵɵdefineInjector({});
|
|
28531
28721
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationModule, [{
|
|
28532
|
-
type: NgModule
|
|
28533
|
-
args: [{ providers: APPLICATION_MODULE_PROVIDERS }]
|
|
28722
|
+
type: NgModule
|
|
28534
28723
|
}], function () { return [{ type: ApplicationRef }]; }, null); })();
|
|
28535
28724
|
|
|
28725
|
+
/**
|
|
28726
|
+
* @license
|
|
28727
|
+
* Copyright Google LLC All Rights Reserved.
|
|
28728
|
+
*
|
|
28729
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
28730
|
+
* found in the LICENSE file at https://angular.io/license
|
|
28731
|
+
*/
|
|
28732
|
+
/** Coerces a value (typically a string) to a boolean. */
|
|
28733
|
+
function coerceToBoolean(value) {
|
|
28734
|
+
return typeof value === 'boolean' ? value : (value != null && value !== 'false');
|
|
28735
|
+
}
|
|
28736
|
+
|
|
28536
28737
|
/**
|
|
28537
28738
|
* @license
|
|
28538
28739
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -28690,5 +28891,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
28690
28891
|
* Generated bundle index. Do not edit.
|
|
28691
28892
|
*/
|
|
28692
28893
|
|
|
28693
|
-
export { ANALYZE_FOR_ENTRY_COMPONENTS, 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, 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, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, 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, 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, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, 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, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, 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,
|
|
28894
|
+
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, 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, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, 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, 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, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, 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, 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, ɵɵ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 };
|
|
28694
28895
|
//# sourceMappingURL=core.mjs.map
|