@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.
Files changed (68) hide show
  1. package/esm2020/src/application_ref.mjs +212 -50
  2. package/esm2020/src/application_tokens.mjs +5 -2
  3. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  4. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +2 -2
  5. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +2 -2
  6. package/esm2020/src/compiler/compiler_facade_interface.mjs +7 -1
  7. package/esm2020/src/console.mjs +4 -3
  8. package/esm2020/src/core.mjs +2 -2
  9. package/esm2020/src/core_private_export.mjs +4 -3
  10. package/esm2020/src/core_render3_private_export.mjs +4 -3
  11. package/esm2020/src/di/create_injector.mjs +36 -0
  12. package/esm2020/src/di/index.mjs +4 -1
  13. package/esm2020/src/di/initializer_token.mjs +16 -0
  14. package/esm2020/src/di/injection_token.mjs +7 -1
  15. package/esm2020/src/di/injector.mjs +2 -2
  16. package/esm2020/src/di/injector_compatibility.mjs +1 -3
  17. package/esm2020/src/di/interface/defs.mjs +1 -1
  18. package/esm2020/src/di/interface/provider.mjs +1 -1
  19. package/esm2020/src/di/internal_tokens.mjs +10 -0
  20. package/esm2020/src/di/provider_collection.mjs +209 -0
  21. package/esm2020/src/di/r3_injector.mjs +66 -153
  22. package/esm2020/src/di/scope.mjs +1 -1
  23. package/esm2020/src/errors.mjs +1 -1
  24. package/esm2020/src/linker/component_factory.mjs +1 -1
  25. package/esm2020/src/linker/ng_module_factory.mjs +1 -1
  26. package/esm2020/src/linker/view_container_ref.mjs +12 -9
  27. package/esm2020/src/metadata/directives.mjs +1 -1
  28. package/esm2020/src/metadata/ng_module.mjs +1 -1
  29. package/esm2020/src/metadata.mjs +1 -1
  30. package/esm2020/src/platform_core_providers.mjs +3 -14
  31. package/esm2020/src/render3/bindings.mjs +2 -2
  32. package/esm2020/src/render3/component_ref.mjs +12 -4
  33. package/esm2020/src/render3/definition.mjs +16 -20
  34. package/esm2020/src/render3/di_setup.mjs +3 -2
  35. package/esm2020/src/render3/errors.mjs +21 -3
  36. package/esm2020/src/render3/errors_di.mjs +1 -1
  37. package/esm2020/src/render3/features/inherit_definition_feature.mjs +3 -2
  38. package/esm2020/src/render3/features/standalone_feature.mjs +69 -0
  39. package/esm2020/src/render3/index.mjs +4 -3
  40. package/esm2020/src/render3/instructions/shared.mjs +6 -3
  41. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  42. package/esm2020/src/render3/interfaces/public_definitions.mjs +1 -1
  43. package/esm2020/src/render3/jit/directive.mjs +93 -8
  44. package/esm2020/src/render3/jit/environment.mjs +2 -1
  45. package/esm2020/src/render3/jit/module.mjs +64 -17
  46. package/esm2020/src/render3/jit/pipe.mjs +2 -4
  47. package/esm2020/src/render3/ng_module_ref.mjs +34 -4
  48. package/esm2020/src/testability/testability.mjs +4 -3
  49. package/esm2020/src/util/global.mjs +8 -8
  50. package/esm2020/src/version.mjs +1 -1
  51. package/esm2020/testing/src/logger.mjs +3 -3
  52. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  53. package/esm2020/testing/src/r3_test_bed.mjs +5 -8
  54. package/esm2020/testing/src/test_bed.mjs +1 -1
  55. package/esm2020/testing/src/test_bed_common.mjs +1 -1
  56. package/fesm2015/core.mjs +1009 -407
  57. package/fesm2015/core.mjs.map +1 -1
  58. package/fesm2015/testing.mjs +5 -8
  59. package/fesm2015/testing.mjs.map +1 -1
  60. package/fesm2020/core.mjs +1007 -408
  61. package/fesm2020/core.mjs.map +1 -1
  62. package/fesm2020/testing.mjs +5 -8
  63. package/fesm2020/testing.mjs.map +1 -1
  64. package/{core.d.ts → index.d.ts} +14716 -14613
  65. package/package.json +4 -4
  66. package/testing/{testing.d.ts → index.d.ts} +537 -577
  67. package/esm2020/src/change_detection/change_detection_util.mjs +0 -64
  68. package/testing/package.json +0 -9
package/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.12
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
- const _global = __globalThis || __global || __window || __self;
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 directiveTypes = componentDefinition.directives;
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 = directiveTypes ?
929
- () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)
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 = pipeTypes ?
933
- () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) :
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(extractPipeDef);
954
+ def.pipeDefs = () => pipes.map(getPipeDef$1);
951
955
  }
952
956
  function extractDirectiveDef(type) {
953
- const def = getComponentDef(type) || getDirectiveDef(type);
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 extractPipeDef(type) {
960
- const def = getPipeDef$1(type);
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
  /**
@@ -4008,6 +4004,12 @@ class InjectionToken {
4008
4004
  });
4009
4005
  }
4010
4006
  }
4007
+ /**
4008
+ * @internal
4009
+ */
4010
+ get multi() {
4011
+ return this;
4012
+ }
4011
4013
  toString() {
4012
4014
  return `InjectionToken ${this._desc}`;
4013
4015
  }
@@ -4120,6 +4122,12 @@ var FactoryTarget;
4120
4122
  FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe";
4121
4123
  FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule";
4122
4124
  })(FactoryTarget || (FactoryTarget = {}));
4125
+ var R3TemplateDependencyKind;
4126
+ (function (R3TemplateDependencyKind) {
4127
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
4128
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
4129
+ R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
4130
+ })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
4123
4131
  var ViewEncapsulation;
4124
4132
  (function (ViewEncapsulation) {
4125
4133
  ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated";
@@ -4801,7 +4809,6 @@ const NG_TOKEN_PATH = 'ngTokenPath';
4801
4809
  const NEW_LINE = /\n/gm;
4802
4810
  const NO_NEW_LINE = 'ɵ';
4803
4811
  const SOURCE = '__source';
4804
- const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: getClosureSafeProperty });
4805
4812
  /**
4806
4813
  * Current injector value used by `inject`.
4807
4814
  * - `undefined`: it is an error to call `inject`
@@ -6906,9 +6913,25 @@ function maybeUnwrapFn(value) {
6906
6913
  * Use of this source code is governed by an MIT-style license that can be
6907
6914
  * found in the LICENSE file at https://angular.io/license
6908
6915
  */
6916
+ /** Verifies that a given type is a Standalone Component. */
6917
+ function assertStandaloneComponentType(type) {
6918
+ const componentDef = getComponentDef(type);
6919
+ if (!componentDef) {
6920
+ throw new RuntimeError(906 /* MISSING_GENERATED_DEF */, `The ${stringifyForError(type)} is not an Angular component, ` +
6921
+ `make sure it has the \`@Component\` decorator.`);
6922
+ }
6923
+ if (!componentDef.standalone) {
6924
+ throw new RuntimeError(907 /* TYPE_IS_NOT_STANDALONE */, `The ${stringifyForError(type)} component is not marked as standalone, ` +
6925
+ `but Angular expects to have a standalone component here. ` +
6926
+ `Please make sure the ${stringifyForError(type)} component has ` +
6927
+ `the \`standalone: true\` flag in the decorator.`);
6928
+ }
6929
+ }
6909
6930
  /** Called when there are multiple component selectors that match a given node */
