@angular/core 14.0.0-next.12 → 14.0.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/application_ref.mjs +212 -50
- package/esm2020/src/application_tokens.mjs +5 -2
- package/esm2020/src/change_detection/change_detection.mjs +2 -2
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +2 -2
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +2 -2
- package/esm2020/src/compiler/compiler_facade_interface.mjs +7 -1
- package/esm2020/src/console.mjs +4 -3
- package/esm2020/src/core.mjs +2 -2
- package/esm2020/src/core_private_export.mjs +4 -3
- package/esm2020/src/core_render3_private_export.mjs +4 -3
- package/esm2020/src/di/create_injector.mjs +36 -0
- package/esm2020/src/di/index.mjs +4 -1
- package/esm2020/src/di/initializer_token.mjs +16 -0
- package/esm2020/src/di/injection_token.mjs +7 -1
- package/esm2020/src/di/injector.mjs +2 -2
- package/esm2020/src/di/injector_compatibility.mjs +1 -3
- package/esm2020/src/di/interface/defs.mjs +1 -1
- package/esm2020/src/di/interface/provider.mjs +1 -1
- package/esm2020/src/di/internal_tokens.mjs +10 -0
- package/esm2020/src/di/provider_collection.mjs +209 -0
- package/esm2020/src/di/r3_injector.mjs +66 -153
- package/esm2020/src/di/scope.mjs +1 -1
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/linker/component_factory.mjs +1 -1
- package/esm2020/src/linker/ng_module_factory.mjs +1 -1
- package/esm2020/src/linker/view_container_ref.mjs +12 -9
- package/esm2020/src/metadata/directives.mjs +1 -1
- package/esm2020/src/metadata/ng_module.mjs +1 -1
- package/esm2020/src/metadata.mjs +1 -1
- package/esm2020/src/platform_core_providers.mjs +3 -14
- package/esm2020/src/render3/bindings.mjs +2 -2
- package/esm2020/src/render3/component_ref.mjs +12 -4
- package/esm2020/src/render3/definition.mjs +16 -20
- package/esm2020/src/render3/di_setup.mjs +3 -2
- package/esm2020/src/render3/errors.mjs +21 -3
- package/esm2020/src/render3/errors_di.mjs +1 -1
- package/esm2020/src/render3/features/inherit_definition_feature.mjs +3 -2
- package/esm2020/src/render3/features/standalone_feature.mjs +69 -0
- package/esm2020/src/render3/index.mjs +4 -3
- package/esm2020/src/render3/instructions/shared.mjs +6 -3
- package/esm2020/src/render3/interfaces/definition.mjs +1 -1
- package/esm2020/src/render3/interfaces/public_definitions.mjs +1 -1
- package/esm2020/src/render3/jit/directive.mjs +93 -8
- package/esm2020/src/render3/jit/environment.mjs +2 -1
- package/esm2020/src/render3/jit/module.mjs +64 -17
- package/esm2020/src/render3/jit/pipe.mjs +2 -4
- package/esm2020/src/render3/ng_module_ref.mjs +34 -4
- package/esm2020/src/testability/testability.mjs +4 -3
- package/esm2020/src/util/global.mjs +8 -8
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/r3_test_bed.mjs +5 -8
- package/esm2020/testing/src/test_bed.mjs +1 -1
- package/esm2020/testing/src/test_bed_common.mjs +1 -1
- package/fesm2015/core.mjs +1009 -407
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -8
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1007 -408
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -8
- package/fesm2020/testing.mjs.map +1 -1
- package/{core.d.ts → index.d.ts} +14716 -14613
- package/package.json +4 -4
- package/testing/{testing.d.ts → index.d.ts} +537 -577
- package/esm2020/src/change_detection/change_detection_util.mjs +0 -64
- package/testing/package.json +0 -9
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.15
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -725,15 +725,15 @@ var ViewEncapsulation$1;
|
|
|
725
725
|
* Use of this source code is governed by an MIT-style license that can be
|
|
726
726
|
* found in the LICENSE file at https://angular.io/license
|
|
727
727
|
*/
|
|
728
|
-
const __globalThis = typeof globalThis !== 'undefined' && globalThis;
|
|
729
|
-
const __window = typeof window !== 'undefined' && window;
|
|
730
|
-
const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
731
|
-
self instanceof WorkerGlobalScope && self;
|
|
732
|
-
const __global = typeof global !== 'undefined' && global;
|
|
733
728
|
// Always use __globalThis if available, which is the spec-defined global variable across all
|
|
734
729
|
// environments, then fallback to __global first, because in Node tests both __global and
|
|
735
|
-
// __window may be defined and _global should be __global in that case.
|
|
736
|
-
|
|
730
|
+
// __window may be defined and _global should be __global in that case. Note: Typeof/Instanceof
|
|
731
|
+
// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
|
|
732
|
+
// https://github.com/terser/terser/issues/250.
|
|
733
|
+
const _global = ( /* @__PURE__ */(() => (typeof globalThis !== 'undefined' && globalThis) ||
|
|
734
|
+
(typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
|
|
735
|
+
(typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
736
|
+
self instanceof WorkerGlobalScope && self))());
|
|
737
737
|
|
|
738
738
|
/**
|
|
739
739
|
* @license
|
|
@@ -906,6 +906,8 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
906
906
|
directiveDefs: null,
|
|
907
907
|
pipeDefs: null,
|
|
908
908
|
standalone: componentDefinition.standalone === true,
|
|
909
|
+
dependencies: componentDefinition.standalone === true && componentDefinition.dependencies || null,
|
|
910
|
+
getStandaloneInjector: null,
|
|
909
911
|
selectors: componentDefinition.selectors || EMPTY_ARRAY,
|
|
910
912
|
viewQuery: componentDefinition.viewQuery || null,
|
|
911
913
|
features: componentDefinition.features || null,
|
|
@@ -918,19 +920,21 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
918
920
|
schemas: componentDefinition.schemas || null,
|
|
919
921
|
tView: null,
|
|
920
922
|
};
|
|
921
|
-
const
|
|
923
|
+
const dependencies = componentDefinition.dependencies;
|
|
922
924
|
const feature = componentDefinition.features;
|
|
923
|
-
const pipeTypes = componentDefinition.pipes;
|
|
924
925
|
def.id += _renderCompCount++;
|
|
925
926
|
def.inputs = invertObject(componentDefinition.inputs, declaredInputs),
|
|
926
927
|
def.outputs = invertObject(componentDefinition.outputs),
|
|
927
928
|
feature && feature.forEach((fn) => fn(def));
|
|
928
|
-
def.directiveDefs =
|
|
929
|
-
() => (typeof
|
|
930
|
-
.map(extractDirectiveDef)
|
|
929
|
+
def.directiveDefs = dependencies ?
|
|
930
|
+
(() => (typeof dependencies === 'function' ? dependencies() : dependencies)
|
|
931
|
+
.map(extractDirectiveDef)
|
|
932
|
+
.filter(nonNull)) :
|
|
931
933
|
null;
|
|
932
|
-
def.pipeDefs =
|
|
933
|
-
() => (typeof
|
|
934
|
+
def.pipeDefs = dependencies ?
|
|
935
|
+
(() => (typeof dependencies === 'function' ? dependencies() : dependencies)
|
|
936
|
+
.map(getPipeDef$1)
|
|
937
|
+
.filter(nonNull)) :
|
|
934
938
|
null;
|
|
935
939
|
return def;
|
|
936
940
|
});
|
|
@@ -947,21 +951,13 @@ function ɵɵdefineComponent(componentDefinition) {
|
|
|
947
951
|
function ɵɵsetComponentScope(type, directives, pipes) {
|
|
948
952
|
const def = type.ɵcmp;
|
|
949
953
|
def.directiveDefs = () => directives.map(extractDirectiveDef);
|
|
950
|
-
def.pipeDefs = () => pipes.map(
|
|
954
|
+
def.pipeDefs = () => pipes.map(getPipeDef$1);
|
|
951
955
|
}
|
|
952
956
|
function extractDirectiveDef(type) {
|
|
953
|
-
|
|
954
|
-
if (ngDevMode && !def) {
|
|
955
|
-
throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`);
|
|
956
|
-
}
|
|
957
|
-
return def;
|
|
957
|
+
return getComponentDef(type) || getDirectiveDef(type);
|
|
958
958
|
}
|
|
959
|
-
function
|
|
960
|
-
|
|
961
|
-
if (ngDevMode && !def) {
|
|
962
|
-
throw new Error(`'${type.name}' is not a 'PipeType'.`);
|
|
963
|
-
}
|
|
964
|
-
return def;
|
|
959
|
+
function nonNull(value) {
|
|
960
|
+
return value !== null;
|
|
965
961
|
}
|
|
966
962
|
const autoRegisterModuleById = {};
|
|
967
963
|
/**
|
|
@@ -4015,6 +4011,12 @@ class InjectionToken {
|
|
|
4015
4011
|
});
|
|
4016
4012
|
}
|
|
4017
4013
|
}
|
|
4014
|
+
/**
|
|
4015
|
+
* @internal
|
|
4016
|
+
*/
|
|
4017
|
+
get multi() {
|
|
4018
|
+
return this;
|
|
4019
|
+
}
|
|
4018
4020
|
toString() {
|
|
4019
4021
|
return `InjectionToken ${this._desc}`;
|
|
4020
4022
|
}
|
|
@@ -4141,6 +4143,12 @@ var FactoryTarget;
|
|
|
4141
4143
|
FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe";
|
|
4142
4144
|
FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule";
|
|
4143
4145
|
})(FactoryTarget || (FactoryTarget = {}));
|
|
4146
|
+
var R3TemplateDependencyKind;
|
|
4147
|
+
(function (R3TemplateDependencyKind) {
|
|
4148
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
|
|
4149
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
|
|
4150
|
+
R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
|
|
4151
|
+
})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
|
|
4144
4152
|
var ViewEncapsulation;
|
|
4145
4153
|
(function (ViewEncapsulation) {
|
|
4146
4154
|
ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
|
|
@@ -4822,7 +4830,6 @@ const NG_TOKEN_PATH = 'ngTokenPath';
|
|
|
4822
4830
|
const NEW_LINE = /\n/gm;
|
|
4823
4831
|
const NO_NEW_LINE = 'ɵ';
|
|
4824
4832
|
const SOURCE = '__source';
|
|
4825
|
-
const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: getClosureSafeProperty });
|
|
4826
4833
|
/**
|
|
4827
4834
|
* Current injector value used by `inject`.
|
|
4828
4835
|
* - `undefined`: it is an error to call `inject`
|
|
@@ -6921,9 +6928,25 @@ function maybeUnwrapFn(value) {
|
|
|
6921
6928
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6922
6929
|
* found in the LICENSE file at https://angular.io/license
|
|
6923
6930
|
*/
|
|
6931
|
+
/** Verifies that a given type is a Standalone Component. */
|
|
6932
|
+
function assertStandaloneComponentType(type) {
|
|
6933
|
+
const componentDef = getComponentDef(type);
|
|
6934
|
+
if (!componentDef) {
|
|
6935
|
+
throw new RuntimeError(906 /* MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +
|
|
6936
|
+
`make sure it has the \`@Component\` decorator.`);
|
|
6937
|
+
}
|
|
6938
|
+
if (!componentDef.standalone) {
|
|
6939
|
+
throw new RuntimeError(907 /* TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +
|
|
6940
|
+
`but Angular expects to have a standalone component here. ` +
|
|
6941
|
+
`Please make sure the ${stringifyForError(type)} component has ` +
|
|
6942
|
+
`the \`standalone: true\` flag in the decorator.`);
|
|
6943
|
+
}
|
|
6944
|
+
}
|
|
6924
6945
|
/** Called when there are multiple component selectors that match a given node */
|
|
6925
|
-
function throwMultipleComponentError(tNode) {
|
|
6926
|
-
throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`
|
|
6946
|
+
function throwMultipleComponentError(tNode, first, second) {
|
|
6947
|
+
throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +
|
|
6948
|
+
`${stringifyForError(first)} and ` +
|
|
6949
|
+
`${stringifyForError(second)}`);
|
|
6927
6950
|
}
|
|
6928
6951
|
/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
|
|
6929
6952
|
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
|
|
@@ -10598,8 +10621,11 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
|
10598
10621
|
if (ngDevMode) {
|
|
10599
10622
|
assertTNodeType(tNode, 2 /* Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
10600
10623
|
`Please use a different tag to activate the ${stringify(def.type)} component.`);
|
|
10601
|
-
if (tNode.flags & 2 /* isComponentHost */)
|
|
10602
|
-
|
|
10624
|
+
if (tNode.flags & 2 /* isComponentHost */) {
|
|
10625
|
+
// If another component has been matched previously, it's the first element in the
|
|
10626
|
+
// `matches` array, see how we store components/directives in `matches` below.
|
|
10627
|
+
throwMultipleComponentError(tNode, matches[0].type, def.type);
|
|
10628
|
+
}
|
|
10603
10629
|
}
|
|
10604
10630
|
markAsComponentHost(tView, tNode);
|
|
10605
10631
|
// The component is always stored first with directives after.
|
|
@@ -11330,6 +11356,235 @@ function tick(component) {
|
|
|
11330
11356
|
tickRootContext(rootContext);
|
|
11331
11357
|
}
|
|
11332
11358
|
|
|
11359
|
+
/**
|
|
11360
|
+
* @license
|
|
11361
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11362
|
+
*
|
|
11363
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11364
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11365
|
+
*/
|
|
11366
|
+
|
|
11367
|
+
/**
|
|
11368
|
+
* @license
|
|
11369
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11370
|
+
*
|
|
11371
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11372
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11373
|
+
*/
|
|
11374
|
+
/**
|
|
11375
|
+
* A multi-provider token for initialization functions that will run upon construction of a
|
|
11376
|
+
* non-view injector.
|
|
11377
|
+
*
|
|
11378
|
+
* @publicApi
|
|
11379
|
+
*/
|
|
11380
|
+
const INJECTOR_INITIALIZER = new InjectionToken('INJECTOR_INITIALIZER');
|
|
11381
|
+
|
|
11382
|
+
/**
|
|
11383
|
+
* @license
|
|
11384
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11385
|
+
*
|
|
11386
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11387
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11388
|
+
*/
|
|
11389
|
+
const INJECTOR_DEF_TYPES = new InjectionToken('INJECTOR_DEF_TYPES');
|
|
11390
|
+
|
|
11391
|
+
/**
|
|
11392
|
+
* @license
|
|
11393
|
+
* Copyright Google LLC All Rights Reserved.
|
|
11394
|
+
*
|
|
11395
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11396
|
+
* found in the LICENSE file at https://angular.io/license
|
|
11397
|
+
*/
|
|
11398
|
+
/**
|
|
11399
|
+
* Collects providers from all NgModules and standalone components, including transitively imported
|
|
11400
|
+
* ones.
|
|
11401
|
+
*
|
|
11402
|
+
* @returns The list of collected providers from the specified list of types.
|
|
11403
|
+
* @publicApi
|
|
11404
|
+
*/
|
|
11405
|
+
function importProvidersFrom(...sources) {
|
|
11406
|
+
const providersOut = [];
|
|
11407
|
+
const dedup = new Set(); // already seen types
|
|
11408
|
+
let injectorTypesWithProviders;
|
|
11409
|
+
deepForEach(sources, source => {
|
|
11410
|
+
// Narrow `source` to access the internal type analogue for `ModuleWithProviders`.
|
|
11411
|
+
const internalSource = source;
|
|
11412
|
+
if (walkProviderTree(internalSource, providersOut, [], dedup)) {
|
|
11413
|
+
injectorTypesWithProviders || (injectorTypesWithProviders = []);
|
|
11414
|
+
injectorTypesWithProviders.push(internalSource);
|
|
11415
|
+
}
|
|
11416
|
+
});
|
|
11417
|
+
// Collect all providers from `ModuleWithProviders` types.
|
|
11418
|
+
if (injectorTypesWithProviders !== undefined) {
|
|
11419
|
+
processInjectorTypesWithProviders(injectorTypesWithProviders, providersOut);
|
|
11420
|
+
}
|
|
11421
|
+
return providersOut;
|
|
11422
|
+
}
|
|
11423
|
+
/**
|
|
11424
|
+
* Collects all providers from the list of `ModuleWithProviders` and appends them to the provided
|
|
11425
|
+
* array.
|
|
11426
|
+
*/
|
|
11427
|
+
function processInjectorTypesWithProviders(typesWithProviders, providersOut) {
|
|
11428
|
+
for (let i = 0; i < typesWithProviders.length; i++) {
|
|
11429
|
+
const { ngModule, providers } = typesWithProviders[i];
|
|
11430
|
+
deepForEach(providers, provider => {
|
|
11431
|
+
ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);
|
|
11432
|
+
providersOut.push(provider);
|
|
11433
|
+
});
|
|
11434
|
+
}
|
|
11435
|
+
}
|
|
11436
|
+
/**
|
|
11437
|
+
* The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone
|
|
11438
|
+
* `ComponentType`, and all of its transitive providers and collects providers.
|
|
11439
|
+
*
|
|
11440
|
+
* If an `InjectorTypeWithProviders` that declares providers besides the type is specified,
|
|
11441
|
+
* the function will return "true" to indicate that the providers of the type definition need
|
|
11442
|
+
* to be processed. This allows us to process providers of injector types after all imports of
|
|
11443
|
+
* an injector definition are processed. (following View Engine semantics: see FW-1349)
|
|
11444
|
+
*/
|
|
11445
|
+
function walkProviderTree(container, providersOut, parents, dedup) {
|
|
11446
|
+
container = resolveForwardRef(container);
|
|
11447
|
+
if (!container)
|
|
11448
|
+
return false;
|
|
11449
|
+
// The actual type which had the definition. Usually `container`, but may be an unwrapped type
|
|
11450
|
+
// from `InjectorTypeWithProviders`.
|
|
11451
|
+
let defType = null;
|
|
11452
|
+
let injDef = getInjectorDef(container);
|
|
11453
|
+
const cmpDef = !injDef && getComponentDef(container);
|
|
11454
|
+
if (!injDef && !cmpDef) {
|
|
11455
|
+
// `container` is not an injector type or a component type. It might be:
|
|
11456
|
+
// * An `InjectorTypeWithProviders` that wraps an injector type.
|
|
11457
|
+
// * A standalone directive or pipe that got pulled in from a standalone component's
|
|
11458
|
+
// dependencies.
|
|
11459
|
+
// Try to unwrap it as an `InjectorTypeWithProviders` first.
|
|
11460
|
+
const ngModule = container.ngModule;
|
|
11461
|
+
injDef = getInjectorDef(ngModule);
|
|
11462
|
+
if (injDef) {
|
|
11463
|
+
defType = ngModule;
|
|
11464
|
+
}
|
|
11465
|
+
else {
|
|
11466
|
+
// Not a component or injector type, so ignore it.
|
|
11467
|
+
return false;
|
|
11468
|
+
}
|
|
11469
|
+
}
|
|
11470
|
+
else if (cmpDef && !cmpDef.standalone) {
|
|
11471
|
+
return false;
|
|
11472
|
+
}
|
|
11473
|
+
else {
|
|
11474
|
+
defType = container;
|
|
11475
|
+
}
|
|
11476
|
+
// Check for circular dependencies.
|
|
11477
|
+
if (ngDevMode && parents.indexOf(defType) !== -1) {
|
|
11478
|
+
const defName = stringify(defType);
|
|
11479
|
+
const path = parents.map(stringify);
|
|
11480
|
+
throwCyclicDependencyError(defName, path);
|
|
11481
|
+
}
|
|
11482
|
+
// Check for multiple imports of the same module
|
|
11483
|
+
const isDuplicate = dedup.has(defType);
|
|
11484
|
+
if (cmpDef) {
|
|
11485
|
+
if (isDuplicate) {
|
|
11486
|
+
// This component definition has already been processed.
|
|
11487
|
+
return false;
|
|
11488
|
+
}
|
|
11489
|
+
dedup.add(defType);
|
|
11490
|
+
if (cmpDef.dependencies) {
|
|
11491
|
+
const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;
|
|
11492
|
+
for (const dep of deps) {
|
|
11493
|
+
walkProviderTree(dep, providersOut, parents, dedup);
|
|
11494
|
+
}
|
|
11495
|
+
}
|
|
11496
|
+
}
|
|
11497
|
+
else if (injDef) {
|
|
11498
|
+
// First, include providers from any imports.
|
|
11499
|
+
if (injDef.imports != null && !isDuplicate) {
|
|
11500
|
+
// Before processing defType's imports, add it to the set of parents. This way, if it ends
|
|
11501
|
+
// up deeply importing itself, this can be detected.
|
|
11502
|
+
ngDevMode && parents.push(defType);
|
|
11503
|
+
// Add it to the set of dedups. This way we can detect multiple imports of the same module
|
|
11504
|
+
dedup.add(defType);
|
|
11505
|
+
let importTypesWithProviders;
|
|
11506
|
+
try {
|
|
11507
|
+
deepForEach(injDef.imports, imported => {
|
|
11508
|
+
if (walkProviderTree(imported, providersOut, parents, dedup)) {
|
|
11509
|
+
importTypesWithProviders || (importTypesWithProviders = []);
|
|
11510
|
+
// If the processed import is an injector type with providers, we store it in the
|
|
11511
|
+
// list of import types with providers, so that we can process those afterwards.
|
|
11512
|
+
importTypesWithProviders.push(imported);
|
|
11513
|
+
}
|
|
11514
|
+
});
|
|
11515
|
+
}
|
|
11516
|
+
finally {
|
|
11517
|
+
// Remove it from the parents set when finished.
|
|
11518
|
+
ngDevMode && parents.pop();
|
|
11519
|
+
}
|
|
11520
|
+
// Imports which are declared with providers (TypeWithProviders) need to be processed
|
|
11521
|
+
// after all imported modules are processed. This is similar to how View Engine
|
|
11522
|
+
// processes/merges module imports in the metadata resolver. See: FW-1349.
|
|
11523
|
+
if (importTypesWithProviders !== undefined) {
|
|
11524
|
+
processInjectorTypesWithProviders(importTypesWithProviders, providersOut);
|
|
11525
|
+
}
|
|
11526
|
+
}
|
|
11527
|
+
if (!isDuplicate) {
|
|
11528
|
+
// Track the InjectorType and add a provider for it.
|
|
11529
|
+
// It's important that this is done after the def's imports.
|
|
11530
|
+
const factory = getFactoryDef(defType) || (() => new defType());
|
|
11531
|
+
// Append extra providers to make more info available for consumers (to retrieve an injector
|
|
11532
|
+
// type), as well as internally (to calculate an injection scope correctly and eagerly
|
|
11533
|
+
// instantiate a `defType` when an injector is created).
|
|
11534
|
+
providersOut.push(
|
|
11535
|
+
// Provider to create `defType` using its factory.
|
|
11536
|
+
{ provide: defType, useFactory: factory, deps: EMPTY_ARRAY },
|
|
11537
|
+
// Make this `defType` available to an internal logic that calculates injector scope.
|
|
11538
|
+
{ provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true },
|
|
11539
|
+
// Provider to eagerly instantiate `defType` via `INJECTOR_INITIALIZER`.
|
|
11540
|
+
{ provide: INJECTOR_INITIALIZER, useValue: () => ɵɵinject(defType), multi: true } //
|
|
11541
|
+
);
|
|
11542
|
+
}
|
|
11543
|
+
// Next, include providers listed on the definition itself.
|
|
11544
|
+
const defProviders = injDef.providers;
|
|
11545
|
+
if (defProviders != null && !isDuplicate) {
|
|
11546
|
+
const injectorType = container;
|
|
11547
|
+
deepForEach(defProviders, provider => {
|
|
11548
|
+
ngDevMode && validateProvider(provider, defProviders, injectorType);
|
|
11549
|
+
providersOut.push(provider);
|
|
11550
|
+
});
|
|
11551
|
+
}
|
|
11552
|
+
}
|
|
11553
|
+
else {
|
|
11554
|
+
// Should not happen, but just in case.
|
|
11555
|
+
return false;
|
|
11556
|
+
}
|
|
11557
|
+
return (defType !== container &&
|
|
11558
|
+
container.providers !== undefined);
|
|
11559
|
+
}
|
|
11560
|
+
function validateProvider(provider, providers, containerType) {
|
|
11561
|
+
if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) ||
|
|
11562
|
+
isExistingProvider(provider)) {
|
|
11563
|
+
return;
|
|
11564
|
+
}
|
|
11565
|
+
// Here we expect the provider to be a `useClass` provider (by elimination).
|
|
11566
|
+
const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
|
|
11567
|
+
if (!classRef) {
|
|
11568
|
+
throwInvalidProviderError(containerType, providers, provider);
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11571
|
+
const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: getClosureSafeProperty });
|
|
11572
|
+
function isValueProvider(value) {
|
|
11573
|
+
return value !== null && typeof value == 'object' && USE_VALUE$1 in value;
|
|
11574
|
+
}
|
|
11575
|
+
function isExistingProvider(value) {
|
|
11576
|
+
return !!(value && value.useExisting);
|
|
11577
|
+
}
|
|
11578
|
+
function isFactoryProvider(value) {
|
|
11579
|
+
return !!(value && value.useFactory);
|
|
11580
|
+
}
|
|
11581
|
+
function isTypeProvider(value) {
|
|
11582
|
+
return typeof value === 'function';
|
|
11583
|
+
}
|
|
11584
|
+
function isClassProvider(value) {
|
|
11585
|
+
return !!value.useClass;
|
|
11586
|
+
}
|
|
11587
|
+
|
|
11333
11588
|
/**
|
|
11334
11589
|
* @license
|
|
11335
11590
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -11412,56 +11667,47 @@ function getNullInjector() {
|
|
|
11412
11667
|
return NULL_INJECTOR$1;
|
|
11413
11668
|
}
|
|
11414
11669
|
/**
|
|
11415
|
-
*
|
|
11416
|
-
*
|
|
11417
|
-
* @publicApi
|
|
11418
|
-
*/
|
|
11419
|
-
function createInjector(defType, parent = null, additionalProviders = null, name) {
|
|
11420
|
-
const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
|
|
11421
|
-
injector._resolveInjectorDefTypes();
|
|
11422
|
-
return injector;
|
|
11423
|
-
}
|
|
11424
|
-
/**
|
|
11425
|
-
* Creates a new injector without eagerly resolving its injector types. Can be used in places
|
|
11426
|
-
* where resolving the injector types immediately can lead to an infinite loop. The injector types
|
|
11427
|
-
* should be resolved at a later point by calling `_resolveInjectorDefTypes`.
|
|
11670
|
+
* An `Injector` that's part of the environment injector hierarchy, which exists outside of the
|
|
11671
|
+
* component tree.
|
|
11428
11672
|
*/
|
|
11429
|
-
|
|
11430
|
-
return new R3Injector(defType, additionalProviders, parent || getNullInjector(), name);
|
|
11673
|
+
class EnvironmentInjector {
|
|
11431
11674
|
}
|
|
11432
|
-
class R3Injector {
|
|
11433
|
-
constructor(
|
|
11675
|
+
class R3Injector extends EnvironmentInjector {
|
|
11676
|
+
constructor(providers, parent, source, scopes) {
|
|
11677
|
+
super();
|
|
11434
11678
|
this.parent = parent;
|
|
11679
|
+
this.source = source;
|
|
11680
|
+
this.scopes = scopes;
|
|
11435
11681
|
/**
|
|
11436
11682
|
* Map of tokens to records which contain the instances of those tokens.
|
|
11437
11683
|
* - `null` value implies that we don't have the record. Used by tree-shakable injectors
|
|
11438
11684
|
* to prevent further searches.
|
|
11439
11685
|
*/
|
|
11440
11686
|
this.records = new Map();
|
|
11441
|
-
/**
|
|
11442
|
-
* The transitive set of `InjectorType`s which define this injector.
|
|
11443
|
-
*/
|
|
11444
|
-
this.injectorDefTypes = new Set();
|
|
11445
11687
|
/**
|
|
11446
11688
|
* Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
|
|
11447
11689
|
*/
|
|
11448
|
-
this.
|
|
11690
|
+
this._ngOnDestroyHooks = new Set();
|
|
11691
|
+
this._onDestroyHooks = [];
|
|
11449
11692
|
this._destroyed = false;
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
additionalProviders &&
|
|
11455
|
-
deepForEach(additionalProviders, provider => this.processProvider(provider, def, additionalProviders));
|
|
11456
|
-
deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack));
|
|
11693
|
+
// Start off by creating Records for every provider.
|
|
11694
|
+
for (const provider of providers) {
|
|
11695
|
+
this.processProvider(provider);
|
|
11696
|
+
}
|
|
11457
11697
|
// Make sure the INJECTOR token provides this injector.
|
|
11458
11698
|
this.records.set(INJECTOR, makeRecord(undefined, this));
|
|
11699
|
+
// And `EnvironmentInjector` if the current injector is supposed to be env-scoped.
|
|
11700
|
+
if (scopes.has('environment')) {
|
|
11701
|
+
this.records.set(EnvironmentInjector, makeRecord(undefined, this));
|
|
11702
|
+
}
|
|
11459
11703
|
// Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide
|
|
11460
11704
|
// any injectable scoped to APP_ROOT_SCOPE.
|
|
11461
11705
|
const record = this.records.get(INJECTOR_SCOPE);
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11706
|
+
if (record != null && typeof record.value === 'string') {
|
|
11707
|
+
this.scopes.add(record.value);
|
|
11708
|
+
}
|
|
11709
|
+
this.injectorDefTypes =
|
|
11710
|
+
new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));
|
|
11465
11711
|
}
|
|
11466
11712
|
/**
|
|
11467
11713
|
* Flag indicating that this injector was previously destroyed.
|
|
@@ -11481,15 +11727,24 @@ class R3Injector {
|
|
|
11481
11727
|
this._destroyed = true;
|
|
11482
11728
|
try {
|
|
11483
11729
|
// Call all the lifecycle hooks.
|
|
11484
|
-
|
|
11730
|
+
for (const service of this._ngOnDestroyHooks) {
|
|
11731
|
+
service.ngOnDestroy();
|
|
11732
|
+
}
|
|
11733
|
+
for (const hook of this._onDestroyHooks) {
|
|
11734
|
+
hook();
|
|
11735
|
+
}
|
|
11485
11736
|
}
|
|
11486
11737
|
finally {
|
|
11487
11738
|
// Release all references.
|
|
11488
11739
|
this.records.clear();
|
|
11489
|
-
this.
|
|
11740
|
+
this._ngOnDestroyHooks.clear();
|
|
11490
11741
|
this.injectorDefTypes.clear();
|
|
11742
|
+
this._onDestroyHooks.length = 0;
|
|
11491
11743
|
}
|
|
11492
11744
|
}
|
|
11745
|
+
onDestroy(callback) {
|
|
11746
|
+
this._onDestroyHooks.push(callback);
|
|
11747
|
+
}
|
|
11493
11748
|
get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
|
|
11494
11749
|
this.assertNotDestroyed();
|
|
11495
11750
|
// Set the injection context.
|
|
@@ -11553,12 +11808,26 @@ class R3Injector {
|
|
|
11553
11808
|
}
|
|
11554
11809
|
}
|
|
11555
11810
|
/** @internal */
|
|
11556
|
-
|
|
11557
|
-
|
|
11811
|
+
resolveInjectorInitializers() {
|
|
11812
|
+
const previousInjector = setCurrentInjector(this);
|
|
11813
|
+
const previousInjectImplementation = setInjectImplementation(undefined);
|
|
11814
|
+
try {
|
|
11815
|
+
const initializers = this.get(INJECTOR_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);
|
|
11816
|
+
for (const initializer of initializers) {
|
|
11817
|
+
initializer();
|
|
11818
|
+
}
|
|
11819
|
+
}
|
|
11820
|
+
finally {
|
|
11821
|
+
setCurrentInjector(previousInjector);
|
|
11822
|
+
setInjectImplementation(previousInjectImplementation);
|
|
11823
|
+
}
|
|
11558
11824
|
}
|
|
11559
11825
|
toString() {
|
|
11560
|
-
const tokens = []
|
|
11561
|
-
records
|
|
11826
|
+
const tokens = [];
|
|
11827
|
+
const records = this.records;
|
|
11828
|
+
for (const token of records.keys()) {
|
|
11829
|
+
tokens.push(stringify(token));
|
|
11830
|
+
}
|
|
11562
11831
|
return `R3Injector[${tokens.join(', ')}]`;
|
|
11563
11832
|
}
|
|
11564
11833
|
assertNotDestroyed() {
|
|
@@ -11566,105 +11835,16 @@ class R3Injector {
|
|
|
11566
11835
|
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
|
|
11567
11836
|
}
|
|
11568
11837
|
}
|
|
11569
|
-
/**
|
|
11570
|
-
* Add an `InjectorType` or `InjectorTypeWithProviders` and all of its transitive providers
|
|
11571
|
-
* to this injector.
|
|
11572
|
-
*
|
|
11573
|
-
* If an `InjectorTypeWithProviders` that declares providers besides the type is specified,
|
|
11574
|
-
* the function will return "true" to indicate that the providers of the type definition need
|
|
11575
|
-
* to be processed. This allows us to process providers of injector types after all imports of
|
|
11576
|
-
* an injector definition are processed. (following View Engine semantics: see FW-1349)
|
|
11577
|
-
*/
|
|
11578
|
-
processInjectorType(defOrWrappedDef, parents, dedupStack) {
|
|
11579
|
-
defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
|
|
11580
|
-
if (!defOrWrappedDef)
|
|
11581
|
-
return false;
|
|
11582
|
-
// Either the defOrWrappedDef is an InjectorType (with injector def) or an
|
|
11583
|
-
// InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic
|
|
11584
|
-
// read, so care is taken to only do the read once.
|
|
11585
|
-
// First attempt to read the injector def (`ɵinj`).
|
|
11586
|
-
let def = getInjectorDef(defOrWrappedDef);
|
|
11587
|
-
// If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.
|
|
11588
|
-
const ngModule = (def == null) && defOrWrappedDef.ngModule || undefined;
|
|
11589
|
-
// Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,
|
|
11590
|
-
// then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type
|
|
11591
|
-
// is the `ngModule`.
|
|
11592
|
-
const defType = (ngModule === undefined) ? defOrWrappedDef : ngModule;
|
|
11593
|
-
// Check for circular dependencies.
|
|
11594
|
-
if (ngDevMode && parents.indexOf(defType) !== -1) {
|
|
11595
|
-
const defName = stringify(defType);
|
|
11596
|
-
const path = parents.map(stringify);
|
|
11597
|
-
throwCyclicDependencyError(defName, path);
|
|
11598
|
-
}
|
|
11599
|
-
// Check for multiple imports of the same module
|
|
11600
|
-
const isDuplicate = dedupStack.indexOf(defType) !== -1;
|
|
11601
|
-
// Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual
|
|
11602
|
-
// `InjectorDef` is on its `ngModule`.
|
|
11603
|
-
if (ngModule !== undefined) {
|
|
11604
|
-
def = getInjectorDef(ngModule);
|
|
11605
|
-
}
|
|
11606
|
-
// If no definition was found, it might be from exports. Remove it.
|
|
11607
|
-
if (def == null) {
|
|
11608
|
-
return false;
|
|
11609
|
-
}
|
|
11610
|
-
// Add providers in the same way that @NgModule resolution did:
|
|
11611
|
-
// First, include providers from any imports.
|
|
11612
|
-
if (def.imports != null && !isDuplicate) {
|
|
11613
|
-
// Before processing defType's imports, add it to the set of parents. This way, if it ends
|
|
11614
|
-
// up deeply importing itself, this can be detected.
|
|
11615
|
-
ngDevMode && parents.push(defType);
|
|
11616
|
-
// Add it to the set of dedups. This way we can detect multiple imports of the same module
|
|
11617
|
-
dedupStack.push(defType);
|
|
11618
|
-
let importTypesWithProviders;
|
|
11619
|
-
try {
|
|
11620
|
-
deepForEach(def.imports, imported => {
|
|
11621
|
-
if (this.processInjectorType(imported, parents, dedupStack)) {
|
|
11622
|
-
if (importTypesWithProviders === undefined)
|
|
11623
|
-
importTypesWithProviders = [];
|
|
11624
|
-
// If the processed import is an injector type with providers, we store it in the
|
|
11625
|
-
// list of import types with providers, so that we can process those afterwards.
|
|
11626
|
-
importTypesWithProviders.push(imported);
|
|
11627
|
-
}
|
|
11628
|
-
});
|
|
11629
|
-
}
|
|
11630
|
-
finally {
|
|
11631
|
-
// Remove it from the parents set when finished.
|
|
11632
|
-
ngDevMode && parents.pop();
|
|
11633
|
-
}
|
|
11634
|
-
// Imports which are declared with providers (TypeWithProviders) need to be processed
|
|
11635
|
-
// after all imported modules are processed. This is similar to how View Engine
|
|
11636
|
-
// processes/merges module imports in the metadata resolver. See: FW-1349.
|
|
11637
|
-
if (importTypesWithProviders !== undefined) {
|
|
11638
|
-
for (let i = 0; i < importTypesWithProviders.length; i++) {
|
|
11639
|
-
const { ngModule, providers } = importTypesWithProviders[i];
|
|
11640
|
-
deepForEach(providers, provider => this.processProvider(provider, ngModule, providers || EMPTY_ARRAY));
|
|
11641
|
-
}
|
|
11642
|
-
}
|
|
11643
|
-
}
|
|
11644
|
-
// Track the InjectorType and add a provider for it. It's important that this is done after the
|
|
11645
|
-
// def's imports.
|
|
11646
|
-
this.injectorDefTypes.add(defType);
|
|
11647
|
-
const factory = getFactoryDef(defType) || (() => new defType());
|
|
11648
|
-
this.records.set(defType, makeRecord(factory, NOT_YET));
|
|
11649
|
-
// Next, include providers listed on the definition itself.
|
|
11650
|
-
const defProviders = def.providers;
|
|
11651
|
-
if (defProviders != null && !isDuplicate) {
|
|
11652
|
-
const injectorType = defOrWrappedDef;
|
|
11653
|
-
deepForEach(defProviders, provider => this.processProvider(provider, injectorType, defProviders));
|
|
11654
|
-
}
|
|
11655
|
-
return (ngModule !== undefined &&
|
|
11656
|
-
defOrWrappedDef.providers !== undefined);
|
|
11657
|
-
}
|
|
11658
11838
|
/**
|
|
11659
11839
|
* Process a `SingleProvider` and add it.
|
|
11660
11840
|
*/
|
|
11661
|
-
processProvider(provider
|
|
11841
|
+
processProvider(provider) {
|
|
11662
11842
|
// Determine the token from the provider. Either it's its own token, or has a {provide: ...}
|
|
11663
11843
|
// property.
|
|
11664
11844
|
provider = resolveForwardRef(provider);
|
|
11665
11845
|
let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);
|
|
11666
11846
|
// Construct a `Record` for the provider.
|
|
11667
|
-
const record = providerToRecord(provider
|
|
11847
|
+
const record = providerToRecord(provider);
|
|
11668
11848
|
if (!isTypeProvider(provider) && provider.multi === true) {
|
|
11669
11849
|
// If the provider indicates that it's a multi-provider, process it specially.
|
|
11670
11850
|
// First check whether it's been defined already.
|
|
@@ -11700,7 +11880,7 @@ class R3Injector {
|
|
|
11700
11880
|
record.value = record.factory();
|
|
11701
11881
|
}
|
|
11702
11882
|
if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
|
|
11703
|
-
this.
|
|
11883
|
+
this._ngOnDestroyHooks.add(record.value);
|
|
11704
11884
|
}
|
|
11705
11885
|
return record.value;
|
|
11706
11886
|
}
|
|
@@ -11710,7 +11890,7 @@ class R3Injector {
|
|
|
11710
11890
|
}
|
|
11711
11891
|
const providedIn = resolveForwardRef(def.providedIn);
|
|
11712
11892
|
if (typeof providedIn === 'string') {
|
|
11713
|
-
return providedIn === 'any' || (
|
|
11893
|
+
return providedIn === 'any' || (this.scopes.has(providedIn));
|
|
11714
11894
|
}
|
|
11715
11895
|
else {
|
|
11716
11896
|
return this.injectorDefTypes.has(providedIn);
|
|
@@ -11756,12 +11936,12 @@ function getUndecoratedInjectableFactory(token) {
|
|
|
11756
11936
|
return () => new token();
|
|
11757
11937
|
}
|
|
11758
11938
|
}
|
|
11759
|
-
function providerToRecord(provider
|
|
11939
|
+
function providerToRecord(provider) {
|
|
11760
11940
|
if (isValueProvider(provider)) {
|
|
11761
11941
|
return makeRecord(undefined, provider.useValue);
|
|
11762
11942
|
}
|
|
11763
11943
|
else {
|
|
11764
|
-
const factory = providerToFactory(provider
|
|
11944
|
+
const factory = providerToFactory(provider);
|
|
11765
11945
|
return makeRecord(factory, NOT_YET);
|
|
11766
11946
|
}
|
|
11767
11947
|
}
|
|
@@ -11809,21 +11989,6 @@ function makeRecord(factory, value, multi = false) {
|
|
|
11809
11989
|
multi: multi ? [] : undefined,
|
|
11810
11990
|
};
|
|
11811
11991
|
}
|
|
11812
|
-
function isValueProvider(value) {
|
|
11813
|
-
return value !== null && typeof value == 'object' && USE_VALUE$1 in value;
|
|
11814
|
-
}
|
|
11815
|
-
function isExistingProvider(value) {
|
|
11816
|
-
return !!(value && value.useExisting);
|
|
11817
|
-
}
|
|
11818
|
-
function isFactoryProvider(value) {
|
|
11819
|
-
return !!(value && value.useFactory);
|
|
11820
|
-
}
|
|
11821
|
-
function isTypeProvider(value) {
|
|
11822
|
-
return typeof value === 'function';
|
|
11823
|
-
}
|
|
11824
|
-
function isClassProvider(value) {
|
|
11825
|
-
return !!value.useClass;
|
|
11826
|
-
}
|
|
11827
11992
|
function hasDeps(value) {
|
|
11828
11993
|
return !!value.deps;
|
|
11829
11994
|
}
|
|
@@ -11836,6 +12001,37 @@ function couldBeInjectableType(value) {
|
|
|
11836
12001
|
(typeof value === 'object' && value instanceof InjectionToken);
|
|
11837
12002
|
}
|
|
11838
12003
|
|
|
12004
|
+
/**
|
|
12005
|
+
* @license
|
|
12006
|
+
* Copyright Google LLC All Rights Reserved.
|
|
12007
|
+
*
|
|
12008
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
12009
|
+
* found in the LICENSE file at https://angular.io/license
|
|
12010
|
+
*/
|
|
12011
|
+
/**
|
|
12012
|
+
* Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
|
|
12013
|
+
*
|
|
12014
|
+
* @publicApi
|
|
12015
|
+
*/
|
|
12016
|
+
function createInjector(defType, parent = null, additionalProviders = null, name) {
|
|
12017
|
+
const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
|
|
12018
|
+
injector.resolveInjectorInitializers();
|
|
12019
|
+
return injector;
|
|
12020
|
+
}
|
|
12021
|
+
/**
|
|
12022
|
+
* Creates a new injector without eagerly resolving its injector types. Can be used in places
|
|
12023
|
+
* where resolving the injector types immediately can lead to an infinite loop. The injector types
|
|
12024
|
+
* should be resolved at a later point by calling `_resolveInjectorDefTypes`.
|
|
12025
|
+
*/
|
|
12026
|
+
function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {
|
|
12027
|
+
const providers = [
|
|
12028
|
+
...flatten(additionalProviders || EMPTY_ARRAY),
|
|
12029
|
+
...importProvidersFrom(defType),
|
|
12030
|
+
];
|
|
12031
|
+
name = name || (typeof defType === 'object' ? undefined : stringify(defType));
|
|
12032
|
+
return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);
|
|
12033
|
+
}
|
|
12034
|
+
|
|
11839
12035
|
/**
|
|
11840
12036
|
* @license
|
|
11841
12037
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -12611,7 +12807,7 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
12611
12807
|
else {
|
|
12612
12808
|
if (superType.ɵcmp) {
|
|
12613
12809
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
12614
|
-
|
|
12810
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
|
|
12615
12811
|
'';
|
|
12616
12812
|
throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
|
|
12617
12813
|
}
|
|
@@ -12857,22 +13053,8 @@ function getSymbolIterator() {
|
|
|
12857
13053
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12858
13054
|
* found in the LICENSE file at https://angular.io/license
|
|
12859
13055
|
*/
|
|
12860
|
-
function
|
|
12861
|
-
|
|
12862
|
-
const isListLikeIterableB = isListLikeIterable(b);
|
|
12863
|
-
if (isListLikeIterableA && isListLikeIterableB) {
|
|
12864
|
-
return areIterablesEqual(a, b, devModeEqual);
|
|
12865
|
-
}
|
|
12866
|
-
else {
|
|
12867
|
-
const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
|
12868
|
-
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
12869
|
-
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
12870
|
-
return true;
|
|
12871
|
-
}
|
|
12872
|
-
else {
|
|
12873
|
-
return Object.is(a, b);
|
|
12874
|
-
}
|
|
12875
|
-
}
|
|
13056
|
+
function isIterable(obj) {
|
|
13057
|
+
return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
|
|
12876
13058
|
}
|
|
12877
13059
|
function isListLikeIterable(obj) {
|
|
12878
13060
|
if (!isJsObject(obj))
|
|
@@ -12920,13 +13102,38 @@ function isJsObject(o) {
|
|
|
12920
13102
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12921
13103
|
* found in the LICENSE file at https://angular.io/license
|
|
12922
13104
|
*/
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
13105
|
+
function devModeEqual(a, b) {
|
|
13106
|
+
const isListLikeIterableA = isListLikeIterable(a);
|
|
13107
|
+
const isListLikeIterableB = isListLikeIterable(b);
|
|
13108
|
+
if (isListLikeIterableA && isListLikeIterableB) {
|
|
13109
|
+
return areIterablesEqual(a, b, devModeEqual);
|
|
13110
|
+
}
|
|
13111
|
+
else {
|
|
13112
|
+
const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
|
13113
|
+
const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
|
13114
|
+
if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
|
13115
|
+
return true;
|
|
13116
|
+
}
|
|
13117
|
+
else {
|
|
13118
|
+
return Object.is(a, b);
|
|
13119
|
+
}
|
|
13120
|
+
}
|
|
13121
|
+
}
|
|
13122
|
+
|
|
13123
|
+
/**
|
|
13124
|
+
* @license
|
|
13125
|
+
* Copyright Google LLC All Rights Reserved.
|
|
13126
|
+
*
|
|
13127
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13128
|
+
* found in the LICENSE file at https://angular.io/license
|
|
13129
|
+
*/
|
|
13130
|
+
// TODO(misko): consider inlining
|
|
13131
|
+
/** Updates binding and returns the value. */
|
|
13132
|
+
function updateBinding(lView, bindingIndex, value) {
|
|
13133
|
+
return lView[bindingIndex] = value;
|
|
13134
|
+
}
|
|
13135
|
+
/** Gets the current binding value. */
|
|
13136
|
+
function getBinding(lView, bindingIndex) {
|
|
12930
13137
|
ngDevMode && assertIndexInRange(lView, bindingIndex);
|
|
12931
13138
|
ngDevMode &&
|
|
12932
13139
|
assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
|
|
@@ -21057,37 +21264,6 @@ function ɵɵProvidersFeature(providers, viewProviders = []) {
|
|
|
21057
21264
|
};
|
|
21058
21265
|
}
|
|
21059
21266
|
|
|
21060
|
-
/**
|
|
21061
|
-
* @license
|
|
21062
|
-
* Copyright Google LLC All Rights Reserved.
|
|
21063
|
-
*
|
|
21064
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
21065
|
-
* found in the LICENSE file at https://angular.io/license
|
|
21066
|
-
*/
|
|
21067
|
-
/**
|
|
21068
|
-
* Represents a component created by a `ComponentFactory`.
|
|
21069
|
-
* Provides access to the component instance and related objects,
|
|
21070
|
-
* and provides the means of destroying the instance.
|
|
21071
|
-
*
|
|
21072
|
-
* @publicApi
|
|
21073
|
-
*/
|
|
21074
|
-
class ComponentRef$1 {
|
|
21075
|
-
}
|
|
21076
|
-
/**
|
|
21077
|
-
* Base class for a factory that can create a component dynamically.
|
|
21078
|
-
* Instantiate a factory for a given type of component with `resolveComponentFactory()`.
|
|
21079
|
-
* Use the resulting `ComponentFactory.create()` method to create a component of that type.
|
|
21080
|
-
*
|
|
21081
|
-
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
21082
|
-
*
|
|
21083
|
-
* @publicApi
|
|
21084
|
-
*
|
|
21085
|
-
* @deprecated Angular no longer requires Component factories. Please use other APIs where
|
|
21086
|
-
* Component class can be used directly.
|
|
21087
|
-
*/
|
|
21088
|
-
class ComponentFactory$1 {
|
|
21089
|
-
}
|
|
21090
|
-
|
|
21091
21267
|
/**
|
|
21092
21268
|
* @license
|
|
21093
21269
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -21128,6 +21304,66 @@ class ComponentFactoryResolver$1 {
|
|
|
21128
21304
|
}
|
|
21129
21305
|
ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
|
|
21130
21306
|
|
|
21307
|
+
/**
|
|
21308
|
+
* @license
|
|
21309
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21310
|
+
*
|
|
21311
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21312
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21313
|
+
*/
|
|
21314
|
+
/**
|
|
21315
|
+
* Represents an instance of an `NgModule` created by an `NgModuleFactory`.
|
|
21316
|
+
* Provides access to the `NgModule` instance and related objects.
|
|
21317
|
+
*
|
|
21318
|
+
* @publicApi
|
|
21319
|
+
*/
|
|
21320
|
+
class NgModuleRef$1 {
|
|
21321
|
+
}
|
|
21322
|
+
/**
|
|
21323
|
+
* @publicApi
|
|
21324
|
+
*
|
|
21325
|
+
* @deprecated
|
|
21326
|
+
* This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
|
|
21327
|
+
* JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
|
|
21328
|
+
* for additional context. Angular provides APIs that accept NgModule classes directly (such as
|
|
21329
|
+
* [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
|
|
21330
|
+
* [createNgModuleRef](api/core/createNgModuleRef)), consider switching to those APIs instead of
|
|
21331
|
+
* using factory-based ones.
|
|
21332
|
+
*/
|
|
21333
|
+
class NgModuleFactory$1 {
|
|
21334
|
+
}
|
|
21335
|
+
|
|
21336
|
+
/**
|
|
21337
|
+
* @license
|
|
21338
|
+
* Copyright Google LLC All Rights Reserved.
|
|
21339
|
+
*
|
|
21340
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
21341
|
+
* found in the LICENSE file at https://angular.io/license
|
|
21342
|
+
*/
|
|
21343
|
+
/**
|
|
21344
|
+
* Represents a component created by a `ComponentFactory`.
|
|
21345
|
+
* Provides access to the component instance and related objects,
|
|
21346
|
+
* and provides the means of destroying the instance.
|
|
21347
|
+
*
|
|
21348
|
+
* @publicApi
|
|
21349
|
+
*/
|
|
21350
|
+
class ComponentRef$1 {
|
|
21351
|
+
}
|
|
21352
|
+
/**
|
|
21353
|
+
* Base class for a factory that can create a component dynamically.
|
|
21354
|
+
* Instantiate a factory for a given type of component with `resolveComponentFactory()`.
|
|
21355
|
+
* Use the resulting `ComponentFactory.create()` method to create a component of that type.
|
|
21356
|
+
*
|
|
21357
|
+
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
21358
|
+
*
|
|
21359
|
+
* @publicApi
|
|
21360
|
+
*
|
|
21361
|
+
* @deprecated Angular no longer requires Component factories. Please use other APIs where
|
|
21362
|
+
* Component class can be used directly.
|
|
21363
|
+
*/
|
|
21364
|
+
class ComponentFactory$1 {
|
|
21365
|
+
}
|
|
21366
|
+
|
|
21131
21367
|
/**
|
|
21132
21368
|
* @license
|
|
21133
21369
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -21287,7 +21523,7 @@ class Version {
|
|
|
21287
21523
|
/**
|
|
21288
21524
|
* @publicApi
|
|
21289
21525
|
*/
|
|
21290
|
-
const VERSION = new Version('14.0.0-next.
|
|
21526
|
+
const VERSION = new Version('14.0.0-next.15');
|
|
21291
21527
|
|
|
21292
21528
|
/**
|
|
21293
21529
|
* @license
|
|
@@ -21739,9 +21975,16 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
21739
21975
|
get outputs() {
|
|
21740
21976
|
return toRefArray(this.componentDef.outputs);
|
|
21741
21977
|
}
|
|
21742
|
-
create(injector, projectableNodes, rootSelectorOrNode,
|
|
21743
|
-
|
|
21744
|
-
|
|
21978
|
+
create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
|
|
21979
|
+
environmentInjector = environmentInjector || this.ngModule;
|
|
21980
|
+
let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
|
|
21981
|
+
environmentInjector :
|
|
21982
|
+
environmentInjector?.injector;
|
|
21983
|
+
if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
|
|
21984
|
+
realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
|
|
21985
|
+
realEnvironmentInjector;
|
|
21986
|
+
}
|
|
21987
|
+
const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
|
|
21745
21988
|
const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
|
|
21746
21989
|
const sanitizer = rootViewInjector.get(Sanitizer, null);
|
|
21747
21990
|
const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
|
|
@@ -21849,83 +22092,6 @@ class ComponentRef extends ComponentRef$1 {
|
|
|
21849
22092
|
}
|
|
21850
22093
|
}
|
|
21851
22094
|
|
|
21852
|
-
/**
|
|
21853
|
-
* @license
|
|
21854
|
-
* Copyright Google LLC All Rights Reserved.
|
|
21855
|
-
*
|
|
21856
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
21857
|
-
* found in the LICENSE file at https://angular.io/license
|
|
21858
|
-
*/
|
|
21859
|
-
/**
|
|
21860
|
-
* Adds decorator, constructor, and property metadata to a given type via static metadata fields
|
|
21861
|
-
* on the type.
|
|
21862
|
-
*
|
|
21863
|
-
* These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
|
|
21864
|
-
*
|
|
21865
|
-
* Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
|
|
21866
|
-
* being tree-shaken away during production builds.
|
|
21867
|
-
*/
|
|
21868
|
-
function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
|
|
21869
|
-
return noSideEffects(() => {
|
|
21870
|
-
const clazz = type;
|
|
21871
|
-
if (decorators !== null) {
|
|
21872
|
-
if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
|
|
21873
|
-
clazz.decorators.push(...decorators);
|
|
21874
|
-
}
|
|
21875
|
-
else {
|
|
21876
|
-
clazz.decorators = decorators;
|
|
21877
|
-
}
|
|
21878
|
-
}
|
|
21879
|
-
if (ctorParameters !== null) {
|
|
21880
|
-
// Rather than merging, clobber the existing parameters. If other projects exist which
|
|
21881
|
-
// use tsickle-style annotations and reflect over them in the same way, this could
|
|
21882
|
-
// cause issues, but that is vanishingly unlikely.
|
|
21883
|
-
clazz.ctorParameters = ctorParameters;
|
|
21884
|
-
}
|
|
21885
|
-
if (propDecorators !== null) {
|
|
21886
|
-
// The property decorator objects are merged as it is possible different fields have
|
|
21887
|
-
// different decorator types. Decorators on individual fields are not merged, as it's
|
|
21888
|
-
// also incredibly unlikely that a field will be decorated both with an Angular
|
|
21889
|
-
// decorator and a non-Angular decorator that's also been downleveled.
|
|
21890
|
-
if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {
|
|
21891
|
-
clazz.propDecorators = { ...clazz.propDecorators, ...propDecorators };
|
|
21892
|
-
}
|
|
21893
|
-
else {
|
|
21894
|
-
clazz.propDecorators = propDecorators;
|
|
21895
|
-
}
|
|
21896
|
-
}
|
|
21897
|
-
});
|
|
21898
|
-
}
|
|
21899
|
-
|
|
21900
|
-
/**
|
|
21901
|
-
* @license
|
|
21902
|
-
* Copyright Google LLC All Rights Reserved.
|
|
21903
|
-
*
|
|
21904
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
21905
|
-
* found in the LICENSE file at https://angular.io/license
|
|
21906
|
-
*/
|
|
21907
|
-
/**
|
|
21908
|
-
* Represents an instance of an `NgModule` created by an `NgModuleFactory`.
|
|
21909
|
-
* Provides access to the `NgModule` instance and related objects.
|
|
21910
|
-
*
|
|
21911
|
-
* @publicApi
|
|
21912
|
-
*/
|
|
21913
|
-
class NgModuleRef$1 {
|
|
21914
|
-
}
|
|
21915
|
-
/**
|
|
21916
|
-
* @publicApi
|
|
21917
|
-
*
|
|
21918
|
-
* @deprecated
|
|
21919
|
-
* This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
|
|
21920
|
-
* JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
|
|
21921
|
-
* for additional context. Angular provides APIs that accept NgModule classes directly (such as
|
|
21922
|
-
* [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
|
|
21923
|
-
* [createNgModuleRef](api/core/createNgModuleRef)), consider switching to those APIs instead of
|
|
21924
|
-
* using factory-based ones.
|
|
21925
|
-
*/
|
|
21926
|
-
class NgModuleFactory$1 {
|
|
21927
|
-
}
|
|
21928
|
-
|
|
21929
22095
|
/**
|
|
21930
22096
|
* @license
|
|
21931
22097
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -21967,11 +22133,11 @@ class NgModuleRef extends NgModuleRef$1 {
|
|
|
21967
22133
|
provide: ComponentFactoryResolver$1,
|
|
21968
22134
|
useValue: this.componentFactoryResolver
|
|
21969
22135
|
}
|
|
21970
|
-
], stringify(ngModuleType));
|
|
22136
|
+
], stringify(ngModuleType), new Set(['environment']));
|
|
21971
22137
|
// We need to resolve the injector types separately from the injector creation, because
|
|
21972
22138
|
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21973
22139
|
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21974
|
-
this._r3Injector.
|
|
22140
|
+
this._r3Injector.resolveInjectorInitializers();
|
|
21975
22141
|
this.instance = this.get(ngModuleType);
|
|
21976
22142
|
}
|
|
21977
22143
|
get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
|
|
@@ -22001,6 +22167,147 @@ class NgModuleFactory extends NgModuleFactory$1 {
|
|
|
22001
22167
|
return new NgModuleRef(this.moduleType, parentInjector);
|
|
22002
22168
|
}
|
|
22003
22169
|
}
|
|
22170
|
+
class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
22171
|
+
constructor(providers, parent, source) {
|
|
22172
|
+
super();
|
|
22173
|
+
this.componentFactoryResolver = new ComponentFactoryResolver(this);
|
|
22174
|
+
this.instance = null;
|
|
22175
|
+
const injector = new R3Injector([
|
|
22176
|
+
...providers,
|
|
22177
|
+
{ provide: NgModuleRef$1, useValue: this },
|
|
22178
|
+
{ provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
|
|
22179
|
+
], parent || getNullInjector(), source, new Set(['environment']));
|
|
22180
|
+
this.injector = injector;
|
|
22181
|
+
injector.resolveInjectorInitializers();
|
|
22182
|
+
}
|
|
22183
|
+
destroy() {
|
|
22184
|
+
this.injector.destroy();
|
|
22185
|
+
}
|
|
22186
|
+
onDestroy(callback) {
|
|
22187
|
+
this.injector.onDestroy(callback);
|
|
22188
|
+
}
|
|
22189
|
+
}
|
|
22190
|
+
/**
|
|
22191
|
+
* Create a new environment injector.
|
|
22192
|
+
*
|
|
22193
|
+
* @publicApi
|
|
22194
|
+
*/
|
|
22195
|
+
function createEnvironmentInjector(providers, parent = null, debugName = null) {
|
|
22196
|
+
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
22197
|
+
return adapter.injector;
|
|
22198
|
+
}
|
|
22199
|
+
|
|
22200
|
+
/**
|
|
22201
|
+
* @license
|
|
22202
|
+
* Copyright Google LLC All Rights Reserved.
|
|
22203
|
+
*
|
|
22204
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
22205
|
+
* found in the LICENSE file at https://angular.io/license
|
|
22206
|
+
*/
|
|
22207
|
+
/**
|
|
22208
|
+
* A service used by the framework to create instances of standalone injectors. Those injectors are
|
|
22209
|
+
* created on demand in case of dynamic component instantiation and contain ambient providers
|
|
22210
|
+
* collected from the imports graph rooted at a given standalone component.
|
|
22211
|
+
*/
|
|
22212
|
+
class StandaloneService {
|
|
22213
|
+
constructor(_injector) {
|
|
22214
|
+
this._injector = _injector;
|
|
22215
|
+
this.cachedInjectors = new Map();
|
|
22216
|
+
}
|
|
22217
|
+
getOrCreateStandaloneInjector(componentDef) {
|
|
22218
|
+
if (!componentDef.standalone) {
|
|
22219
|
+
return null;
|
|
22220
|
+
}
|
|
22221
|
+
if (!this.cachedInjectors.has(componentDef)) {
|
|
22222
|
+
const providers = importProvidersFrom(componentDef.type);
|
|
22223
|
+
const standaloneInjector = providers.length > 0 ?
|
|
22224
|
+
createEnvironmentInjector(providers, this._injector, `Standalone[${componentDef.type.name}]`) :
|
|
22225
|
+
null;
|
|
22226
|
+
this.cachedInjectors.set(componentDef, standaloneInjector);
|
|
22227
|
+
}
|
|
22228
|
+
return this.cachedInjectors.get(componentDef);
|
|
22229
|
+
}
|
|
22230
|
+
ngOnDestroy() {
|
|
22231
|
+
try {
|
|
22232
|
+
for (const injector of this.cachedInjectors.values()) {
|
|
22233
|
+
if (injector !== null) {
|
|
22234
|
+
injector.destroy();
|
|
22235
|
+
}
|
|
22236
|
+
}
|
|
22237
|
+
}
|
|
22238
|
+
finally {
|
|
22239
|
+
this.cachedInjectors.clear();
|
|
22240
|
+
}
|
|
22241
|
+
}
|
|
22242
|
+
}
|
|
22243
|
+
StandaloneService.ɵprov = ɵɵdefineInjectable({
|
|
22244
|
+
token: StandaloneService,
|
|
22245
|
+
providedIn: 'environment',
|
|
22246
|
+
factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
|
|
22247
|
+
});
|
|
22248
|
+
/**
|
|
22249
|
+
* A feature that acts as a setup code for the {@see StandaloneService}.
|
|
22250
|
+
*
|
|
22251
|
+
* The most important responsaibility of this feature is to expose the "getStandaloneInjector"
|
|
22252
|
+
* function (an entry points to a standalone injector creation) on a component definition object. We
|
|
22253
|
+
* go through the features infrastructure to make sure that the standalone injector creation logic
|
|
22254
|
+
* is tree-shakable and not included in applications that don't use standalone components.
|
|
22255
|
+
*
|
|
22256
|
+
* @codeGenApi
|
|
22257
|
+
*/
|
|
22258
|
+
function ɵɵStandaloneFeature(definition) {
|
|
22259
|
+
definition.getStandaloneInjector = (parentInjector) => {
|
|
22260
|
+
return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
|
|
22261
|
+
};
|
|
22262
|
+
}
|
|
22263
|
+
|
|
22264
|
+
/**
|
|
22265
|
+
* @license
|
|
22266
|
+
* Copyright Google LLC All Rights Reserved.
|
|
22267
|
+
*
|
|
22268
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
22269
|
+
* found in the LICENSE file at https://angular.io/license
|
|
22270
|
+
*/
|
|
22271
|
+
/**
|
|
22272
|
+
* Adds decorator, constructor, and property metadata to a given type via static metadata fields
|
|
22273
|
+
* on the type.
|
|
22274
|
+
*
|
|
22275
|
+
* These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
|
|
22276
|
+
*
|
|
22277
|
+
* Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
|
|
22278
|
+
* being tree-shaken away during production builds.
|
|
22279
|
+
*/
|
|
22280
|
+
function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
|
|
22281
|
+
return noSideEffects(() => {
|
|
22282
|
+
const clazz = type;
|
|
22283
|
+
if (decorators !== null) {
|
|
22284
|
+
if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
|
|
22285
|
+
clazz.decorators.push(...decorators);
|
|
22286
|
+
}
|
|
22287
|
+
else {
|
|
22288
|
+
clazz.decorators = decorators;
|
|
22289
|
+
}
|
|
22290
|
+
}
|
|
22291
|
+
if (ctorParameters !== null) {
|
|
22292
|
+
// Rather than merging, clobber the existing parameters. If other projects exist which
|
|
22293
|
+
// use tsickle-style annotations and reflect over them in the same way, this could
|
|
22294
|
+
// cause issues, but that is vanishingly unlikely.
|
|
22295
|
+
clazz.ctorParameters = ctorParameters;
|
|
22296
|
+
}
|
|
22297
|
+
if (propDecorators !== null) {
|
|
22298
|
+
// The property decorator objects are merged as it is possible different fields have
|
|
22299
|
+
// different decorator types. Decorators on individual fields are not merged, as it's
|
|
22300
|
+
// also incredibly unlikely that a field will be decorated both with an Angular
|
|
22301
|
+
// decorator and a non-Angular decorator that's also been downleveled.
|
|
22302
|
+
if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {
|
|
22303
|
+
clazz.propDecorators = { ...clazz.propDecorators, ...propDecorators };
|
|
22304
|
+
}
|
|
22305
|
+
else {
|
|
22306
|
+
clazz.propDecorators = propDecorators;
|
|
22307
|
+
}
|
|
22308
|
+
}
|
|
22309
|
+
});
|
|
22310
|
+
}
|
|
22004
22311
|
|
|
22005
22312
|
/**
|
|
22006
22313
|
* @license
|
|
@@ -22925,7 +23232,7 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
22925
23232
|
this.insert(viewRef, index);
|
|
22926
23233
|
return viewRef;
|
|
22927
23234
|
}
|
|
22928
|
-
createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes,
|
|
23235
|
+
createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {
|
|
22929
23236
|
const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
|
|
22930
23237
|
let index;
|
|
22931
23238
|
// This function supports 2 signatures and we need to handle options correctly for both:
|
|
@@ -22953,17 +23260,20 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
22953
23260
|
'is incompatible. Please use an object as the second argument instead.');
|
|
22954
23261
|
}
|
|
22955
23262
|
const options = (indexOrOptions || {});
|
|
23263
|
+
if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
|
|
23264
|
+
throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
|
|
23265
|
+
}
|
|
22956
23266
|
index = options.index;
|
|
22957
23267
|
injector = options.injector;
|
|
22958
23268
|
projectableNodes = options.projectableNodes;
|
|
22959
|
-
|
|
23269
|
+
environmentInjector = options.environmentInjector || options.ngModuleRef;
|
|
22960
23270
|
}
|
|
22961
23271
|
const componentFactory = isComponentFactory ?
|
|
22962
23272
|
componentFactoryOrType :
|
|
22963
23273
|
new ComponentFactory(getComponentDef(componentFactoryOrType));
|
|
22964
23274
|
const contextInjector = injector || this.parentInjector;
|
|
22965
23275
|
// If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.
|
|
22966
|
-
if (!
|
|
23276
|
+
if (!environmentInjector && componentFactory.ngModule == null) {
|
|
22967
23277
|
// For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that
|
|
22968
23278
|
// an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an
|
|
22969
23279
|
// `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based
|
|
@@ -22984,12 +23294,12 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
|
|
|
22984
23294
|
// DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||
|
|
22985
23295
|
// undefined` expression which seems to cause internal google apps to fail. This is documented
|
|
22986
23296
|
// in the following internal bug issue: go/b/142967802
|
|
22987
|
-
const result = _injector.get(
|
|
23297
|
+
const result = _injector.get(EnvironmentInjector, null);
|
|
22988
23298
|
if (result) {
|
|
22989
|
-
|
|
23299
|
+
environmentInjector = result;
|
|
22990
23300
|
}
|
|
22991
23301
|
}
|
|
22992
|
-
const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined,
|
|
23302
|
+
const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, environmentInjector);
|
|
22993
23303
|
this.insert(componentRef.hostView, index);
|
|
22994
23304
|
return componentRef;
|
|
22995
23305
|
}
|
|
@@ -23679,6 +23989,7 @@ const angularCoreEnv = (() => ({
|
|
|
23679
23989
|
'ɵɵProvidersFeature': ɵɵProvidersFeature,
|
|
23680
23990
|
'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,
|
|
23681
23991
|
'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,
|
|
23992
|
+
'ɵɵStandaloneFeature': ɵɵStandaloneFeature,
|
|
23682
23993
|
'ɵɵnextContext': ɵɵnextContext,
|
|
23683
23994
|
'ɵɵnamespaceHTML': ɵɵnamespaceHTML,
|
|
23684
23995
|
'ɵɵnamespaceMathML': ɵɵnamespaceMathML,
|
|
@@ -23989,9 +24300,16 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
23989
24300
|
configurable: !!ngDevMode,
|
|
23990
24301
|
});
|
|
23991
24302
|
}
|
|
24303
|
+
function isStandalone(type) {
|
|
24304
|
+
const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24305
|
+
return def !== null ? def.standalone : false;
|
|
24306
|
+
}
|
|
23992
24307
|
function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
|
|
23993
24308
|
if (verifiedNgModule.get(moduleType))
|
|
23994
24309
|
return;
|
|
24310
|
+
// skip verifications of standalone components, direcrtives and pipes
|
|
24311
|
+
if (isStandalone(moduleType))
|
|
24312
|
+
return;
|
|
23995
24313
|
verifiedNgModule.set(moduleType, true);
|
|
23996
24314
|
moduleType = resolveForwardRef(moduleType);
|
|
23997
24315
|
let ngModuleDef;
|
|
@@ -24007,9 +24325,9 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24007
24325
|
const errors = [];
|
|
24008
24326
|
const declarations = maybeUnwrapFn(ngModuleDef.declarations);
|
|
24009
24327
|
const imports = maybeUnwrapFn(ngModuleDef.imports);
|
|
24010
|
-
flatten(imports).map(unwrapModuleWithProvidersImports).forEach(
|
|
24011
|
-
verifySemanticsOfNgModuleImport(
|
|
24012
|
-
verifySemanticsOfNgModuleDef(
|
|
24328
|
+
flatten(imports).map(unwrapModuleWithProvidersImports).forEach(modOrStandaloneCmpt => {
|
|
24329
|
+
verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
|
|
24330
|
+
verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
|
|
24013
24331
|
});
|
|
24014
24332
|
const exports = maybeUnwrapFn(ngModuleDef.exports);
|
|
24015
24333
|
declarations.forEach(verifyDeclarationsHaveDefinitions);
|
|
@@ -24106,10 +24424,12 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
|
|
|
24106
24424
|
}
|
|
24107
24425
|
function verifySemanticsOfNgModuleImport(type, importingModule) {
|
|
24108
24426
|
type = resolveForwardRef(type);
|
|
24109
|
-
|
|
24427
|
+
const directiveDef = getComponentDef(type) || getDirectiveDef(type);
|
|
24428
|
+
if (directiveDef !== null && !directiveDef.standalone) {
|
|
24110
24429
|
throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
|
|
24111
24430
|
}
|
|
24112
|
-
|
|
24431
|
+
const pipeDef = getPipeDef$1(type);
|
|
24432
|
+
if (pipeDef !== null && !pipeDef.standalone) {
|
|
24113
24433
|
throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
|
|
24114
24434
|
}
|
|
24115
24435
|
}
|
|
@@ -24163,7 +24483,11 @@ function resetCompiledComponents() {
|
|
|
24163
24483
|
*/
|
|
24164
24484
|
function computeCombinedExports(type) {
|
|
24165
24485
|
type = resolveForwardRef(type);
|
|
24166
|
-
const ngModuleDef = getNgModuleDef(type
|
|
24486
|
+
const ngModuleDef = getNgModuleDef(type);
|
|
24487
|
+
// a standalone component, directive or pipe
|
|
24488
|
+
if (ngModuleDef === null) {
|
|
24489
|
+
return [type];
|
|
24490
|
+
}
|
|
24167
24491
|
return [...flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => {
|
|
24168
24492
|
const ngModuleDef = getNgModuleDef(type);
|
|
24169
24493
|
if (ngModuleDef) {
|
|
@@ -24212,6 +24536,47 @@ function patchComponentDefWithScope(componentDef, transitiveScopes) {
|
|
|
24212
24536
|
// order to avoid this problem, we force fresh TView to be created.
|
|
24213
24537
|
componentDef.tView = null;
|
|
24214
24538
|
}
|
|
24539
|
+
/**
|
|
24540
|
+
* Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
|
|
24541
|
+
* (eaither a NgModule or a standalone component / directive / pipe).
|
|
24542
|
+
*/
|
|
24543
|
+
function transitiveScopesFor(type) {
|
|
24544
|
+
if (isNgModule(type)) {
|
|
24545
|
+
return transitiveScopesForNgModule(type);
|
|
24546
|
+
}
|
|
24547
|
+
else if (isStandalone(type)) {
|
|
24548
|
+
const directiveDef = getComponentDef(type) || getDirectiveDef(type);
|
|
24549
|
+
if (directiveDef !== null) {
|
|
24550
|
+
return {
|
|
24551
|
+
schemas: null,
|
|
24552
|
+
compilation: {
|
|
24553
|
+
directives: new Set(),
|
|
24554
|
+
pipes: new Set(),
|
|
24555
|
+
},
|
|
24556
|
+
exported: {
|
|
24557
|
+
directives: new Set([type]),
|
|
24558
|
+
pipes: new Set(),
|
|
24559
|
+
},
|
|
24560
|
+
};
|
|
24561
|
+
}
|
|
24562
|
+
const pipeDef = getPipeDef$1(type);
|
|
24563
|
+
if (pipeDef !== null) {
|
|
24564
|
+
return {
|
|
24565
|
+
schemas: null,
|
|
24566
|
+
compilation: {
|
|
24567
|
+
directives: new Set(),
|
|
24568
|
+
pipes: new Set(),
|
|
24569
|
+
},
|
|
24570
|
+
exported: {
|
|
24571
|
+
directives: new Set(),
|
|
24572
|
+
pipes: new Set([type]),
|
|
24573
|
+
},
|
|
24574
|
+
};
|
|
24575
|
+
}
|
|
24576
|
+
}
|
|
24577
|
+
// TODO: change the error message to be more user-facing and take standalone into account
|
|
24578
|
+
throw new Error(`${type.name} does not have a module def (ɵmod property)`);
|
|
24579
|
+
}
|
|
24215
24580
|
/**
|
|
24216
24581
|
* Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.
|
|
24217
24582
|
*
|
|
@@ -24221,11 +24586,8 @@ function patchComponentDefWithScope(componentDef, transitiveScopes) {
|
|
|
24221
24586
|
*
|
|
24222
24587
|
* @param moduleType module that transitive scope should be calculated for.
|
|
24223
24588
|
*/
|
|
24224
|
-
function
|
|
24225
|
-
|
|
24226
|
-
throw new Error(`${moduleType.name} does not have a module def (ɵmod property)`);
|
|
24227
|
-
}
|
|
24228
|
-
const def = getNgModuleDef(moduleType);
|
|
24589
|
+
function transitiveScopesForNgModule(moduleType) {
|
|
24590
|
+
const def = getNgModuleDef(moduleType, true);
|
|
24229
24591
|
if (def.transitiveCompileScopes !== null) {
|
|
24230
24592
|
return def.transitiveCompileScopes;
|
|
24231
24593
|
}
|
|
@@ -24241,13 +24603,9 @@ function transitiveScopesFor(moduleType) {
|
|
|
24241
24603
|
},
|
|
24242
24604
|
};
|
|
24243
24605
|
maybeUnwrapFn(def.imports).forEach((imported) => {
|
|
24244
|
-
const importedType = imported;
|
|
24245
|
-
if (!isNgModule(importedType)) {
|
|
24246
|
-
throw new Error(`Importing ${importedType.name} which does not have a ɵmod property`);
|
|
24247
|
-
}
|
|
24248
24606
|
// When this module imports another, the imported module's exported directives and pipes are
|
|
24249
24607
|
// added to the compilation scope of this module.
|
|
24250
|
-
const importedScope = transitiveScopesFor(
|
|
24608
|
+
const importedScope = transitiveScopesFor(imported);
|
|
24251
24609
|
importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));
|
|
24252
24610
|
importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));
|
|
24253
24611
|
});
|
|
@@ -24390,19 +24748,35 @@ function compileComponent(type, metadata) {
|
|
|
24390
24748
|
preserveWhitespaces,
|
|
24391
24749
|
styles: metadata.styles || EMPTY_ARRAY,
|
|
24392
24750
|
animations: metadata.animations,
|
|
24393
|
-
|
|
24751
|
+
// JIT components are always compiled against an empty set of `declarations`. Instead, the
|
|
24752
|
+
// `directiveDefs` and `pipeDefs` are updated at a later point:
|
|
24753
|
+
// * for NgModule-based components, they're set when the NgModule which declares the
|
|
24754
|
+
// component resolves in the module scoping queue
|
|
24755
|
+
// * for standalone components, they're set just below, after `compileComponent`.
|
|
24756
|
+
declarations: [],
|
|
24394
24757
|
changeDetection: metadata.changeDetection,
|
|
24395
|
-
pipes: new Map(),
|
|
24396
24758
|
encapsulation,
|
|
24397
24759
|
interpolation: metadata.interpolation,
|
|
24398
24760
|
viewProviders: metadata.viewProviders || null,
|
|
24761
|
+
isStandalone: !!metadata.standalone,
|
|
24399
24762
|
};
|
|
24400
24763
|
compilationDepth++;
|
|
24401
24764
|
try {
|
|
24402
24765
|
if (meta.usesInheritance) {
|
|
24403
24766
|
addDirectiveDefToUndecoratedParents(type);
|
|
24404
24767
|
}
|
|
24405
|
-
ngComponentDef =
|
|
24768
|
+
ngComponentDef =
|
|
24769
|
+
compiler.compileComponent(angularCoreEnv, templateUrl, meta);
|
|
24770
|
+
if (metadata.standalone) {
|
|
24771
|
+
// Patch the component definition for standalone components with `directiveDefs` and
|
|
24772
|
+
// `pipeDefs` functions which lazily compute the directives/pipes available in the
|
|
24773
|
+
// standalone component. Also set `dependencies` to the lazily resolved list of imports.
|
|
24774
|
+
const imports = flatten(metadata.imports || EMPTY_ARRAY);
|
|
24775
|
+
const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);
|
|
24776
|
+
ngComponentDef.directiveDefs = directiveDefs;
|
|
24777
|
+
ngComponentDef.pipeDefs = pipeDefs;
|
|
24778
|
+
ngComponentDef.dependencies = () => imports.map(resolveForwardRef);
|
|
24779
|
+
}
|
|
24406
24780
|
}
|
|
24407
24781
|
finally {
|
|
24408
24782
|
// Ensure that the compilation depth is decremented even when the compilation failed.
|
|
@@ -24424,6 +24798,17 @@ function compileComponent(type, metadata) {
|
|
|
24424
24798
|
const scopes = transitiveScopesFor(type.ngSelectorScope);
|
|
24425
24799
|
patchComponentDefWithScope(ngComponentDef, scopes);
|
|
24426
24800
|
}
|
|
24801
|
+
if (metadata.schemas) {
|
|
24802
|
+
if (metadata.standalone) {
|
|
24803
|
+
ngComponentDef.schemas = metadata.schemas;
|
|
24804
|
+
}
|
|
24805
|
+
else {
|
|
24806
|
+
throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);
|
|
24807
|
+
}
|
|
24808
|
+
}
|
|
24809
|
+
else if (metadata.standalone) {
|
|
24810
|
+
ngComponentDef.schemas = [];
|
|
24811
|
+
}
|
|
24427
24812
|
}
|
|
24428
24813
|
return ngComponentDef;
|
|
24429
24814
|
},
|
|
@@ -24431,6 +24816,65 @@ function compileComponent(type, metadata) {
|
|
|
24431
24816
|
configurable: !!ngDevMode,
|
|
24432
24817
|
});
|
|
24433
24818
|
}
|
|
24819
|
+
/**
|
|
24820
|
+
* Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a
|
|
24821
|
+
* standalone component, which process `imports` and filter out directives and pipes. The use of
|
|
24822
|
+
* memoized functions here allows for the delayed resolution of any `forwardRef`s present in the
|
|
24823
|
+
* component's `imports`.
|
|
24824
|
+
*/
|
|
24825
|
+
function getStandaloneDefFunctions(type, imports) {
|
|
24826
|
+
let cachedDirectiveDefs = null;
|
|
24827
|
+
let cachedPipeDefs = null;
|
|
24828
|
+
const directiveDefs = () => {
|
|
24829
|
+
if (cachedDirectiveDefs === null) {
|
|
24830
|
+
// Standalone components are always able to self-reference, so include the component's own
|
|
24831
|
+
// definition in its `directiveDefs`.
|
|
24832
|
+
cachedDirectiveDefs = [getComponentDef(type)];
|
|
24833
|
+
for (const rawDep of imports) {
|
|
24834
|
+
const dep = resolveForwardRef(rawDep);
|
|
24835
|
+
if (!!getNgModuleDef(dep)) {
|
|
24836
|
+
const scope = transitiveScopesFor(dep);
|
|
24837
|
+
for (const dir of scope.exported.directives) {
|
|
24838
|
+
const def = getComponentDef(dir) || getDirectiveDef(dir);
|
|
24839
|
+
if (def) {
|
|
24840
|
+
cachedDirectiveDefs.push(def);
|
|
24841
|
+
}
|
|
24842
|
+
}
|
|
24843
|
+
}
|
|
24844
|
+
else {
|
|
24845
|
+
const def = getComponentDef(dep) || getDirectiveDef(dep);
|
|
24846
|
+
if (def) {
|
|
24847
|
+
cachedDirectiveDefs.push(def);
|
|
24848
|
+
}
|
|
24849
|
+
}
|
|
24850
|
+
}
|
|
24851
|
+
}
|
|
24852
|
+
return cachedDirectiveDefs;
|
|
24853
|
+
};
|
|
24854
|
+
const pipeDefs = () => {
|
|
24855
|
+
if (cachedPipeDefs === null) {
|
|
24856
|
+
cachedPipeDefs = [];
|
|
24857
|
+
for (const rawDep of imports) {
|
|
24858
|
+
const dep = resolveForwardRef(rawDep);
|
|
24859
|
+
if (!!getNgModuleDef(dep)) {
|
|
24860
|
+
const scope = transitiveScopesFor(dep);
|
|
24861
|
+
cachedPipeDefs.push(...Array.from(scope.exported.pipes).map(pipe => getPipeDef$1(pipe)));
|
|
24862
|
+
}
|
|
24863
|
+
else {
|
|
24864
|
+
const def = getPipeDef$1(dep);
|
|
24865
|
+
if (def) {
|
|
24866
|
+
cachedPipeDefs.push(def);
|
|
24867
|
+
}
|
|
24868
|
+
}
|
|
24869
|
+
}
|
|
24870
|
+
}
|
|
24871
|
+
return cachedPipeDefs;
|
|
24872
|
+
};
|
|
24873
|
+
return {
|
|
24874
|
+
directiveDefs,
|
|
24875
|
+
pipeDefs,
|
|
24876
|
+
};
|
|
24877
|
+
}
|
|
24434
24878
|
function hasSelectorScope(component) {
|
|
24435
24879
|
return component.ngSelectorScope !== undefined;
|
|
24436
24880
|
}
|
|
@@ -24519,9 +24963,7 @@ function directiveMetadata(type, metadata) {
|
|
|
24519
24963
|
exportAs: extractExportAs(metadata.exportAs),
|
|
24520
24964
|
providers: metadata.providers || null,
|
|
24521
24965
|
viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
|
|
24522
|
-
|
|
24523
|
-
// functionality is fully rolled out.
|
|
24524
|
-
isStandalone: false,
|
|
24966
|
+
isStandalone: !!metadata.standalone,
|
|
24525
24967
|
};
|
|
24526
24968
|
}
|
|
24527
24969
|
/**
|
|
@@ -24666,9 +25108,7 @@ function getPipeMetadata(type, meta) {
|
|
|
24666
25108
|
name: type.name,
|
|
24667
25109
|
pipeName: meta.name,
|
|
24668
25110
|
pure: meta.pure !== undefined ? meta.pure : true,
|
|
24669
|
-
|
|
24670
|
-
// functionality is fully rolled out.
|
|
24671
|
-
isStandalone: false,
|
|
25111
|
+
isStandalone: !!meta.standalone,
|
|
24672
25112
|
};
|
|
24673
25113
|
}
|
|
24674
25114
|
|
|
@@ -25027,7 +25467,10 @@ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
|
|
|
25027
25467
|
* A token that indicates an opaque platform ID.
|
|
25028
25468
|
* @publicApi
|
|
25029
25469
|
*/
|
|
25030
|
-
const PLATFORM_ID = new InjectionToken('Platform ID'
|
|
25470
|
+
const PLATFORM_ID = new InjectionToken('Platform ID', {
|
|
25471
|
+
providedIn: 'platform',
|
|
25472
|
+
factory: () => 'unknown', // set a default platform name, when none set explicitly
|
|
25473
|
+
});
|
|
25031
25474
|
/**
|
|
25032
25475
|
* A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
|
|
25033
25476
|
* be called for every component that is bootstrapped.
|
|
@@ -25074,9 +25517,10 @@ class Console {
|
|
|
25074
25517
|
}
|
|
25075
25518
|
}
|
|
25076
25519
|
Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
|
|
25077
|
-
Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac });
|
|
25520
|
+
Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });
|
|
25078
25521
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
|
|
25079
|
-
type: Injectable
|
|
25522
|
+
type: Injectable,
|
|
25523
|
+
args: [{ providedIn: 'platform' }]
|
|
25080
25524
|
}], null, null); })();
|
|
25081
25525
|
|
|
25082
25526
|
/**
|
|
@@ -26034,9 +26478,10 @@ class TestabilityRegistry {
|
|
|
26034
26478
|
}
|
|
26035
26479
|
}
|
|
26036
26480
|
TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
|
|
26037
|
-
TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac });
|
|
26481
|
+
TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });
|
|
26038
26482
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
|
|
26039
|
-
type: Injectable
|
|
26483
|
+
type: Injectable,
|
|
26484
|
+
args: [{ providedIn: 'platform' }]
|
|
26040
26485
|
}], function () { return []; }, null); })();
|
|
26041
26486
|
class _NoopGetTestability {
|
|
26042
26487
|
addToWindow(registry) { }
|
|
@@ -26060,7 +26505,20 @@ let _testabilityGetter = new _NoopGetTestability();
|
|
|
26060
26505
|
* Use of this source code is governed by an MIT-style license that can be
|
|
26061
26506
|
* found in the LICENSE file at https://angular.io/license
|
|
26062
26507
|
*/
|
|
26063
|
-
let
|
|
26508
|
+
let _platformInjector = null;
|
|
26509
|
+
/**
|
|
26510
|
+
* Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
|
|
26511
|
+
* one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
|
|
26512
|
+
*/
|
|
26513
|
+
const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
26514
|
+
/**
|
|
26515
|
+
* Internal token that allows to register extra callbacks that should be invoked during the
|
|
26516
|
+
* `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
|
|
26517
|
+
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26518
|
+
* entire class tree-shakeable.
|
|
26519
|
+
*/
|
|
26520
|
+
const PLATFORM_ON_DESTROY = new InjectionToken('PlatformOnDestroy');
|
|
26521
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26064
26522
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26065
26523
|
ngDevMode && assertNgModuleType(moduleType);
|
|
26066
26524
|
const moduleFactory = new NgModuleFactory(moduleType);
|
|
@@ -26105,7 +26563,6 @@ function publishDefaultGlobalUtils() {
|
|
|
26105
26563
|
function isBoundToModule(cf) {
|
|
26106
26564
|
return cf.isBoundToModule;
|
|
26107
26565
|
}
|
|
26108
|
-
const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
26109
26566
|
/**
|
|
26110
26567
|
* A token for third-party components that can register themselves with NgProbe.
|
|
26111
26568
|
*
|
|
@@ -26124,19 +26581,89 @@ class NgProbeToken {
|
|
|
26124
26581
|
* @publicApi
|
|
26125
26582
|
*/
|
|
26126
26583
|
function createPlatform(injector) {
|
|
26127
|
-
if (
|
|
26128
|
-
!_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26584
|
+
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26129
26585
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26130
26586
|
'There can be only one platform. Destroy the previous one to create a new one.' :
|
|
26131
26587
|
'';
|
|
26132
26588
|
throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
|
|
26133
26589
|
}
|
|
26134
26590
|
publishDefaultGlobalUtils();
|
|
26135
|
-
|
|
26591
|
+
_platformInjector = injector;
|
|
26592
|
+
const platform = injector.get(PlatformRef);
|
|
26593
|
+
runPlatformInitializers(injector);
|
|
26594
|
+
return platform;
|
|
26595
|
+
}
|
|
26596
|
+
/**
|
|
26597
|
+
* The goal of this function is to bootstrap a platform injector,
|
|
26598
|
+
* but avoid referencing `PlatformRef` class.
|
|
26599
|
+
* This function is needed for bootstrapping a Standalone Component.
|
|
26600
|
+
*/
|
|
26601
|
+
function createOrReusePlatformInjector(providers = []) {
|
|
26602
|
+
// If a platform injector already exists, it means that the platform
|
|
26603
|
+
// is already bootstrapped and no additional actions are required.
|
|
26604
|
+
if (_platformInjector)
|
|
26605
|
+
return _platformInjector;
|
|
26606
|
+
// Otherwise, setup a new platform injector and run platform initializers.
|
|
26607
|
+
const injector = createPlatformInjector(providers);
|
|
26608
|
+
_platformInjector = injector;
|
|
26609
|
+
publishDefaultGlobalUtils();
|
|
26610
|
+
runPlatformInitializers(injector);
|
|
26611
|
+
return injector;
|
|
26612
|
+
}
|
|
26613
|
+
function runPlatformInitializers(injector) {
|
|
26136
26614
|
const inits = injector.get(PLATFORM_INITIALIZER, null);
|
|
26137
|
-
if (inits)
|
|
26615
|
+
if (inits) {
|
|
26138
26616
|
inits.forEach((init) => init());
|
|
26139
|
-
|
|
26617
|
+
}
|
|
26618
|
+
}
|
|
26619
|
+
/**
|
|
26620
|
+
* Internal bootstrap application API that implements the core bootstrap logic.
|
|
26621
|
+
*
|
|
26622
|
+
* Platforms (such as `platform-browser`) may require different set of application and platform
|
|
26623
|
+
* providers for an application to function correctly. As a result, platforms may use this function
|
|
26624
|
+
* internally and supply the necessary providers during the bootstrap, while exposing
|
|
26625
|
+
* platform-specific APIs as a part of their public API.
|
|
26626
|
+
*
|
|
26627
|
+
* @returns A promise that returns an `ApplicationRef` instance once resolved.
|
|
26628
|
+
*/
|
|
26629
|
+
function bootstrapApplication(config) {
|
|
26630
|
+
const { rootComponent, appProviders, platformProviders } = config;
|
|
26631
|
+
NG_DEV_MODE && assertStandaloneComponentType(rootComponent);
|
|
26632
|
+
const platformInjector = createOrReusePlatformInjector(platformProviders);
|
|
26633
|
+
const ngZone = new NgZone(getNgZoneOptions());
|
|
26634
|
+
return ngZone.run(() => {
|
|
26635
|
+
// Create root application injector based on a set of providers configured at the platform
|
|
26636
|
+
// bootstrap level as well as providers passed to the bootstrap call by a user.
|
|
26637
|
+
const allAppProviders = [
|
|
26638
|
+
{ provide: NgZone, useValue: ngZone },
|
|
26639
|
+
...(appProviders || []), //
|
|
26640
|
+
];
|
|
26641
|
+
const appInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
|
|
26642
|
+
const exceptionHandler = appInjector.get(ErrorHandler, null);
|
|
26643
|
+
if (NG_DEV_MODE && !exceptionHandler) {
|
|
26644
|
+
throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, 'No `ErrorHandler` found in the Dependency Injection tree.');
|
|
26645
|
+
}
|
|
26646
|
+
let onErrorSubscription;
|
|
26647
|
+
ngZone.runOutsideAngular(() => {
|
|
26648
|
+
onErrorSubscription = ngZone.onError.subscribe({
|
|
26649
|
+
next: (error) => {
|
|
26650
|
+
exceptionHandler.handleError(error);
|
|
26651
|
+
}
|
|
26652
|
+
});
|
|
26653
|
+
});
|
|
26654
|
+
return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
|
|
26655
|
+
const initStatus = appInjector.get(ApplicationInitStatus);
|
|
26656
|
+
initStatus.runInitializers();
|
|
26657
|
+
return initStatus.donePromise.then(() => {
|
|
26658
|
+
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
26659
|
+
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
26660
|
+
const appRef = appInjector.get(ApplicationRef);
|
|
26661
|
+
appRef.onDestroy(() => onErrorSubscription.unsubscribe());
|
|
26662
|
+
appRef.bootstrap(rootComponent);
|
|
26663
|
+
return appRef;
|
|
26664
|
+
});
|
|
26665
|
+
});
|
|
26666
|
+
});
|
|
26140
26667
|
}
|
|
26141
26668
|
/**
|
|
26142
26669
|
* Creates a factory for a platform. Can be used to provide or override `Providers` specific to
|
|
@@ -26155,15 +26682,16 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
|
26155
26682
|
return (extraProviders = []) => {
|
|
26156
26683
|
let platform = getPlatform();
|
|
26157
26684
|
if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26685
|
+
const platformProviders = [
|
|
26686
|
+
...providers,
|
|
26687
|
+
...extraProviders,
|
|
26688
|
+
{ provide: marker, useValue: true }
|
|
26689
|
+
];
|
|
26158
26690
|
if (parentPlatformFactory) {
|
|
26159
|
-
parentPlatformFactory(
|
|
26691
|
+
parentPlatformFactory(platformProviders);
|
|
26160
26692
|
}
|
|
26161
26693
|
else {
|
|
26162
|
-
|
|
26163
|
-
provide: INJECTOR_SCOPE,
|
|
26164
|
-
useValue: 'platform'
|
|
26165
|
-
});
|
|
26166
|
-
createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
|
|
26694
|
+
createPlatform(createPlatformInjector(platformProviders, desc));
|
|
26167
26695
|
}
|
|
26168
26696
|
}
|
|
26169
26697
|
return assertPlatform(marker);
|
|
@@ -26186,6 +26714,20 @@ function assertPlatform(requiredToken) {
|
|
|
26186
26714
|
}
|
|
26187
26715
|
return platform;
|
|
26188
26716
|
}
|
|
26717
|
+
/**
|
|
26718
|
+
* Helper function to create an instance of a platform injector (that maintains the 'platform'
|
|
26719
|
+
* scope).
|
|
26720
|
+
*/
|
|
26721
|
+
function createPlatformInjector(providers = [], name) {
|
|
26722
|
+
return Injector.create({
|
|
26723
|
+
name,
|
|
26724
|
+
providers: [
|
|
26725
|
+
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
26726
|
+
{ provide: PLATFORM_ON_DESTROY, useValue: () => _platformInjector = null },
|
|
26727
|
+
...providers
|
|
26728
|
+
],
|
|
26729
|
+
});
|
|
26730
|
+
}
|
|
26189
26731
|
/**
|
|
26190
26732
|
* Destroys the current Angular platform and all Angular applications on the page.
|
|
26191
26733
|
* Destroys all modules and listeners registered with the platform.
|
|
@@ -26193,9 +26735,7 @@ function assertPlatform(requiredToken) {
|
|
|
26193
26735
|
* @publicApi
|
|
26194
26736
|
*/
|
|
26195
26737
|
function destroyPlatform() {
|
|
26196
|
-
|
|
26197
|
-
_platform.destroy();
|
|
26198
|
-
}
|
|
26738
|
+
getPlatform()?.destroy();
|
|
26199
26739
|
}
|
|
26200
26740
|
/**
|
|
26201
26741
|
* Returns the current platform.
|
|
@@ -26203,7 +26743,7 @@ function destroyPlatform() {
|
|
|
26203
26743
|
* @publicApi
|
|
26204
26744
|
*/
|
|
26205
26745
|
function getPlatform() {
|
|
26206
|
-
return
|
|
26746
|
+
return _platformInjector?.get(PlatformRef) ?? null;
|
|
26207
26747
|
}
|
|
26208
26748
|
/**
|
|
26209
26749
|
* The Angular platform is the entry point for Angular on a web page.
|
|
@@ -26233,10 +26773,7 @@ class PlatformRef {
|
|
|
26233
26773
|
// as instantiating the module creates some providers eagerly.
|
|
26234
26774
|
// So we create a mini parent injector that just contains the new NgZone and
|
|
26235
26775
|
// pass that as parent to the NgModuleFactory.
|
|
26236
|
-
const
|
|
26237
|
-
const ngZoneEventCoalescing = (options && options.ngZoneEventCoalescing) || false;
|
|
26238
|
-
const ngZoneRunCoalescing = (options && options.ngZoneRunCoalescing) || false;
|
|
26239
|
-
const ngZone = getNgZone(ngZoneOption, { ngZoneEventCoalescing, ngZoneRunCoalescing });
|
|
26776
|
+
const ngZone = getNgZone(options?.ngZone, getNgZoneOptions(options));
|
|
26240
26777
|
const providers = [{ provide: NgZone, useValue: ngZone }];
|
|
26241
26778
|
// Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
|
|
26242
26779
|
// created within the Angular zone
|
|
@@ -26337,32 +26874,44 @@ class PlatformRef {
|
|
|
26337
26874
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26338
26875
|
'The platform has already been destroyed!' :
|
|
26339
26876
|
'';
|
|
26340
|
-
throw new RuntimeError(404 /*
|
|
26877
|
+
throw new RuntimeError(404 /* PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
26341
26878
|
}
|
|
26342
26879
|
this._modules.slice().forEach(module => module.destroy());
|
|
26343
26880
|
this._destroyListeners.forEach(listener => listener());
|
|
26881
|
+
const destroyListener = this._injector.get(PLATFORM_ON_DESTROY, null);
|
|
26882
|
+
destroyListener?.();
|
|
26344
26883
|
this._destroyed = true;
|
|
26345
26884
|
}
|
|
26885
|
+
/**
|
|
26886
|
+
* Indicates whether this instance was destroyed.
|
|
26887
|
+
*/
|
|
26346
26888
|
get destroyed() {
|
|
26347
26889
|
return this._destroyed;
|
|
26348
26890
|
}
|
|
26349
26891
|
}
|
|
26350
26892
|
PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
|
|
26351
|
-
PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac });
|
|
26893
|
+
PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' });
|
|
26352
26894
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
|
|
26353
|
-
type: Injectable
|
|
26895
|
+
type: Injectable,
|
|
26896
|
+
args: [{ providedIn: 'platform' }]
|
|
26354
26897
|
}], function () { return [{ type: Injector }]; }, null); })();
|
|
26355
|
-
|
|
26898
|
+
// Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
|
|
26899
|
+
// `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
|
|
26900
|
+
// a set of default options returned.
|
|
26901
|
+
function getNgZoneOptions(options) {
|
|
26902
|
+
return {
|
|
26903
|
+
enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
|
|
26904
|
+
shouldCoalesceEventChangeDetection: !!(options && options.ngZoneEventCoalescing) || false,
|
|
26905
|
+
shouldCoalesceRunChangeDetection: !!(options && options.ngZoneRunCoalescing) || false,
|
|
26906
|
+
};
|
|
26907
|
+
}
|
|
26908
|
+
function getNgZone(ngZoneToUse, options) {
|
|
26356
26909
|
let ngZone;
|
|
26357
|
-
if (
|
|
26910
|
+
if (ngZoneToUse === 'noop') {
|
|
26358
26911
|
ngZone = new NoopNgZone();
|
|
26359
26912
|
}
|
|
26360
26913
|
else {
|
|
26361
|
-
ngZone = (
|
|
26362
|
-
enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
|
|
26363
|
-
shouldCoalesceEventChangeDetection: !!extra?.ngZoneEventCoalescing,
|
|
26364
|
-
shouldCoalesceRunChangeDetection: !!extra?.ngZoneRunCoalescing
|
|
26365
|
-
});
|
|
26914
|
+
ngZone = (ngZoneToUse === 'zone.js' ? undefined : ngZoneToUse) || new NgZone(options);
|
|
26366
26915
|
}
|
|
26367
26916
|
return ngZone;
|
|
26368
26917
|
}
|
|
@@ -26488,17 +27037,18 @@ function optionsReducer(dst, objs) {
|
|
|
26488
27037
|
*/
|
|
26489
27038
|
class ApplicationRef {
|
|
26490
27039
|
/** @internal */
|
|
26491
|
-
constructor(_zone, _injector, _exceptionHandler,
|
|
27040
|
+
constructor(_zone, _injector, _exceptionHandler, _initStatus) {
|
|
26492
27041
|
this._zone = _zone;
|
|
26493
27042
|
this._injector = _injector;
|
|
26494
27043
|
this._exceptionHandler = _exceptionHandler;
|
|
26495
|
-
this._componentFactoryResolver = _componentFactoryResolver;
|
|
26496
27044
|
this._initStatus = _initStatus;
|
|
26497
27045
|
/** @internal */
|
|
26498
27046
|
this._bootstrapListeners = [];
|
|
26499
27047
|
this._views = [];
|
|
26500
27048
|
this._runningTick = false;
|
|
26501
27049
|
this._stable = true;
|
|
27050
|
+
this._destroyed = false;
|
|
27051
|
+
this._destroyListeners = [];
|
|
26502
27052
|
/**
|
|
26503
27053
|
* Get a list of component types registered to this application.
|
|
26504
27054
|
* This list is populated even before the component is created.
|
|
@@ -26558,6 +27108,12 @@ class ApplicationRef {
|
|
|
26558
27108
|
this.isStable =
|
|
26559
27109
|
merge$1(isCurrentlyStable, isStable.pipe(share()));
|
|
26560
27110
|
}
|
|
27111
|
+
/**
|
|
27112
|
+
* Indicates whether this instance was destroyed.
|
|
27113
|
+
*/
|
|
27114
|
+
get destroyed() {
|
|
27115
|
+
return this._destroyed;
|
|
27116
|
+
}
|
|
26561
27117
|
/**
|
|
26562
27118
|
* Bootstrap a component onto the element identified by its selector or, optionally, to a
|
|
26563
27119
|
* specified element.
|
|
@@ -26596,20 +27152,22 @@ class ApplicationRef {
|
|
|
26596
27152
|
* {@example core/ts/platform/platform.ts region='domNode'}
|
|
26597
27153
|
*/
|
|
26598
27154
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27155
|
+
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27156
|
+
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
26599
27157
|
if (!this._initStatus.done) {
|
|
26600
|
-
const
|
|
26601
|
-
|
|
26602
|
-
|
|
26603
|
-
|
|
26604
|
-
throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
|
|
27158
|
+
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27159
|
+
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27160
|
+
(standalone ? '' :
|
|
27161
|
+
' Bootstrap components in the `ngDoBootstrap` method of the root module.');
|
|
27162
|
+
throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, NG_DEV_MODE && errorMessage);
|
|
26605
27163
|
}
|
|
26606
27164
|
let componentFactory;
|
|
26607
|
-
if (
|
|
27165
|
+
if (isComponentFactory) {
|
|
26608
27166
|
componentFactory = componentOrFactory;
|
|
26609
27167
|
}
|
|
26610
27168
|
else {
|
|
26611
|
-
|
|
26612
|
-
|
|
27169
|
+
const resolver = this._injector.get(ComponentFactoryResolver$1);
|
|
27170
|
+
componentFactory = resolver.resolveComponentFactory(componentOrFactory);
|
|
26613
27171
|
}
|
|
26614
27172
|
this.componentTypes.push(componentFactory.componentType);
|
|
26615
27173
|
// Create a factory associated with the current module if it's not bound to some other
|
|
@@ -26647,6 +27205,7 @@ class ApplicationRef {
|
|
|
26647
27205
|
* detection pass during which all change detection must complete.
|
|
26648
27206
|
*/
|
|
26649
27207
|
tick() {
|
|
27208
|
+
NG_DEV_MODE && this.warnIfDestroyed();
|
|
26650
27209
|
if (this._runningTick) {
|
|
26651
27210
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26652
27211
|
'ApplicationRef.tick is called recursively' :
|
|
@@ -26678,6 +27237,7 @@ class ApplicationRef {
|
|
|
26678
27237
|
* This will throw if the view is already attached to a ViewContainer.
|
|
26679
27238
|
*/
|
|
26680
27239
|
attachView(viewRef) {
|
|
27240
|
+
NG_DEV_MODE && this.warnIfDestroyed();
|
|
26681
27241
|
const view = viewRef;
|
|
26682
27242
|
this._views.push(view);
|
|
26683
27243
|
view.attachToAppRef(this);
|
|
@@ -26686,6 +27246,7 @@ class ApplicationRef {
|
|
|
26686
27246
|
* Detaches a view from dirty checking again.
|
|
26687
27247
|
*/
|
|
26688
27248
|
detachView(viewRef) {
|
|
27249
|
+
NG_DEV_MODE && this.warnIfDestroyed();
|
|
26689
27250
|
const view = viewRef;
|
|
26690
27251
|
remove(this._views, view);
|
|
26691
27252
|
view.detachFromAppRef();
|
|
@@ -26700,8 +27261,48 @@ class ApplicationRef {
|
|
|
26700
27261
|
}
|
|
26701
27262
|
/** @internal */
|
|
26702
27263
|
ngOnDestroy() {
|
|
26703
|
-
this.
|
|
26704
|
-
|
|
27264
|
+
if (this._destroyed)
|
|
27265
|
+
return;
|
|
27266
|
+
try {
|
|
27267
|
+
// Call all the lifecycle hooks.
|
|
27268
|
+
this._destroyListeners.forEach(listener => listener());
|
|
27269
|
+
// Destroy all registered views.
|
|
27270
|
+
this._views.slice().forEach((view) => view.destroy());
|
|
27271
|
+
this._onMicrotaskEmptySubscription.unsubscribe();
|
|
27272
|
+
}
|
|
27273
|
+
finally {
|
|
27274
|
+
// Indicate that this instance is destroyed.
|
|
27275
|
+
this._destroyed = true;
|
|
27276
|
+
// Release all references.
|
|
27277
|
+
this._views = [];
|
|
27278
|
+
this._bootstrapListeners = [];
|
|
27279
|
+
this._destroyListeners = [];
|
|
27280
|
+
}
|
|
27281
|
+
}
|
|
27282
|
+
/**
|
|
27283
|
+
* Registers a listener to be called when an instance is destroyed.
|
|
27284
|
+
*
|
|
27285
|
+
* @param callback A callback function to add as a listener.
|
|
27286
|
+
* @returns A function which unregisters a listener.
|
|
27287
|
+
*
|
|
27288
|
+
* @internal
|
|
27289
|
+
*/
|
|
27290
|
+
onDestroy(callback) {
|
|
27291
|
+
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27292
|
+
this._destroyListeners.push(callback);
|
|
27293
|
+
return () => remove(this._destroyListeners, callback);
|
|
27294
|
+
}
|
|
27295
|
+
destroy() {
|
|
27296
|
+
if (this._destroyed) {
|
|
27297
|
+
throw new RuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27298
|
+
}
|
|
27299
|
+
const injector = this._injector;
|
|
27300
|
+
// Check that this injector instance supports destroy operation.
|
|
27301
|
+
if (injector.destroy && !injector.destroyed) {
|
|
27302
|
+
// Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
|
|
27303
|
+
// hook, which invokes the remaining cleanup actions.
|
|
27304
|
+
injector.destroy();
|
|
27305
|
+
}
|
|
26705
27306
|
}
|
|
26706
27307
|
/**
|
|
26707
27308
|
* Returns the number of attached views.
|
|
@@ -26709,13 +27310,18 @@ class ApplicationRef {
|
|
|
26709
27310
|
get viewCount() {
|
|
26710
27311
|
return this._views.length;
|
|
26711
27312
|
}
|
|
27313
|
+
warnIfDestroyed() {
|
|
27314
|
+
if (NG_DEV_MODE && this._destroyed) {
|
|
27315
|
+
console.warn(formatRuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
27316
|
+
}
|
|
27317
|
+
}
|
|
26712
27318
|
}
|
|
26713
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(
|
|
27319
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
|
|
26714
27320
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
26715
27321
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
26716
27322
|
type: Injectable,
|
|
26717
27323
|
args: [{ providedIn: 'root' }]
|
|
26718
|
-
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type:
|
|
27324
|
+
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null); })();
|
|
26719
27325
|
function remove(list, el) {
|
|
26720
27326
|
const index = list.indexOf(el);
|
|
26721
27327
|
if (index > -1) {
|
|
@@ -28698,19 +29304,12 @@ const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
|
|
|
28698
29304
|
* Use of this source code is governed by an MIT-style license that can be
|
|
28699
29305
|
* found in the LICENSE file at https://angular.io/license
|
|
28700
29306
|
*/
|
|
28701
|
-
const _CORE_PLATFORM_PROVIDERS = [
|
|
28702
|
-
// Set a default platform name for platforms that don't set it explicitly.
|
|
28703
|
-
{ provide: PLATFORM_ID, useValue: 'unknown' },
|
|
28704
|
-
{ provide: PlatformRef, deps: [Injector] },
|
|
28705
|
-
{ provide: TestabilityRegistry, deps: [] },
|
|
28706
|
-
{ provide: Console, deps: [] },
|
|
28707
|
-
];
|
|
28708
29307
|
/**
|
|
28709
29308
|
* This platform has to be included in any other platform
|
|
28710
29309
|
*
|
|
28711
29310
|
* @publicApi
|
|
28712
29311
|
*/
|
|
28713
|
-
const platformCore = createPlatformFactory(null, 'core',
|
|
29312
|
+
const platformCore = createPlatformFactory(null, 'core', []);
|
|
28714
29313
|
|
|
28715
29314
|
/**
|
|
28716
29315
|
* @license
|
|
@@ -28906,5 +29505,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
|
28906
29505
|
* Generated bundle index. Do not edit.
|
|
28907
29506
|
*/
|
|
28908
29507
|
|
|
28909
|
-
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 };
|
|
29508
|
+
export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, INJECTOR_INITIALIZER, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bootstrapApplication as ɵbootstrapApplication, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderComponent as ɵrenderComponent, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
|
|
28910
29509
|
//# sourceMappingURL=core.mjs.map
|