6910
- function throwMultipleComponentError(tNode) {
6911
- throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6931
+ function throwMultipleComponentError(tNode, first, second) {
6932
+ throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}: ` +
6933
+ `${stringifyForError(first)} and ` +
6934
+ `${stringifyForError(second)}`);
6912
6935
  }
6913
6936
  /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
6914
6937
  function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
@@ -10583,8 +10606,11 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
10583
10606
  if (ngDevMode) {
10584
10607
  assertTNodeType(tNode, 2 /* Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
10585
10608
  `Please use a different tag to activate the ${stringify(def.type)} component.`);
10586
- if (tNode.flags & 2 /* isComponentHost */)
10587
- throwMultipleComponentError(tNode);
10609
+ if (tNode.flags & 2 /* isComponentHost */) {
10610
+ // If another component has been matched previously, it's the first element in the
10611
+ // `matches` array, see how we store components/directives in `matches` below.
10612
+ throwMultipleComponentError(tNode, matches[0].type, def.type);
10613
+ }
10588
10614
  }
10589
10615
  markAsComponentHost(tView, tNode);
10590
10616
  // The component is always stored first with directives after.
@@ -11315,6 +11341,235 @@ function tick(component) {
11315
11341
  tickRootContext(rootContext);
11316
11342
  }
11317
11343
 
11344
+ /**
11345
+ * @license
11346
+ * Copyright Google LLC All Rights Reserved.
11347
+ *
11348
+ * Use of this source code is governed by an MIT-style license that can be
11349
+ * found in the LICENSE file at https://angular.io/license
11350
+ */
11351
+
11352
+ /**
11353
+ * @license
11354
+ * Copyright Google LLC All Rights Reserved.
11355
+ *
11356
+ * Use of this source code is governed by an MIT-style license that can be
11357
+ * found in the LICENSE file at https://angular.io/license
11358
+ */
11359
+ /**
11360
+ * A multi-provider token for initialization functions that will run upon construction of a
11361
+ * non-view injector.
11362
+ *
11363
+ * @publicApi
11364
+ */
11365
+ const INJECTOR_INITIALIZER = new InjectionToken('INJECTOR_INITIALIZER');
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
+ const INJECTOR_DEF_TYPES = new InjectionToken('INJECTOR_DEF_TYPES');
11375
+
11376
+ /**
11377
+ * @license
11378
+ * Copyright Google LLC All Rights Reserved.
11379
+ *
11380
+ * Use of this source code is governed by an MIT-style license that can be
11381
+ * found in the LICENSE file at https://angular.io/license
11382
+ */
11383
+ /**
11384
+ * Collects providers from all NgModules and standalone components, including transitively imported
11385
+ * ones.
11386
+ *
11387
+ * @returns The list of collected providers from the specified list of types.
11388
+ * @publicApi
11389
+ */
11390
+ function importProvidersFrom(...sources) {
11391
+ const providersOut = [];
11392
+ const dedup = new Set(); // already seen types
11393
+ let injectorTypesWithProviders;
11394
+ deepForEach(sources, source => {
11395
+ // Narrow `source` to access the internal type analogue for `ModuleWithProviders`.
11396
+ const internalSource = source;
11397
+ if (walkProviderTree(internalSource, providersOut, [], dedup)) {
11398
+ injectorTypesWithProviders || (injectorTypesWithProviders = []);
11399
+ injectorTypesWithProviders.push(internalSource);
11400
+ }
11401
+ });
11402
+ // Collect all providers from `ModuleWithProviders` types.
11403
+ if (injectorTypesWithProviders !== undefined) {
11404
+ processInjectorTypesWithProviders(injectorTypesWithProviders, providersOut);
11405
+ }
11406
+ return providersOut;
11407
+ }
11408
+ /**
11409
+ * Collects all providers from the list of `ModuleWithProviders` and appends them to the provided
11410
+ * array.
11411
+ */
11412
+ function processInjectorTypesWithProviders(typesWithProviders, providersOut) {
11413
+ for (let i = 0; i < typesWithProviders.length; i++) {
11414
+ const { ngModule, providers } = typesWithProviders[i];
11415
+ deepForEach(providers, provider => {
11416
+ ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);
11417
+ providersOut.push(provider);
11418
+ });
11419
+ }
11420
+ }
11421
+ /**
11422
+ * The logic visits an `InjectorType`, an `InjectorTypeWithProviders`, or a standalone
11423
+ * `ComponentType`, and all of its transitive providers and collects providers.
11424
+ *
11425
+ * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,
11426
+ * the function will return "true" to indicate that the providers of the type definition need
11427
+ * to be processed. This allows us to process providers of injector types after all imports of
11428
+ * an injector definition are processed. (following View Engine semantics: see FW-1349)
11429
+ */
11430
+ function walkProviderTree(container, providersOut, parents, dedup) {
11431
+ container = resolveForwardRef(container);
11432
+ if (!container)
11433
+ return false;
11434
+ // The actual type which had the definition. Usually `container`, but may be an unwrapped type
11435
+ // from `InjectorTypeWithProviders`.
11436
+ let defType = null;
11437
+ let injDef = getInjectorDef(container);
11438
+ const cmpDef = !injDef && getComponentDef(container);
11439
+ if (!injDef && !cmpDef) {
11440
+ // `container` is not an injector type or a component type. It might be:
11441
+ // * An `InjectorTypeWithProviders` that wraps an injector type.
11442
+ // * A standalone directive or pipe that got pulled in from a standalone component's
11443
+ // dependencies.
11444
+ // Try to unwrap it as an `InjectorTypeWithProviders` first.
11445
+ const ngModule = container.ngModule;
11446
+ injDef = getInjectorDef(ngModule);
11447
+ if (injDef) {
11448
+ defType = ngModule;
11449
+ }
11450
+ else {
11451
+ // Not a component or injector type, so ignore it.
11452
+ return false;
11453
+ }
11454
+ }
11455
+ else if (cmpDef && !cmpDef.standalone) {
11456
+ return false;
11457
+ }
11458
+ else {
11459
+ defType = container;
11460
+ }
11461
+ // Check for circular dependencies.
11462
+ if (ngDevMode && parents.indexOf(defType) !== -1) {
11463
+ const defName = stringify(defType);
11464
+ const path = parents.map(stringify);
11465
+ throwCyclicDependencyError(defName, path);
11466
+ }
11467
+ // Check for multiple imports of the same module
11468
+ const isDuplicate = dedup.has(defType);
11469
+ if (cmpDef) {
11470
+ if (isDuplicate) {
11471
+ // This component definition has already been processed.
11472
+ return false;
11473
+ }
11474
+ dedup.add(defType);
11475
+ if (cmpDef.dependencies) {
11476
+ const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;
11477
+ for (const dep of deps) {
11478
+ walkProviderTree(dep, providersOut, parents, dedup);
11479
+ }
11480
+ }
11481
+ }
11482
+ else if (injDef) {
11483
+ // First, include providers from any imports.
11484
+ if (injDef.imports != null && !isDuplicate) {
11485
+ // Before processing defType's imports, add it to the set of parents. This way, if it ends
11486
+ // up deeply importing itself, this can be detected.
11487
+ ngDevMode && parents.push(defType);
11488
+ // Add it to the set of dedups. This way we can detect multiple imports of the same module
11489
+ dedup.add(defType);
11490
+ let importTypesWithProviders;
11491
+ try {
11492
+ deepForEach(injDef.imports, imported => {
11493
+ if (walkProviderTree(imported, providersOut, parents, dedup)) {
11494
+ importTypesWithProviders || (importTypesWithProviders = []);
11495
+ // If the processed import is an injector type with providers, we store it in the
11496
+ // list of import types with providers, so that we can process those afterwards.
11497
+ importTypesWithProviders.push(imported);
11498
+ }
11499
+ });
11500
+ }
11501
+ finally {
11502
+ // Remove it from the parents set when finished.
11503
+ ngDevMode && parents.pop();
11504
+ }
11505
+ // Imports which are declared with providers (TypeWithProviders) need to be processed
11506
+ // after all imported modules are processed. This is similar to how View Engine
11507
+ // processes/merges module imports in the metadata resolver. See: FW-1349.
11508
+ if (importTypesWithProviders !== undefined) {
11509
+ processInjectorTypesWithProviders(importTypesWithProviders, providersOut);
11510
+ }
11511
+ }
11512
+ if (!isDuplicate) {
11513
+ // Track the InjectorType and add a provider for it.
11514
+ // It's important that this is done after the def's imports.
11515
+ const factory = getFactoryDef(defType) || (() => new defType());
11516
+ // Append extra providers to make more info available for consumers (to retrieve an injector
11517
+ // type), as well as internally (to calculate an injection scope correctly and eagerly
11518
+ // instantiate a `defType` when an injector is created).
11519
+ providersOut.push(
11520
+ // Provider to create `defType` using its factory.
11521
+ { provide: defType, useFactory: factory, deps: EMPTY_ARRAY },
11522
+ // Make this `defType` available to an internal logic that calculates injector scope.
11523
+ { provide: INJECTOR_DEF_TYPES, useValue: defType, multi: true },
11524
+ // Provider to eagerly instantiate `defType` via `INJECTOR_INITIALIZER`.
11525
+ { provide: INJECTOR_INITIALIZER, useValue: () => ɵɵinject(defType), multi: true } //
11526
+ );
11527
+ }
11528
+ // Next, include providers listed on the definition itself.
11529
+ const defProviders = injDef.providers;
11530
+ if (defProviders != null && !isDuplicate) {
11531
+ const injectorType = container;
11532
+ deepForEach(defProviders, provider => {
11533
+ ngDevMode && validateProvider(provider, defProviders, injectorType);
11534
+ providersOut.push(provider);
11535
+ });
11536
+ }
11537
+ }
11538
+ else {
11539
+ // Should not happen, but just in case.
11540
+ return false;
11541
+ }
11542
+ return (defType !== container &&
11543
+ container.providers !== undefined);
11544
+ }
11545
+ function validateProvider(provider, providers, containerType) {
11546
+ if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) ||
11547
+ isExistingProvider(provider)) {
11548
+ return;
11549
+ }
11550
+ // Here we expect the provider to be a `useClass` provider (by elimination).
11551
+ const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));
11552
+ if (!classRef) {
11553
+ throwInvalidProviderError(containerType, providers, provider);
11554
+ }
11555
+ }
11556
+ const USE_VALUE$1 = getClosureSafeProperty({ provide: String, useValue: getClosureSafeProperty });
11557
+ function isValueProvider(value) {
11558
+ return value !== null && typeof value == 'object' && USE_VALUE$1 in value;
11559
+ }
11560
+ function isExistingProvider(value) {
11561
+ return !!(value && value.useExisting);
11562
+ }
11563
+ function isFactoryProvider(value) {
11564
+ return !!(value && value.useFactory);
11565
+ }
11566
+ function isTypeProvider(value) {
11567
+ return typeof value === 'function';
11568
+ }
11569
+ function isClassProvider(value) {
11570
+ return !!value.useClass;
11571
+ }
11572
+
11318
11573
  /**
11319
11574
  * @license
11320
11575
  * Copyright Google LLC All Rights Reserved.
@@ -11397,56 +11652,47 @@ function getNullInjector() {
11397
11652
  return NULL_INJECTOR$1;
11398
11653
  }
11399
11654
  /**
11400
- * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
11401
- *
11402
- * @publicApi
11403
- */
11404
- function createInjector(defType, parent = null, additionalProviders = null, name) {
11405
- const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
11406
- injector._resolveInjectorDefTypes();
11407
- return injector;
11408
- }
11409
- /**
11410
- * Creates a new injector without eagerly resolving its injector types. Can be used in places
11411
- * where resolving the injector types immediately can lead to an infinite loop. The injector types
11412
- * should be resolved at a later point by calling `_resolveInjectorDefTypes`.
11655
+ * An `Injector` that's part of the environment injector hierarchy, which exists outside of the
11656
+ * component tree.
11413
11657
  */
11414
- function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name) {
11415
- return new R3Injector(defType, additionalProviders, parent || getNullInjector(), name);
11658
+ class EnvironmentInjector {
11416
11659
  }
11417
- class R3Injector {
11418
- constructor(def, additionalProviders, parent, source = null) {
11660
+ class R3Injector extends EnvironmentInjector {
11661
+ constructor(providers, parent, source, scopes) {
11662
+ super();
11419
11663
  this.parent = parent;
11664
+ this.source = source;
11665
+ this.scopes = scopes;
11420
11666
  /**
11421
11667
  * Map of tokens to records which contain the instances of those tokens.
11422
11668
  * - `null` value implies that we don't have the record. Used by tree-shakable injectors
11423
11669
  * to prevent further searches.
11424
11670
  */
11425
11671
  this.records = new Map();
11426
- /**
11427
- * The transitive set of `InjectorType`s which define this injector.
11428
- */
11429
- this.injectorDefTypes = new Set();
11430
11672
  /**
11431
11673
  * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.
11432
11674
  */
11433
- this.onDestroy = new Set();
11675
+ this._ngOnDestroyHooks = new Set();
11676
+ this._onDestroyHooks = [];
11434
11677
  this._destroyed = false;
11435
- const dedupStack = [];
11436
- // Start off by creating Records for every provider declared in every InjectorType
11437
- // included transitively in additional providers then do the same for `def`. This order is
11438
- // important because `def` may include providers that override ones in additionalProviders.
11439
- additionalProviders &&
11440
- deepForEach(additionalProviders, provider => this.processProvider(provider, def, additionalProviders));
11441
- deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack));
11678
+ // Start off by creating Records for every provider.
11679
+ for (const provider of providers) {
11680
+ this.processProvider(provider);
11681
+ }
11442
11682
  // Make sure the INJECTOR token provides this injector.
11443
11683
  this.records.set(INJECTOR, makeRecord(undefined, this));
11684
+ // And `EnvironmentInjector` if the current injector is supposed to be env-scoped.
11685
+ if (scopes.has('environment')) {
11686
+ this.records.set(EnvironmentInjector, makeRecord(undefined, this));
11687
+ }
11444
11688
  // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide
11445
11689
  // any injectable scoped to APP_ROOT_SCOPE.
11446
11690
  const record = this.records.get(INJECTOR_SCOPE);
11447
- this.scope = record != null ? record.value : null;
11448
- // Source name, used for debugging
11449
- this.source = source || (typeof def === 'object' ? null : stringify(def));
11691
+ if (record != null && typeof record.value === 'string') {
11692
+ this.scopes.add(record.value);
11693
+ }
11694
+ this.injectorDefTypes =
11695
+ new Set(this.get(INJECTOR_DEF_TYPES.multi, EMPTY_ARRAY, InjectFlags.Self));
11450
11696
  }
11451
11697
  /**
11452
11698
  * Flag indicating that this injector was previously destroyed.
@@ -11466,15 +11712,24 @@ class R3Injector {
11466
11712
  this._destroyed = true;
11467
11713
  try {
11468
11714
  // Call all the lifecycle hooks.
11469
- this.onDestroy.forEach(service => service.ngOnDestroy());
11715
+ for (const service of this._ngOnDestroyHooks) {
11716
+ service.ngOnDestroy();
11717
+ }
11718
+ for (const hook of this._onDestroyHooks) {
11719
+ hook();
11720
+ }
11470
11721
  }
11471
11722
  finally {
11472
11723
  // Release all references.
11473
11724
  this.records.clear();
11474
- this.onDestroy.clear();
11725
+ this._ngOnDestroyHooks.clear();
11475
11726
  this.injectorDefTypes.clear();
11727
+ this._onDestroyHooks.length = 0;
11476
11728
  }
11477
11729
  }
11730
+ onDestroy(callback) {
11731
+ this._onDestroyHooks.push(callback);
11732
+ }
11478
11733
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
11479
11734
  this.assertNotDestroyed();
11480
11735
  // Set the injection context.
@@ -11538,12 +11793,26 @@ class R3Injector {
11538
11793
  }
11539
11794
  }
11540
11795
  /** @internal */
11541
- _resolveInjectorDefTypes() {
11542
- this.injectorDefTypes.forEach(defType => this.get(defType));
11796
+ resolveInjectorInitializers() {
11797
+ const previousInjector = setCurrentInjector(this);
11798
+ const previousInjectImplementation = setInjectImplementation(undefined);
11799
+ try {
11800
+ const initializers = this.get(INJECTOR_INITIALIZER.multi, EMPTY_ARRAY, InjectFlags.Self);
11801
+ for (const initializer of initializers) {
11802
+ initializer();
11803
+ }
11804
+ }
11805
+ finally {
11806
+ setCurrentInjector(previousInjector);
11807
+ setInjectImplementation(previousInjectImplementation);
11808
+ }
11543
11809
  }
11544
11810
  toString() {
11545
- const tokens = [], records = this.records;
11546
- records.forEach((v, token) => tokens.push(stringify(token)));
11811
+ const tokens = [];
11812
+ const records = this.records;
11813
+ for (const token of records.keys()) {
11814
+ tokens.push(stringify(token));
11815
+ }
11547
11816
  return `R3Injector[${tokens.join(', ')}]`;
11548
11817
  }
11549
11818
  assertNotDestroyed() {
@@ -11551,105 +11820,16 @@ class R3Injector {
11551
11820
  throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, ngDevMode && 'Injector has already been destroyed.');
11552
11821
  }
11553
11822
  }
11554
- /**
11555
- * Add an `InjectorType` or `InjectorTypeWithProviders` and all of its transitive providers
11556
- * to this injector.
11557
- *
11558
- * If an `InjectorTypeWithProviders` that declares providers besides the type is specified,
11559
- * the function will return "true" to indicate that the providers of the type definition need
11560
- * to be processed. This allows us to process providers of injector types after all imports of
11561
- * an injector definition are processed. (following View Engine semantics: see FW-1349)
11562
- */
11563
- processInjectorType(defOrWrappedDef, parents, dedupStack) {
11564
- defOrWrappedDef = resolveForwardRef(defOrWrappedDef);
11565
- if (!defOrWrappedDef)
11566
- return false;
11567
- // Either the defOrWrappedDef is an InjectorType (with injector def) or an
11568
- // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic
11569
- // read, so care is taken to only do the read once.
11570
- // First attempt to read the injector def (`ɵinj`).
11571
- let def = getInjectorDef(defOrWrappedDef);
11572
- // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.
11573
- const ngModule = (def == null) && defOrWrappedDef.ngModule || undefined;
11574
- // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,
11575
- // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type
11576
- // is the `ngModule`.
11577
- const defType = (ngModule === undefined) ? defOrWrappedDef : ngModule;
11578
- // Check for circular dependencies.
11579
- if (ngDevMode && parents.indexOf(defType) !== -1) {
11580
- const defName = stringify(defType);
11581
- const path = parents.map(stringify);
11582
- throwCyclicDependencyError(defName, path);
11583
- }
11584
- // Check for multiple imports of the same module
11585
- const isDuplicate = dedupStack.indexOf(defType) !== -1;
11586
- // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual
11587
- // `InjectorDef` is on its `ngModule`.
11588
- if (ngModule !== undefined) {
11589
- def = getInjectorDef(ngModule);
11590
- }
11591
- // If no definition was found, it might be from exports. Remove it.
11592
- if (def == null) {
11593
- return false;
11594
- }
11595
- // Add providers in the same way that @NgModule resolution did:
11596
- // First, include providers from any imports.
11597
- if (def.imports != null && !isDuplicate) {
11598
- // Before processing defType's imports, add it to the set of parents. This way, if it ends
11599
- // up deeply importing itself, this can be detected.
11600
- ngDevMode && parents.push(defType);
11601
- // Add it to the set of dedups. This way we can detect multiple imports of the same module
11602
- dedupStack.push(defType);
11603
- let importTypesWithProviders;
11604
- try {
11605
- deepForEach(def.imports, imported => {
11606
- if (this.processInjectorType(imported, parents, dedupStack)) {
11607
- if (importTypesWithProviders === undefined)
11608
- importTypesWithProviders = [];
11609
- // If the processed import is an injector type with providers, we store it in the
11610
- // list of import types with providers, so that we can process those afterwards.
11611
- importTypesWithProviders.push(imported);
11612
- }
11613
- });
11614
- }
11615
- finally {
11616
- // Remove it from the parents set when finished.
11617
- ngDevMode && parents.pop();
11618
- }
11619
- // Imports which are declared with providers (TypeWithProviders) need to be processed
11620
- // after all imported modules are processed. This is similar to how View Engine
11621
- // processes/merges module imports in the metadata resolver. See: FW-1349.
11622
- if (importTypesWithProviders !== undefined) {
11623
- for (let i = 0; i < importTypesWithProviders.length; i++) {
11624
- const { ngModule, providers } = importTypesWithProviders[i];
11625
- deepForEach(providers, provider => this.processProvider(provider, ngModule, providers || EMPTY_ARRAY));
11626
- }
11627
- }
11628
- }
11629
- // Track the InjectorType and add a provider for it. It's important that this is done after the
11630
- // def's imports.
11631
- this.injectorDefTypes.add(defType);
11632
- const factory = getFactoryDef(defType) || (() => new defType());
11633
- this.records.set(defType, makeRecord(factory, NOT_YET));
11634
- // Next, include providers listed on the definition itself.
11635
- const defProviders = def.providers;
11636
- if (defProviders != null && !isDuplicate) {
11637
- const injectorType = defOrWrappedDef;
11638
- deepForEach(defProviders, provider => this.processProvider(provider, injectorType, defProviders));
11639
- }
11640
- return (ngModule !== undefined &&
11641
- defOrWrappedDef.providers !== undefined);
11642
- }
11643
11823
  /**
11644
11824
  * Process a `SingleProvider` and add it.
11645
11825
  */
11646
- processProvider(provider, ngModuleType, providers) {
11826
+ processProvider(provider) {
11647
11827
  // Determine the token from the provider. Either it's its own token, or has a {provide: ...}
11648
11828
  // property.
11649
11829
  provider = resolveForwardRef(provider);
11650
11830
  let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);
11651
11831
  // Construct a `Record` for the provider.
11652
- const record = providerToRecord(provider, ngModuleType, providers);
11832
+ const record = providerToRecord(provider);
11653
11833
  if (!isTypeProvider(provider) && provider.multi === true) {
11654
11834
  // If the provider indicates that it's a multi-provider, process it specially.
11655
11835
  // First check whether it's been defined already.
@@ -11685,7 +11865,7 @@ class R3Injector {
11685
11865
  record.value = record.factory();
11686
11866
  }
11687
11867
  if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {
11688
- this.onDestroy.add(record.value);
11868
+ this._ngOnDestroyHooks.add(record.value);
11689
11869
  }
11690
11870
  return record.value;
11691
11871
  }
@@ -11695,7 +11875,7 @@ class R3Injector {
11695
11875
  }
11696
11876
  const providedIn = resolveForwardRef(def.providedIn);
11697
11877
  if (typeof providedIn === 'string') {
11698
- return providedIn === 'any' || (providedIn === this.scope);
11878
+ return providedIn === 'any' || (this.scopes.has(providedIn));
11699
11879
  }
11700
11880
  else {
11701
11881
  return this.injectorDefTypes.has(providedIn);
@@ -11741,12 +11921,12 @@ function getUndecoratedInjectableFactory(token) {
11741
11921
  return () => new token();
11742
11922
  }
11743
11923
  }
11744
- function providerToRecord(provider, ngModuleType, providers) {
11924
+ function providerToRecord(provider) {
11745
11925
  if (isValueProvider(provider)) {
11746
11926
  return makeRecord(undefined, provider.useValue);
11747
11927
  }
11748
11928
  else {
11749
- const factory = providerToFactory(provider, ngModuleType, providers);
11929
+ const factory = providerToFactory(provider);
11750
11930
  return makeRecord(factory, NOT_YET);
11751
11931
  }
11752
11932
  }
@@ -11794,21 +11974,6 @@ function makeRecord(factory, value, multi = false) {
11794
11974
  multi: multi ? [] : undefined,
11795
11975
  };
11796
11976
  }
11797
- function isValueProvider(value) {
11798
- return value !== null && typeof value == 'object' && USE_VALUE$1 in value;
11799
- }
11800
- function isExistingProvider(value) {
11801
- return !!(value && value.useExisting);
11802
- }
11803
- function isFactoryProvider(value) {
11804
- return !!(value && value.useFactory);
11805
- }
11806
- function isTypeProvider(value) {
11807
- return typeof value === 'function';
11808
- }
11809
- function isClassProvider(value) {
11810
- return !!value.useClass;
11811
- }
11812
11977
  function hasDeps(value) {
11813
11978
  return !!value.deps;
11814
11979
  }
@@ -11821,6 +11986,37 @@ function couldBeInjectableType(value) {
11821
11986
  (typeof value === 'object' && value instanceof InjectionToken);
11822
11987
  }
11823
11988
 
11989
+ /**
11990
+ * @license
11991
+ * Copyright Google LLC All Rights Reserved.
11992
+ *
11993
+ * Use of this source code is governed by an MIT-style license that can be
11994
+ * found in the LICENSE file at https://angular.io/license
11995
+ */
11996
+ /**
11997
+ * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.
11998
+ *
11999
+ * @publicApi
12000
+ */
12001
+ function createInjector(defType, parent = null, additionalProviders = null, name) {
12002
+ const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);
12003
+ injector.resolveInjectorInitializers();
12004
+ return injector;
12005
+ }
12006
+ /**
12007
+ * Creates a new injector without eagerly resolving its injector types. Can be used in places
12008
+ * where resolving the injector types immediately can lead to an infinite loop. The injector types
12009
+ * should be resolved at a later point by calling `_resolveInjectorDefTypes`.
12010
+ */
12011
+ function createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {
12012
+ const providers = [
12013
+ ...flatten(additionalProviders || EMPTY_ARRAY),
12014
+ ...importProvidersFrom(defType),
12015
+ ];
12016
+ name = name || (typeof defType === 'object' ? undefined : stringify(defType));
12017
+ return new R3Injector(providers, parent || getNullInjector(), name || null, scopes);
12018
+ }
12019
+
11824
12020
  /**
11825
12021
  * @license
11826
12022
  * Copyright Google LLC All Rights Reserved.
@@ -12597,7 +12793,7 @@ function ɵɵInheritDefinitionFeature(definition) {
12597
12793
  else {
12598
12794
  if (superType.ɵcmp) {
12599
12795
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
12600
- 'Directives cannot inherit Components' :
12796
+ `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
12601
12797
  '';
12602
12798
  throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
12603
12799
  }
@@ -12843,22 +13039,8 @@ function getSymbolIterator() {
12843
13039
  * Use of this source code is governed by an MIT-style license that can be
12844
13040
  * found in the LICENSE file at https://angular.io/license
12845
13041
  */
12846
- function devModeEqual(a, b) {
12847
- const isListLikeIterableA = isListLikeIterable(a);
12848
- const isListLikeIterableB = isListLikeIterable(b);
12849
- if (isListLikeIterableA && isListLikeIterableB) {
12850
- return areIterablesEqual(a, b, devModeEqual);
12851
- }
12852
- else {
12853
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
12854
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
12855
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
12856
- return true;
12857
- }
12858
- else {
12859
- return Object.is(a, b);
12860
- }
12861
- }
13042
+ function isIterable(obj) {
13043
+ return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
12862
13044
  }
12863
13045
  function isListLikeIterable(obj) {
12864
13046
  if (!isJsObject(obj))
@@ -12906,13 +13088,38 @@ function isJsObject(o) {
12906
13088
  * Use of this source code is governed by an MIT-style license that can be
12907
13089
  * found in the LICENSE file at https://angular.io/license
12908
13090
  */
12909
- // TODO(misko): consider inlining
12910
- /** Updates binding and returns the value. */
12911
- function updateBinding(lView, bindingIndex, value) {
12912
- return lView[bindingIndex] = value;
12913
- }
12914
- /** Gets the current binding value. */
12915
- function getBinding(lView, bindingIndex) {
13091
+ function devModeEqual(a, b) {
13092
+ const isListLikeIterableA = isListLikeIterable(a);
13093
+ const isListLikeIterableB = isListLikeIterable(b);
13094
+ if (isListLikeIterableA && isListLikeIterableB) {
13095
+ return areIterablesEqual(a, b, devModeEqual);
13096
+ }
13097
+ else {
13098
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
13099
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
13100
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
13101
+ return true;
13102
+ }
13103
+ else {
13104
+ return Object.is(a, b);
13105
+ }
13106
+ }
13107
+ }
13108
+
13109
+ /**
13110
+ * @license
13111
+ * Copyright Google LLC All Rights Reserved.
13112
+ *
13113
+ * Use of this source code is governed by an MIT-style license that can be
13114
+ * found in the LICENSE file at https://angular.io/license
13115
+ */
13116
+ // TODO(misko): consider inlining
13117
+ /** Updates binding and returns the value. */
13118
+ function updateBinding(lView, bindingIndex, value) {
13119
+ return lView[bindingIndex] = value;
13120
+ }
13121
+ /** Gets the current binding value. */
13122
+ function getBinding(lView, bindingIndex) {
12916
13123
  ngDevMode && assertIndexInRange(lView, bindingIndex);
12917
13124
  ngDevMode &&
12918
13125
  assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
@@ -21043,37 +21250,6 @@ function ɵɵProvidersFeature(providers, viewProviders = []) {
21043
21250
  };
21044
21251
  }
21045
21252
 
21046
- /**
21047
- * @license
21048
- * Copyright Google LLC All Rights Reserved.
21049
- *
21050
- * Use of this source code is governed by an MIT-style license that can be
21051
- * found in the LICENSE file at https://angular.io/license
21052
- */
21053
- /**
21054
- * Represents a component created by a `ComponentFactory`.
21055
- * Provides access to the component instance and related objects,
21056
- * and provides the means of destroying the instance.
21057
- *
21058
- * @publicApi
21059
- */
21060
- class ComponentRef$1 {
21061
- }
21062
- /**
21063
- * Base class for a factory that can create a component dynamically.
21064
- * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
21065
- * Use the resulting `ComponentFactory.create()` method to create a component of that type.
21066
- *
21067
- * @see [Dynamic Components](guide/dynamic-component-loader)
21068
- *
21069
- * @publicApi
21070
- *
21071
- * @deprecated Angular no longer requires Component factories. Please use other APIs where
21072
- * Component class can be used directly.
21073
- */
21074
- class ComponentFactory$1 {
21075
- }
21076
-
21077
21253
  /**
21078
21254
  * @license
21079
21255
  * Copyright Google LLC All Rights Reserved.
@@ -21114,6 +21290,66 @@ class ComponentFactoryResolver$1 {
21114
21290
  }
21115
21291
  ComponentFactoryResolver$1.NULL = ( /* @__PURE__ */new _NullComponentFactoryResolver());
21116
21292
 
21293
+ /**
21294
+ * @license
21295
+ * Copyright Google LLC All Rights Reserved.
21296
+ *
21297
+ * Use of this source code is governed by an MIT-style license that can be
21298
+ * found in the LICENSE file at https://angular.io/license
21299
+ */
21300
+ /**
21301
+ * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
21302
+ * Provides access to the `NgModule` instance and related objects.
21303
+ *
21304
+ * @publicApi
21305
+ */
21306
+ class NgModuleRef$1 {
21307
+ }
21308
+ /**
21309
+ * @publicApi
21310
+ *
21311
+ * @deprecated
21312
+ * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
21313
+ * JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
21314
+ * for additional context. Angular provides APIs that accept NgModule classes directly (such as
21315
+ * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
21316
+ * [createNgModuleRef](api/core/createNgModuleRef)), consider switching to those APIs instead of
21317
+ * using factory-based ones.
21318
+ */
21319
+ class NgModuleFactory$1 {
21320
+ }
21321
+
21322
+ /**
21323
+ * @license
21324
+ * Copyright Google LLC All Rights Reserved.
21325
+ *
21326
+ * Use of this source code is governed by an MIT-style license that can be
21327
+ * found in the LICENSE file at https://angular.io/license
21328
+ */
21329
+ /**
21330
+ * Represents a component created by a `ComponentFactory`.
21331
+ * Provides access to the component instance and related objects,
21332
+ * and provides the means of destroying the instance.
21333
+ *
21334
+ * @publicApi
21335
+ */
21336
+ class ComponentRef$1 {
21337
+ }
21338
+ /**
21339
+ * Base class for a factory that can create a component dynamically.
21340
+ * Instantiate a factory for a given type of component with `resolveComponentFactory()`.
21341
+ * Use the resulting `ComponentFactory.create()` method to create a component of that type.
21342
+ *
21343
+ * @see [Dynamic Components](guide/dynamic-component-loader)
21344
+ *
21345
+ * @publicApi
21346
+ *
21347
+ * @deprecated Angular no longer requires Component factories. Please use other APIs where
21348
+ * Component class can be used directly.
21349
+ */
21350
+ class ComponentFactory$1 {
21351
+ }
21352
+
21117
21353
  /**
21118
21354
  * @license
21119
21355
  * Copyright Google LLC All Rights Reserved.
@@ -21273,7 +21509,7 @@ class Version {
21273
21509
  /**
21274
21510
  * @publicApi
21275
21511
  */
21276
- const VERSION = new Version('14.0.0-next.12');
21512
+ const VERSION = new Version('14.0.0-next.15');
21277
21513
 
21278
21514
  /**
21279
21515
  * @license
@@ -21725,9 +21961,16 @@ class ComponentFactory extends ComponentFactory$1 {
21725
21961
  get outputs() {
21726
21962
  return toRefArray(this.componentDef.outputs);
21727
21963
  }
21728
- create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
21729
- ngModule = ngModule || this.ngModule;
21730
- const rootViewInjector = ngModule ? new ChainedInjector(injector, ngModule.injector) : injector;
21964
+ create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
21965
+ environmentInjector = environmentInjector || this.ngModule;
21966
+ let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
21967
+ environmentInjector :
21968
+ environmentInjector === null || environmentInjector === void 0 ? void 0 : environmentInjector.injector;
21969
+ if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
21970
+ realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
21971
+ realEnvironmentInjector;
21972
+ }
21973
+ const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
21731
21974
  const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
21732
21975
  const sanitizer = rootViewInjector.get(Sanitizer, null);
21733
21976
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
@@ -21835,83 +22078,6 @@ class ComponentRef extends ComponentRef$1 {
21835
22078
  }
21836
22079
  }
21837
22080
 
21838
- /**
21839
- * @license
21840
- * Copyright Google LLC All Rights Reserved.
21841
- *
21842
- * Use of this source code is governed by an MIT-style license that can be
21843
- * found in the LICENSE file at https://angular.io/license
21844
- */
21845
- /**
21846
- * Adds decorator, constructor, and property metadata to a given type via static metadata fields
21847
- * on the type.
21848
- *
21849
- * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
21850
- *
21851
- * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
21852
- * being tree-shaken away during production builds.
21853
- */
21854
- function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
21855
- return noSideEffects(() => {
21856
- const clazz = type;
21857
- if (decorators !== null) {
21858
- if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
21859
- clazz.decorators.push(...decorators);
21860
- }
21861
- else {
21862
- clazz.decorators = decorators;
21863
- }
21864
- }
21865
- if (ctorParameters !== null) {
21866
- // Rather than merging, clobber the existing parameters. If other projects exist which
21867
- // use tsickle-style annotations and reflect over them in the same way, this could
21868
- // cause issues, but that is vanishingly unlikely.
21869
- clazz.ctorParameters = ctorParameters;
21870
- }
21871
- if (propDecorators !== null) {
21872
- // The property decorator objects are merged as it is possible different fields have
21873
- // different decorator types. Decorators on individual fields are not merged, as it's
21874
- // also incredibly unlikely that a field will be decorated both with an Angular
21875
- // decorator and a non-Angular decorator that's also been downleveled.
21876
- if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {
21877
- clazz.propDecorators = Object.assign(Object.assign({}, clazz.propDecorators), propDecorators);
21878
- }
21879
- else {
21880
- clazz.propDecorators = propDecorators;
21881
- }
21882
- }
21883
- });
21884
- }
21885
-
21886
- /**
21887
- * @license
21888
- * Copyright Google LLC All Rights Reserved.
21889
- *
21890
- * Use of this source code is governed by an MIT-style license that can be
21891
- * found in the LICENSE file at https://angular.io/license
21892
- */
21893
- /**
21894
- * Represents an instance of an `NgModule` created by an `NgModuleFactory`.
21895
- * Provides access to the `NgModule` instance and related objects.
21896
- *
21897
- * @publicApi
21898
- */
21899
- class NgModuleRef$1 {
21900
- }
21901
- /**
21902
- * @publicApi
21903
- *
21904
- * @deprecated
21905
- * This class was mostly used as a part of ViewEngine-based JIT API and is no longer needed in Ivy
21906
- * JIT mode. See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes)
21907
- * for additional context. Angular provides APIs that accept NgModule classes directly (such as
21908
- * [PlatformRef.bootstrapModule](api/core/PlatformRef#bootstrapModule) and
21909
- * [createNgModuleRef](api/core/createNgModuleRef)), consider switching to those APIs instead of
21910
- * using factory-based ones.
21911
- */
21912
- class NgModuleFactory$1 {
21913
- }
21914
-
21915
22081
  /**
21916
22082
  * @license
21917
22083
  * Copyright Google LLC All Rights Reserved.
@@ -21953,11 +22119,11 @@ class NgModuleRef extends NgModuleRef$1 {
21953
22119
  provide: ComponentFactoryResolver$1,
21954
22120
  useValue: this.componentFactoryResolver
21955
22121
  }
21956
- ], stringify(ngModuleType));
22122
+ ], stringify(ngModuleType), new Set(['environment']));
21957
22123
  // We need to resolve the injector types separately from the injector creation, because
21958
22124
  // the module might be trying to use this ref in its constructor for DI which will cause a
21959
22125
  // circular error that will eventually error out, because the injector isn't created yet.
21960
- this._r3Injector._resolveInjectorDefTypes();
22126
+ this._r3Injector.resolveInjectorInitializers();
21961
22127
  this.instance = this.get(ngModuleType);
21962
22128
  }
21963
22129
  get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
@@ -21987,6 +22153,147 @@ class NgModuleFactory extends NgModuleFactory$1 {
21987
22153
  return new NgModuleRef(this.moduleType, parentInjector);
21988
22154
  }
21989
22155
  }
22156
+ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
22157
+ constructor(providers, parent, source) {
22158
+ super();
22159
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
22160
+ this.instance = null;
22161
+ const injector = new R3Injector([
22162
+ ...providers,
22163
+ { provide: NgModuleRef$1, useValue: this },
22164
+ { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
22165
+ ], parent || getNullInjector(), source, new Set(['environment']));
22166
+ this.injector = injector;
22167
+ injector.resolveInjectorInitializers();
22168
+ }
22169
+ destroy() {
22170
+ this.injector.destroy();
22171
+ }
22172
+ onDestroy(callback) {
22173
+ this.injector.onDestroy(callback);
22174
+ }
22175
+ }
22176
+ /**
22177
+ * Create a new environment injector.
22178
+ *
22179
+ * @publicApi
22180
+ */
22181
+ function createEnvironmentInjector(providers, parent = null, debugName = null) {
22182
+ const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
22183
+ return adapter.injector;
22184
+ }
22185
+
22186
+ /**
22187
+ * @license
22188
+ * Copyright Google LLC All Rights Reserved.
22189
+ *
22190
+ * Use of this source code is governed by an MIT-style license that can be
22191
+ * found in the LICENSE file at https://angular.io/license
22192
+ */
22193
+ /**
22194
+ * A service used by the framework to create instances of standalone injectors. Those injectors are
22195
+ * created on demand in case of dynamic component instantiation and contain ambient providers
22196
+ * collected from the imports graph rooted at a given standalone component.
22197
+ */
22198
+ class StandaloneService {
22199
+ constructor(_injector) {
22200
+ this._injector = _injector;
22201
+ this.cachedInjectors = new Map();
22202
+ }
22203
+ getOrCreateStandaloneInjector(componentDef) {
22204
+ if (!componentDef.standalone) {
22205
+ return null;
22206
+ }
22207
+ if (!this.cachedInjectors.has(componentDef)) {
22208
+ const providers = importProvidersFrom(componentDef.type);
22209
+ const standaloneInjector = providers.length > 0 ?
22210
+ createEnvironmentInjector(providers, this._injector, `Standalone[${componentDef.type.name}]`) :
22211
+ null;
22212
+ this.cachedInjectors.set(componentDef, standaloneInjector);
22213
+ }
22214
+ return this.cachedInjectors.get(componentDef);
22215
+ }
22216
+ ngOnDestroy() {
22217
+ try {
22218
+ for (const injector of this.cachedInjectors.values()) {
22219
+ if (injector !== null) {
22220
+ injector.destroy();
22221
+ }
22222
+ }
22223
+ }
22224
+ finally {
22225
+ this.cachedInjectors.clear();
22226
+ }
22227
+ }
22228
+ }
22229
+ StandaloneService.ɵprov = ɵɵdefineInjectable({
22230
+ token: StandaloneService,
22231
+ providedIn: 'environment',
22232
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
22233
+ });
22234
+ /**
22235
+ * A feature that acts as a setup code for the {@see StandaloneService}.
22236
+ *
22237
+ * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
22238
+ * function (an entry points to a standalone injector creation) on a component definition object. We
22239
+ * go through the features infrastructure to make sure that the standalone injector creation logic
22240
+ * is tree-shakable and not included in applications that don't use standalone components.
22241
+ *
22242
+ * @codeGenApi
22243
+ */
22244
+ function ɵɵStandaloneFeature(definition) {
22245
+ definition.getStandaloneInjector = (parentInjector) => {
22246
+ return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
22247
+ };
22248
+ }
22249
+
22250
+ /**
22251
+ * @license
22252
+ * Copyright Google LLC All Rights Reserved.
22253
+ *
22254
+ * Use of this source code is governed by an MIT-style license that can be
22255
+ * found in the LICENSE file at https://angular.io/license
22256
+ */
22257
+ /**
22258
+ * Adds decorator, constructor, and property metadata to a given type via static metadata fields
22259
+ * on the type.
22260
+ *
22261
+ * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.
22262
+ *
22263
+ * Calls to `setClassMetadata` can be guarded by ngDevMode, resulting in the metadata assignments
22264
+ * being tree-shaken away during production builds.
22265
+ */
22266
+ function setClassMetadata(type, decorators, ctorParameters, propDecorators) {
22267
+ return noSideEffects(() => {
22268
+ const clazz = type;
22269
+ if (decorators !== null) {
22270
+ if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) {
22271
+ clazz.decorators.push(...decorators);
22272
+ }
22273
+ else {
22274
+ clazz.decorators = decorators;
22275
+ }
22276
+ }
22277
+ if (ctorParameters !== null) {
22278
+ // Rather than merging, clobber the existing parameters. If other projects exist which
22279
+ // use tsickle-style annotations and reflect over them in the same way, this could
22280
+ // cause issues, but that is vanishingly unlikely.
22281
+ clazz.ctorParameters = ctorParameters;
22282
+ }
22283
+ if (propDecorators !== null) {
22284
+ // The property decorator objects are merged as it is possible different fields have
22285
+ // different decorator types. Decorators on individual fields are not merged, as it's
22286
+ // also incredibly unlikely that a field will be decorated both with an Angular
22287
+ // decorator and a non-Angular decorator that's also been downleveled.
22288
+ if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) {
22289
+ clazz.propDecorators = Object.assign(Object.assign({}, clazz.propDecorators), propDecorators);
22290
+ }
22291
+ else {
22292
+ clazz.propDecorators = propDecorators;
22293
+ }
22294
+ }
22295
+ });
22296
+ }
21990
22297
 
21991
22298
  /**
21992
22299
  * @license
@@ -22912,7 +23219,7 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
22912
23219
  this.insert(viewRef, index);
22913
23220
  return viewRef;
22914
23221
  }
22915
- createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, ngModuleRef) {
23222
+ createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector) {
22916
23223
  const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
22917
23224
  let index;
22918
23225
  // This function supports 2 signatures and we need to handle options correctly for both:
@@ -22940,17 +23247,20 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
22940
23247
  'is incompatible. Please use an object as the second argument instead.');
22941
23248
  }
22942
23249
  const options = (indexOrOptions || {});
23250
+ if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
23251
+ throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
23252
+ }
22943
23253
  index = options.index;
22944
23254
  injector = options.injector;
22945
23255
  projectableNodes = options.projectableNodes;
22946
- ngModuleRef = options.ngModuleRef;
23256
+ environmentInjector = options.environmentInjector || options.ngModuleRef;
22947
23257
  }
22948
23258
  const componentFactory = isComponentFactory ?
22949
23259
  componentFactoryOrType :
22950
23260
  new ComponentFactory(getComponentDef(componentFactoryOrType));
22951
23261
  const contextInjector = injector || this.parentInjector;
22952
23262
  // If an `NgModuleRef` is not provided explicitly, try retrieving it from the DI tree.
22953
- if (!ngModuleRef && componentFactory.ngModule == null) {
23263
+ if (!environmentInjector && componentFactory.ngModule == null) {
22954
23264
  // For the `ComponentFactory` case, entering this logic is very unlikely, since we expect that
22955
23265
  // an instance of a `ComponentFactory`, resolved via `ComponentFactoryResolver` would have an
22956
23266
  // `ngModule` field. This is possible in some test scenarios and potentially in some JIT-based
@@ -22971,12 +23281,12 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
22971
23281
  // DO NOT REFACTOR. The code here used to have a `injector.get(NgModuleRef, null) ||
22972
23282
  // undefined` expression which seems to cause internal google apps to fail. This is documented
22973
23283
  // in the following internal bug issue: go/b/142967802
22974
- const result = _injector.get(NgModuleRef$1, null);
23284
+ const result = _injector.get(EnvironmentInjector, null);
22975
23285
  if (result) {
22976
- ngModuleRef = result;
23286
+ environmentInjector = result;
22977
23287
  }
22978
23288
  }
22979
- const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);
23289
+ const componentRef = componentFactory.create(contextInjector, projectableNodes, undefined, environmentInjector);
22980
23290
  this.insert(componentRef.hostView, index);
22981
23291
  return componentRef;
22982
23292
  }
@@ -23666,6 +23976,7 @@ const angularCoreEnv = (() => ({
23666
23976
  'ɵɵProvidersFeature': ɵɵProvidersFeature,
23667
23977
  'ɵɵCopyDefinitionFeature': ɵɵCopyDefinitionFeature,
23668
23978
  'ɵɵInheritDefinitionFeature': ɵɵInheritDefinitionFeature,
23979
+ 'ɵɵStandaloneFeature': ɵɵStandaloneFeature,
23669
23980
  'ɵɵnextContext': ɵɵnextContext,
23670
23981
  'ɵɵnamespaceHTML': ɵɵnamespaceHTML,
23671
23982
  'ɵɵnamespaceMathML': ɵɵnamespaceMathML,
@@ -23976,9 +24287,16 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
23976
24287
  configurable: !!ngDevMode,
23977
24288
  });
23978
24289
  }
24290
+ function isStandalone(type) {
24291
+ const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
24292
+ return def !== null ? def.standalone : false;
24293
+ }
23979
24294
  function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRoot, importingModule) {
23980
24295
  if (verifiedNgModule.get(moduleType))
23981
24296
  return;
24297
+ // skip verifications of standalone components, direcrtives and pipes
24298
+ if (isStandalone(moduleType))
24299
+ return;
23982
24300
  verifiedNgModule.set(moduleType, true);
23983
24301
  moduleType = resolveForwardRef(moduleType);
23984
24302
  let ngModuleDef;
@@ -23994,9 +24312,9 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
23994
24312
  const errors = [];
23995
24313
  const declarations = maybeUnwrapFn(ngModuleDef.declarations);
23996
24314
  const imports = maybeUnwrapFn(ngModuleDef.imports);
23997
- flatten(imports).map(unwrapModuleWithProvidersImports).forEach(mod => {
23998
- verifySemanticsOfNgModuleImport(mod, moduleType);
23999
- verifySemanticsOfNgModuleDef(mod, false, moduleType);
24315
+ flatten(imports).map(unwrapModuleWithProvidersImports).forEach(modOrStandaloneCmpt => {
24316
+ verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
24317
+ verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
24000
24318
  });
24001
24319
  const exports = maybeUnwrapFn(ngModuleDef.exports);
24002
24320
  declarations.forEach(verifyDeclarationsHaveDefinitions);
@@ -24093,10 +24411,12 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
24093
24411
  }
24094
24412
  function verifySemanticsOfNgModuleImport(type, importingModule) {
24095
24413
  type = resolveForwardRef(type);
24096
- if (getComponentDef(type) || getDirectiveDef(type)) {
24414
+ const directiveDef = getComponentDef(type) || getDirectiveDef(type);
24415
+ if (directiveDef !== null && !directiveDef.standalone) {
24097
24416
  throw new Error(`Unexpected directive '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
24098
24417
  }
24099
- if (getPipeDef$1(type)) {
24418
+ const pipeDef = getPipeDef$1(type);
24419
+ if (pipeDef !== null && !pipeDef.standalone) {
24100
24420
  throw new Error(`Unexpected pipe '${type.name}' imported by the module '${importingModule.name}'. Please add an @NgModule annotation.`);
24101
24421
  }
24102
24422
  }
@@ -24150,7 +24470,11 @@ function resetCompiledComponents() {
24150
24470
  */
24151
24471
  function computeCombinedExports(type) {
24152
24472
  type = resolveForwardRef(type);
24153
- const ngModuleDef = getNgModuleDef(type, true);
24473
+ const ngModuleDef = getNgModuleDef(type);
24474
+ // a standalone component, directive or pipe
24475
+ if (ngModuleDef === null) {
24476
+ return [type];
24477
+ }
24154
24478
  return [...flatten(maybeUnwrapFn(ngModuleDef.exports).map((type) => {
24155
24479
  const ngModuleDef = getNgModuleDef(type);
24156
24480
  if (ngModuleDef) {
@@ -24199,6 +24523,47 @@ function patchComponentDefWithScope(componentDef, transitiveScopes) {
24199
24523
  // order to avoid this problem, we force fresh TView to be created.
24200
24524
  componentDef.tView = null;
24201
24525
  }
24526
+ /**
24527
+ * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
24528
+ * (eaither a NgModule or a standalone component / directive / pipe).
24529
+ */
24530
+ function transitiveScopesFor(type) {
24531
+ if (isNgModule(type)) {
24532
+ return transitiveScopesForNgModule(type);
24533
+ }
24534
+ else if (isStandalone(type)) {
24535
+ const directiveDef = getComponentDef(type) || getDirectiveDef(type);
24536
+ if (directiveDef !== null) {
24537
+ return {
24538
+ schemas: null,
24539
+ compilation: {
24540
+ directives: new Set(),
24541
+ pipes: new Set(),
24542
+ },
24543
+ exported: {
24544
+ directives: new Set([type]),
24545
+ pipes: new Set(),
24546
+ },
24547
+ };
24548
+ }
24549
+ const pipeDef = getPipeDef$1(type);
24550
+ if (pipeDef !== null) {
24551
+ return {
24552
+ schemas: null,
24553
+ compilation: {
24554
+ directives: new Set(),
24555
+ pipes: new Set(),
24556
+ },
24557
+ exported: {
24558
+ directives: new Set(),
24559
+ pipes: new Set([type]),
24560
+ },
24561
+ };
24562
+ }
24563
+ }
24564
+ // TODO: change the error message to be more user-facing and take standalone into account
24565
+ throw new Error(`${type.name} does not have a module def (ɵmod property)`);
24566
+ }
24202
24567
  /**
24203
24568
  * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.
24204
24569
  *
@@ -24208,11 +24573,8 @@ function patchComponentDefWithScope(componentDef, transitiveScopes) {
24208
24573
  *
24209
24574
  * @param moduleType module that transitive scope should be calculated for.
24210
24575
  */
24211
- function transitiveScopesFor(moduleType) {
24212
- if (!isNgModule(moduleType)) {
24213
- throw new Error(`${moduleType.name} does not have a module def (ɵmod property)`);
24214
- }
24215
- const def = getNgModuleDef(moduleType);
24576
+ function transitiveScopesForNgModule(moduleType) {
24577
+ const def = getNgModuleDef(moduleType, true);
24216
24578
  if (def.transitiveCompileScopes !== null) {
24217
24579
  return def.transitiveCompileScopes;
24218
24580
  }
@@ -24228,13 +24590,9 @@ function transitiveScopesFor(moduleType) {
24228
24590
  },
24229
24591
  };
24230
24592
  maybeUnwrapFn(def.imports).forEach((imported) => {
24231
- const importedType = imported;
24232
- if (!isNgModule(importedType)) {
24233
- throw new Error(`Importing ${importedType.name} which does not have a ɵmod property`);
24234
- }
24235
24593
  // When this module imports another, the imported module's exported directives and pipes are
24236
24594
  // added to the compilation scope of this module.
24237
- const importedScope = transitiveScopesFor(importedType);
24595
+ const importedScope = transitiveScopesFor(imported);
24238
24596
  importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));
24239
24597
  importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));
24240
24598
  });
@@ -24370,13 +24728,30 @@ function compileComponent(type, metadata) {
24370
24728
  }
24371
24729
  }
24372
24730
  const templateUrl = metadata.templateUrl || `ng:///${type.name}/template.html`;
24373
- const meta = Object.assign(Object.assign({}, directiveMetadata(type, metadata)), { typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl), template: metadata.template || '', preserveWhitespaces, styles: metadata.styles || EMPTY_ARRAY, animations: metadata.animations, directives: [], changeDetection: metadata.changeDetection, pipes: new Map(), encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null });
24731
+ const meta = Object.assign(Object.assign({}, directiveMetadata(type, metadata)), { typeSourceSpan: compiler.createParseSourceSpan('Component', type.name, templateUrl), template: metadata.template || '', preserveWhitespaces, styles: metadata.styles || EMPTY_ARRAY, animations: metadata.animations,
24732
+ // JIT components are always compiled against an empty set of `declarations`. Instead, the
24733
+ // `directiveDefs` and `pipeDefs` are updated at a later point:
24734
+ // * for NgModule-based components, they're set when the NgModule which declares the
24735
+ // component resolves in the module scoping queue
24736
+ // * for standalone components, they're set just below, after `compileComponent`.
24737
+ declarations: [], changeDetection: metadata.changeDetection, encapsulation, interpolation: metadata.interpolation, viewProviders: metadata.viewProviders || null, isStandalone: !!metadata.standalone });
24374
24738
  compilationDepth++;
24375
24739
  try {
24376
24740
  if (meta.usesInheritance) {
24377
24741
  addDirectiveDefToUndecoratedParents(type);
24378
24742
  }
24379
- ngComponentDef = compiler.compileComponent(angularCoreEnv, templateUrl, meta);
24743
+ ngComponentDef =
24744
+ compiler.compileComponent(angularCoreEnv, templateUrl, meta);
24745
+ if (metadata.standalone) {
24746
+ // Patch the component definition for standalone components with `directiveDefs` and
24747
+ // `pipeDefs` functions which lazily compute the directives/pipes available in the
24748
+ // standalone component. Also set `dependencies` to the lazily resolved list of imports.
24749
+ const imports = flatten(metadata.imports || EMPTY_ARRAY);
24750
+ const { directiveDefs, pipeDefs } = getStandaloneDefFunctions(type, imports);
24751
+ ngComponentDef.directiveDefs = directiveDefs;
24752
+ ngComponentDef.pipeDefs = pipeDefs;
24753
+ ngComponentDef.dependencies = () => imports.map(resolveForwardRef);
24754
+ }
24380
24755
  }
24381
24756
  finally {
24382
24757
  // Ensure that the compilation depth is decremented even when the compilation failed.
@@ -24398,6 +24773,17 @@ function compileComponent(type, metadata) {
24398
24773
  const scopes = transitiveScopesFor(type.ngSelectorScope);
24399
24774
  patchComponentDefWithScope(ngComponentDef, scopes);
24400
24775
  }
24776
+ if (metadata.schemas) {
24777
+ if (metadata.standalone) {
24778
+ ngComponentDef.schemas = metadata.schemas;
24779
+ }
24780
+ else {
24781
+ throw new Error(`The 'schemas' was specified for the ${stringifyForError(type)} but is only valid on a component that is standalone.`);
24782
+ }
24783
+ }
24784
+ else if (metadata.standalone) {
24785
+ ngComponentDef.schemas = [];
24786
+ }
24401
24787
  }
24402
24788
  return ngComponentDef;
24403
24789
  },
@@ -24405,6 +24791,65 @@ function compileComponent(type, metadata) {
24405
24791
  configurable: !!ngDevMode,
24406
24792
  });
24407
24793
  }
24794
+ /**
24795
+ * Build memoized `directiveDefs` and `pipeDefs` functions for the component definition of a
24796
+ * standalone component, which process `imports` and filter out directives and pipes. The use of
24797
+ * memoized functions here allows for the delayed resolution of any `forwardRef`s present in the
24798
+ * component's `imports`.
24799
+ */
24800
+ function getStandaloneDefFunctions(type, imports) {
24801
+ let cachedDirectiveDefs = null;
24802
+ let cachedPipeDefs = null;
24803
+ const directiveDefs = () => {
24804
+ if (cachedDirectiveDefs === null) {
24805
+ // Standalone components are always able to self-reference, so include the component's own
24806
+ // definition in its `directiveDefs`.
24807
+ cachedDirectiveDefs = [getComponentDef(type)];
24808
+ for (const rawDep of imports) {
24809
+ const dep = resolveForwardRef(rawDep);
24810
+ if (!!getNgModuleDef(dep)) {
24811
+ const scope = transitiveScopesFor(dep);
24812
+ for (const dir of scope.exported.directives) {
24813
+ const def = getComponentDef(dir) || getDirectiveDef(dir);
24814
+ if (def) {
24815
+ cachedDirectiveDefs.push(def);
24816
+ }
24817
+ }
24818
+ }
24819
+ else {
24820
+ const def = getComponentDef(dep) || getDirectiveDef(dep);
24821
+ if (def) {
24822
+ cachedDirectiveDefs.push(def);
24823
+ }
24824
+ }
24825
+ }
24826
+ }
24827
+ return cachedDirectiveDefs;
24828
+ };
24829
+ const pipeDefs = () => {
24830
+ if (cachedPipeDefs === null) {
24831
+ cachedPipeDefs = [];
24832
+ for (const rawDep of imports) {
24833
+ const dep = resolveForwardRef(rawDep);
24834
+ if (!!getNgModuleDef(dep)) {
24835
+ const scope = transitiveScopesFor(dep);
24836
+ cachedPipeDefs.push(...Array.from(scope.exported.pipes).map(pipe => getPipeDef$1(pipe)));
24837
+ }
24838
+ else {
24839
+ const def = getPipeDef$1(dep);
24840
+ if (def) {
24841
+ cachedPipeDefs.push(def);
24842
+ }
24843
+ }
24844
+ }
24845
+ }
24846
+ return cachedPipeDefs;
24847
+ };
24848
+ return {
24849
+ directiveDefs,
24850
+ pipeDefs,
24851
+ };
24852
+ }
24408
24853
  function hasSelectorScope(component) {
24409
24854
  return component.ngSelectorScope !== undefined;
24410
24855
  }
@@ -24493,9 +24938,7 @@ function directiveMetadata(type, metadata) {
24493
24938
  exportAs: extractExportAs(metadata.exportAs),
24494
24939
  providers: metadata.providers || null,
24495
24940
  viewQueries: extractQueriesMetadata(type, propMetadata, isViewQuery),
24496
- // TODO(alxhub): pass through the standalone flag from the directive metadata once standalone
24497
- // functionality is fully rolled out.
24498
- isStandalone: false,
24941
+ isStandalone: !!metadata.standalone,
24499
24942
  };
24500
24943
  }
24501
24944
  /**
@@ -24640,9 +25083,7 @@ function getPipeMetadata(type, meta) {
24640
25083
  name: type.name,
24641
25084
  pipeName: meta.name,
24642
25085
  pure: meta.pure !== undefined ? meta.pure : true,
24643
- // TODO(alxhub): pass through the standalone flag from the pipe metadata once standalone
24644
- // functionality is fully rolled out.
24645
- isStandalone: false,
25086
+ isStandalone: !!meta.standalone,
24646
25087
  };
24647
25088
  }
24648
25089
 
@@ -24997,7 +25438,10 @@ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
24997
25438
  * A token that indicates an opaque platform ID.
24998
25439
  * @publicApi
24999
25440
  */
25000
- const PLATFORM_ID = new InjectionToken('Platform ID');
25441
+ const PLATFORM_ID = new InjectionToken('Platform ID', {
25442
+ providedIn: 'platform',
25443
+ factory: () => 'unknown', // set a default platform name, when none set explicitly
25444
+ });
25001
25445
  /**
25002
25446
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
25003
25447
  * be called for every component that is bootstrapped.
@@ -25044,10 +25488,11 @@ class Console {
25044
25488
  }
25045
25489
  }
25046
25490
  Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
25047
- Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac });
25491
+ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });
25048
25492
  (function () {
25049
25493
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
25050
- type: Injectable
25494
+ type: Injectable,
25495
+ args: [{ providedIn: 'platform' }]
25051
25496
  }], null, null);
25052
25497
  })();
25053
25498
 
@@ -26010,10 +26455,11 @@ class TestabilityRegistry {
26010
26455
  }
26011
26456
  }
26012
26457
  TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
26013
- TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac });
26458
+ TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });
26014
26459
  (function () {
26015
26460
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
26016
- type: Injectable
26461
+ type: Injectable,
26462
+ args: [{ providedIn: 'platform' }]
26017
26463
  }], function () { return []; }, null);
26018
26464
  })();
26019
26465
  class _NoopGetTestability {
@@ -26038,7 +26484,20 @@ let _testabilityGetter = new _NoopGetTestability();
26038
26484
  * Use of this source code is governed by an MIT-style license that can be
26039
26485
  * found in the LICENSE file at https://angular.io/license
26040
26486
  */
26041
- let _platform;
26487
+ let _platformInjector = null;
26488
+ /**
26489
+ * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
26490
+ * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
26491
+ */
26492
+ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
26493
+ /**
26494
+ * Internal token that allows to register extra callbacks that should be invoked during the
26495
+ * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
26496
+ * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
26497
+ * entire class tree-shakeable.
26498
+ */
26499
+ const PLATFORM_ON_DESTROY = new InjectionToken('PlatformOnDestroy');
26500
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
26042
26501
  function compileNgModuleFactory(injector, options, moduleType) {
26043
26502
  ngDevMode && assertNgModuleType(moduleType);
26044
26503
  const moduleFactory = new NgModuleFactory(moduleType);
@@ -26083,7 +26542,6 @@ function publishDefaultGlobalUtils() {
26083
26542
  function isBoundToModule(cf) {
26084
26543
  return cf.isBoundToModule;
26085
26544
  }
26086
- const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
26087
26545
  /**
26088
26546
  * A token for third-party components that can register themselves with NgProbe.
26089
26547
  *
@@ -26102,19 +26560,89 @@ class NgProbeToken {
26102
26560
  * @publicApi
26103
26561
  */
26104
26562
  function createPlatform(injector) {
26105
- if (_platform && !_platform.destroyed &&
26106
- !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
26563
+ if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
26107
26564
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26108
26565
  'There can be only one platform. Destroy the previous one to create a new one.' :
26109
26566
  '';
26110
26567
  throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
26111
26568
  }
26112
26569
  publishDefaultGlobalUtils();
26113
- _platform = injector.get(PlatformRef);
26570
+ _platformInjector = injector;
26571
+ const platform = injector.get(PlatformRef);
26572
+ runPlatformInitializers(injector);
26573
+ return platform;
26574
+ }
26575
+ /**
26576
+ * The goal of this function is to bootstrap a platform injector,
26577
+ * but avoid referencing `PlatformRef` class.
26578
+ * This function is needed for bootstrapping a Standalone Component.
26579
+ */
26580
+ function createOrReusePlatformInjector(providers = []) {
26581
+ // If a platform injector already exists, it means that the platform
26582
+ // is already bootstrapped and no additional actions are required.
26583
+ if (_platformInjector)
26584
+ return _platformInjector;
26585
+ // Otherwise, setup a new platform injector and run platform initializers.
26586
+ const injector = createPlatformInjector(providers);
26587
+ _platformInjector = injector;
26588
+ publishDefaultGlobalUtils();
26589
+ runPlatformInitializers(injector);
26590
+ return injector;
26591
+ }
26592
+ function runPlatformInitializers(injector) {
26114
26593
  const inits = injector.get(PLATFORM_INITIALIZER, null);
26115
- if (inits)
26594
+ if (inits) {
26116
26595
  inits.forEach((init) => init());
26117
- return _platform;
26596
+ }
26597
+ }
26598
+ /**
26599
+ * Internal bootstrap application API that implements the core bootstrap logic.
26600
+ *
26601
+ * Platforms (such as `platform-browser`) may require different set of application and platform
26602
+ * providers for an application to function correctly. As a result, platforms may use this function
26603
+ * internally and supply the necessary providers during the bootstrap, while exposing
26604
+ * platform-specific APIs as a part of their public API.
26605
+ *
26606
+ * @returns A promise that returns an `ApplicationRef` instance once resolved.
26607
+ */
26608
+ function bootstrapApplication(config) {
26609
+ const { rootComponent, appProviders, platformProviders } = config;
26610
+ NG_DEV_MODE && assertStandaloneComponentType(rootComponent);
26611
+ const platformInjector = createOrReusePlatformInjector(platformProviders);
26612
+ const ngZone = new NgZone(getNgZoneOptions());
26613
+ return ngZone.run(() => {
26614
+ // Create root application injector based on a set of providers configured at the platform
26615
+ // bootstrap level as well as providers passed to the bootstrap call by a user.
26616
+ const allAppProviders = [
26617
+ { provide: NgZone, useValue: ngZone },
26618
+ ...(appProviders || []), //
26619
+ ];
26620
+ const appInjector = createEnvironmentInjector(allAppProviders, platformInjector, 'Environment Injector');
26621
+ const exceptionHandler = appInjector.get(ErrorHandler, null);
26622
+ if (NG_DEV_MODE && !exceptionHandler) {
26623
+ throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, 'No `ErrorHandler` found in the Dependency Injection tree.');
26624
+ }
26625
+ let onErrorSubscription;
26626
+ ngZone.runOutsideAngular(() => {
26627
+ onErrorSubscription = ngZone.onError.subscribe({
26628
+ next: (error) => {
26629
+ exceptionHandler.handleError(error);
26630
+ }
26631
+ });
26632
+ });
26633
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
26634
+ const initStatus = appInjector.get(ApplicationInitStatus);
26635
+ initStatus.runInitializers();
26636
+ return initStatus.donePromise.then(() => {
26637
+ const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
26638
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
26639
+ const appRef = appInjector.get(ApplicationRef);
26640
+ appRef.onDestroy(() => onErrorSubscription.unsubscribe());
26641
+ appRef.bootstrap(rootComponent);
26642
+ return appRef;
26643
+ });
26644
+ });
26645
+ });
26118
26646
  }
26119
26647
  /**
26120
26648
  * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
@@ -26133,15 +26661,16 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
26133
26661
  return (extraProviders = []) => {
26134
26662
  let platform = getPlatform();
26135
26663
  if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
26664
+ const platformProviders = [
26665
+ ...providers,
26666
+ ...extraProviders,
26667
+ { provide: marker, useValue: true }
26668
+ ];
26136
26669
  if (parentPlatformFactory) {
26137
- parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
26670
+ parentPlatformFactory(platformProviders);
26138
26671
  }
26139
26672
  else {
26140
- const injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true }, {
26141
- provide: INJECTOR_SCOPE,
26142
- useValue: 'platform'
26143
- });
26144
- createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
26673
+ createPlatform(createPlatformInjector(platformProviders, desc));
26145
26674
  }
26146
26675
  }
26147
26676
  return assertPlatform(marker);
@@ -26164,6 +26693,20 @@ function assertPlatform(requiredToken) {
26164
26693
  }
26165
26694
  return platform;
26166
26695
  }
26696
+ /**
26697
+ * Helper function to create an instance of a platform injector (that maintains the 'platform'
26698
+ * scope).
26699
+ */
26700
+ function createPlatformInjector(providers = [], name) {
26701
+ return Injector.create({
26702
+ name,
26703
+ providers: [
26704
+ { provide: INJECTOR_SCOPE, useValue: 'platform' },
26705
+ { provide: PLATFORM_ON_DESTROY, useValue: () => _platformInjector = null },
26706
+ ...providers
26707
+ ],
26708
+ });
26709
+ }
26167
26710
  /**
26168
26711
  * Destroys the current Angular platform and all Angular applications on the page.
26169
26712
  * Destroys all modules and listeners registered with the platform.
@@ -26171,9 +26714,8 @@ function assertPlatform(requiredToken) {
26171
26714
  * @publicApi
26172
26715
  */
26173
26716
  function destroyPlatform() {
26174
- if (_platform && !_platform.destroyed) {
26175
- _platform.destroy();
26176
- }
26717
+ var _a;
26718
+ (_a = getPlatform()) === null || _a === void 0 ? void 0 : _a.destroy();
26177
26719
  }
26178
26720
  /**
26179
26721
  * Returns the current platform.
@@ -26181,7 +26723,8 @@ function destroyPlatform() {
26181
26723
  * @publicApi
26182
26724
  */
26183
26725
  function getPlatform() {
26184
- return _platform && !_platform.destroyed ? _platform : null;
26726
+ var _a;
26727
+ return (_a = _platformInjector === null || _platformInjector === void 0 ? void 0 : _platformInjector.get(PlatformRef)) !== null && _a !== void 0 ? _a : null;
26185
26728
  }
26186
26729
  /**
26187
26730
  * The Angular platform is the entry point for Angular on a web page.
@@ -26211,10 +26754,7 @@ class PlatformRef {
26211
26754
  // as instantiating the module creates some providers eagerly.
26212
26755
  // So we create a mini parent injector that just contains the new NgZone and
26213
26756
  // pass that as parent to the NgModuleFactory.
26214
- const ngZoneOption = options ? options.ngZone : undefined;
26215
- const ngZoneEventCoalescing = (options && options.ngZoneEventCoalescing) || false;
26216
- const ngZoneRunCoalescing = (options && options.ngZoneRunCoalescing) || false;
26217
- const ngZone = getNgZone(ngZoneOption, { ngZoneEventCoalescing, ngZoneRunCoalescing });
26757
+ const ngZone = getNgZone(options === null || options === void 0 ? void 0 : options.ngZone, getNgZoneOptions(options));
26218
26758
  const providers = [{ provide: NgZone, useValue: ngZone }];
26219
26759
  // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
26220
26760
  // created within the Angular zone
@@ -26315,34 +26855,46 @@ class PlatformRef {
26315
26855
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26316
26856
  'The platform has already been destroyed!' :
26317
26857
  '';
26318
- throw new RuntimeError(404 /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26858
+ throw new RuntimeError(404 /* PLATFORM_ALREADY_DESTROYED */, errorMessage);
26319
26859
  }
26320
26860
  this._modules.slice().forEach(module => module.destroy());
26321
26861
  this._destroyListeners.forEach(listener => listener());
26862
+ const destroyListener = this._injector.get(PLATFORM_ON_DESTROY, null);
26863
+ destroyListener === null || destroyListener === void 0 ? void 0 : destroyListener();
26322
26864
  this._destroyed = true;
26323
26865
  }
26866
+ /**
26867
+ * Indicates whether this instance was destroyed.
26868
+ */
26324
26869
  get destroyed() {
26325
26870
  return this._destroyed;
26326
26871
  }
26327
26872
  }
26328
26873
  PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
26329
- PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac });
26874
+ PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' });
26330
26875
  (function () {
26331
26876
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
26332
- type: Injectable
26877
+ type: Injectable,
26878
+ args: [{ providedIn: 'platform' }]
26333
26879
  }], function () { return [{ type: Injector }]; }, null);
26334
26880
  })();
26335
- function getNgZone(ngZoneOption, extra) {
26881
+ // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
26882
+ // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
26883
+ // a set of default options returned.
26884
+ function getNgZoneOptions(options) {
26885
+ return {
26886
+ enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
26887
+ shouldCoalesceEventChangeDetection: !!(options && options.ngZoneEventCoalescing) || false,
26888
+ shouldCoalesceRunChangeDetection: !!(options && options.ngZoneRunCoalescing) || false,
26889
+ };
26890
+ }
26891
+ function getNgZone(ngZoneToUse, options) {
26336
26892
  let ngZone;
26337
- if (ngZoneOption === 'noop') {
26893
+ if (ngZoneToUse === 'noop') {
26338
26894
  ngZone = new NoopNgZone();
26339
26895
  }
26340
26896
  else {
26341
- ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) || new NgZone({
26342
- enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
26343
- shouldCoalesceEventChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneEventCoalescing),
26344
- shouldCoalesceRunChangeDetection: !!(extra === null || extra === void 0 ? void 0 : extra.ngZoneRunCoalescing)
26345
- });
26897
+ ngZone = (ngZoneToUse === 'zone.js' ? undefined : ngZoneToUse) || new NgZone(options);
26346
26898
  }
26347
26899
  return ngZone;
26348
26900
  }
@@ -26468,17 +27020,18 @@ function optionsReducer(dst, objs) {
26468
27020
  */
26469
27021
  class ApplicationRef {
26470
27022
  /** @internal */
26471
- constructor(_zone, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
27023
+ constructor(_zone, _injector, _exceptionHandler, _initStatus) {
26472
27024
  this._zone = _zone;
26473
27025
  this._injector = _injector;
26474
27026
  this._exceptionHandler = _exceptionHandler;
26475
- this._componentFactoryResolver = _componentFactoryResolver;
26476
27027
  this._initStatus = _initStatus;
26477
27028
  /** @internal */
26478
27029
  this._bootstrapListeners = [];
26479
27030
  this._views = [];
26480
27031
  this._runningTick = false;
26481
27032
  this._stable = true;
27033
+ this._destroyed = false;
27034
+ this._destroyListeners = [];
26482
27035
  /**
26483
27036
  * Get a list of component types registered to this application.
26484
27037
  * This list is populated even before the component is created.
@@ -26538,6 +27091,12 @@ class ApplicationRef {
26538
27091
  this.isStable =
26539
27092
  merge$1(isCurrentlyStable, isStable.pipe(share()));
26540
27093
  }
27094
+ /**
27095
+ * Indicates whether this instance was destroyed.
27096
+ */
27097
+ get destroyed() {
27098
+ return this._destroyed;
27099
+ }
26541
27100
  /**
26542
27101
  * Bootstrap a component onto the element identified by its selector or, optionally, to a
26543
27102
  * specified element.
@@ -26576,20 +27135,22 @@ class ApplicationRef {
26576
27135
  * {@example core/ts/platform/platform.ts region='domNode'}
26577
27136
  */
26578
27137
  bootstrap(componentOrFactory, rootSelectorOrNode) {
27138
+ NG_DEV_MODE && this.warnIfDestroyed();
27139
+ const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
26579
27140
  if (!this._initStatus.done) {
26580
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26581
- 'Cannot bootstrap as there are still asynchronous initializers running. ' +
26582
- 'Bootstrap components in the `ngDoBootstrap` method of the root module.' :
26583
- '';
26584
- throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
27141
+ const standalone = !isComponentFactory && isStandalone(componentOrFactory);
27142
+ const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
27143
+ (standalone ? '' :
27144
+ ' Bootstrap components in the `ngDoBootstrap` method of the root module.');
27145
+ throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, NG_DEV_MODE && errorMessage);
26585
27146
  }
26586
27147
  let componentFactory;
26587
- if (componentOrFactory instanceof ComponentFactory$1) {
27148
+ if (isComponentFactory) {
26588
27149
  componentFactory = componentOrFactory;
26589
27150
  }
26590
27151
  else {
26591
- componentFactory =
26592
- this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
27152
+ const resolver = this._injector.get(ComponentFactoryResolver$1);
27153
+ componentFactory = resolver.resolveComponentFactory(componentOrFactory);
26593
27154
  }
26594
27155
  this.componentTypes.push(componentFactory.componentType);
26595
27156
  // Create a factory associated with the current module if it's not bound to some other
@@ -26627,6 +27188,7 @@ class ApplicationRef {
26627
27188
  * detection pass during which all change detection must complete.
26628
27189
  */
26629
27190
  tick() {
27191
+ NG_DEV_MODE && this.warnIfDestroyed();
26630
27192
  if (this._runningTick) {
26631
27193
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26632
27194
  'ApplicationRef.tick is called recursively' :
@@ -26658,6 +27220,7 @@ class ApplicationRef {
26658
27220
  * This will throw if the view is already attached to a ViewContainer.
26659
27221
  */
26660
27222
  attachView(viewRef) {
27223
+ NG_DEV_MODE && this.warnIfDestroyed();
26661
27224
  const view = viewRef;
26662
27225
  this._views.push(view);
26663
27226
  view.attachToAppRef(this);
@@ -26666,6 +27229,7 @@ class ApplicationRef {
26666
27229
  * Detaches a view from dirty checking again.
26667
27230
  */
26668
27231
  detachView(viewRef) {
27232
+ NG_DEV_MODE && this.warnIfDestroyed();
26669
27233
  const view = viewRef;
26670
27234
  remove(this._views, view);
26671
27235
  view.detachFromAppRef();
@@ -26680,8 +27244,48 @@ class ApplicationRef {
26680
27244
  }
26681
27245
  /** @internal */
26682
27246
  ngOnDestroy() {
26683
- this._views.slice().forEach((view) => view.destroy());
26684
- this._onMicrotaskEmptySubscription.unsubscribe();
27247
+ if (this._destroyed)
27248
+ return;
27249
+ try {
27250
+ // Call all the lifecycle hooks.
27251
+ this._destroyListeners.forEach(listener => listener());
27252
+ // Destroy all registered views.
27253
+ this._views.slice().forEach((view) => view.destroy());
27254
+ this._onMicrotaskEmptySubscription.unsubscribe();
27255
+ }
27256
+ finally {
27257
+ // Indicate that this instance is destroyed.
27258
+ this._destroyed = true;
27259
+ // Release all references.
27260
+ this._views = [];
27261
+ this._bootstrapListeners = [];
27262
+ this._destroyListeners = [];
27263
+ }
27264
+ }
27265
+ /**
27266
+ * Registers a listener to be called when an instance is destroyed.
27267
+ *
27268
+ * @param callback A callback function to add as a listener.
27269
+ * @returns A function which unregisters a listener.
27270
+ *
27271
+ * @internal
27272
+ */
27273
+ onDestroy(callback) {
27274
+ NG_DEV_MODE && this.warnIfDestroyed();
27275
+ this._destroyListeners.push(callback);
27276
+ return () => remove(this._destroyListeners, callback);
27277
+ }
27278
+ destroy() {
27279
+ if (this._destroyed) {
27280
+ throw new RuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
27281
+ }
27282
+ const injector = this._injector;
27283
+ // Check that this injector instance supports destroy operation.
27284
+ if (injector.destroy && !injector.destroyed) {
27285
+ // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
27286
+ // hook, which invokes the remaining cleanup actions.
27287
+ injector.destroy();
27288
+ }
26685
27289
  }
26686
27290
  /**
26687
27291
  * Returns the number of attached views.
@@ -26689,14 +27293,19 @@ class ApplicationRef {
26689
27293
  get viewCount() {
26690
27294
  return this._views.length;
26691
27295
  }
27296
+ warnIfDestroyed() {
27297
+ if (NG_DEV_MODE && this._destroyed) {
27298
+ console.warn(formatRuntimeError(406 /* APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
27299
+ }
27300
+ }
26692
27301
  }
26693
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver$1), ɵɵinject(ApplicationInitStatus)); };
27302
+ ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
26694
27303
  ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
26695
27304
  (function () {
26696
27305
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
26697
27306
  type: Injectable,
26698
27307
  args: [{ providedIn: 'root' }]
26699
- }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver$1 }, { type: ApplicationInitStatus }]; }, null);
27308
+ }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null);
26700
27309
  })();
26701
27310
  function remove(list, el) {
26702
27311
  const index = list.indexOf(el);
@@ -28680,19 +29289,12 @@ const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
28680
29289
  * Use of this source code is governed by an MIT-style license that can be
28681
29290
  * found in the LICENSE file at https://angular.io/license
28682
29291
  */
28683
- const _CORE_PLATFORM_PROVIDERS = [
28684
- // Set a default platform name for platforms that don't set it explicitly.
28685
- { provide: PLATFORM_ID, useValue: 'unknown' },
28686
- { provide: PlatformRef, deps: [Injector] },
28687
- { provide: TestabilityRegistry, deps: [] },
28688
- { provide: Console, deps: [] },
28689
- ];
28690
29292
  /**
28691
29293
  * This platform has to be included in any other platform
28692
29294
  *
28693
29295
  * @publicApi
28694
29296
  */
28695
- const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
29297
+ const platformCore = createPlatformFactory(null, 'core', []);
28696
29298
 
28697
29299
  /**
28698
29300
  * Re-exported by `BrowserModule`, which is included automatically in the root
@@ -28884,5 +29486,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
28884
29486
  * Generated bundle index. Do not edit.
28885
29487
  */
28886
29488
 
28887
- 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 };
29489
+ export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, 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 };
28888
29490
  //# sourceMappingURL=core.mjs.map