@angular/core 14.0.1 → 14.0.4

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 (35) hide show
  1. package/esm2020/src/application_ref.mjs +31 -35
  2. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +3 -5
  3. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +3 -5
  4. package/esm2020/src/change_detection/differs/iterable_differs.mjs +3 -5
  5. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -5
  6. package/esm2020/src/di/injector_compatibility.mjs +6 -16
  7. package/esm2020/src/di/jit/util.mjs +3 -2
  8. package/esm2020/src/di/reflective_key.mjs +3 -2
  9. package/esm2020/src/errors.mjs +1 -1
  10. package/esm2020/src/i18n/locale_data_api.mjs +3 -2
  11. package/esm2020/src/render3/component.mjs +3 -2
  12. package/esm2020/src/render3/features/inherit_definition_feature.mjs +3 -5
  13. package/esm2020/src/render3/interfaces/renderer.mjs +10 -1
  14. package/esm2020/src/render3/jit/directive.mjs +20 -3
  15. package/esm2020/src/render3/jit/module.mjs +2 -1
  16. package/esm2020/src/render3/view_ref.mjs +3 -5
  17. package/esm2020/src/sanitization/sanitization.mjs +4 -9
  18. package/esm2020/src/version.mjs +1 -1
  19. package/esm2020/src/zone/ng_zone.mjs +5 -4
  20. package/esm2020/testing/src/logger.mjs +3 -3
  21. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  22. package/esm2020/testing/src/r3_test_bed_compiler.mjs +30 -25
  23. package/fesm2015/core.mjs +87 -90
  24. package/fesm2015/core.mjs.map +1 -1
  25. package/fesm2015/testing.mjs +122 -125
  26. package/fesm2015/testing.mjs.map +1 -1
  27. package/fesm2020/core.mjs +87 -90
  28. package/fesm2020/core.mjs.map +1 -1
  29. package/fesm2020/testing.mjs +122 -125
  30. package/fesm2020/testing.mjs.map +1 -1
  31. package/index.d.ts +6 -6
  32. package/package.json +1 -1
  33. package/testing/index.d.ts +1 -1
  34. package/schematics/utils/schematics_prompt.d.ts +0 -17
  35. package/schematics/utils/schematics_prompt.js +0 -45
package/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.1
2
+ * @license Angular v14.0.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1658,8 +1658,17 @@ var RendererStyleFlags3;
1658
1658
  function isProceduralRenderer(renderer) {
1659
1659
  return !!(renderer.listen);
1660
1660
  }
1661
+ let renderer3Enabled = false;
1662
+ function enableRenderer3() {
1663
+ renderer3Enabled = true;
1664
+ }
1661
1665
  const domRendererFactory3 = {
1662
1666
  createRenderer: (hostElement, rendererType) => {
1667
+ if (!renderer3Enabled) {
1668
+ throw new Error(ngDevMode ?
1669
+ `Renderer3 is not supported. This problem is likely caused by some component in the hierarchy was constructed without a correct parent injector.` :
1670
+ 'Renderer3 disabled');
1671
+ }
1663
1672
  return getDocument();
1664
1673
  }
1665
1674
  };
@@ -4837,10 +4846,8 @@ function setCurrentInjector(injector) {
4837
4846
  }
4838
4847
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
4839
4848
  if (_currentInjector === undefined) {
4840
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4841
- `inject() must be called from an injection context (a constructor, a factory function or a field initializer)` :
4842
- '';
4843
- throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
4849
+ throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
4850
+ `inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
4844
4851
  }
4845
4852
  else if (_currentInjector === null) {
4846
4853
  return injectRootLimpMode(token, undefined, flags);
@@ -4856,22 +4863,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
4856
4863
  * Throws an error indicating that a factory function could not be generated by the compiler for a
4857
4864
  * particular class.
4858
4865
  *
4859
- * This instruction allows the actual error message to be optimized away when ngDevMode is turned
4860
- * off, saving bytes of generated code while still providing a good experience in dev mode.
4861
- *
4862
4866
  * The name of the class is not mentioned here, but will be in the generated factory function name
4863
4867
  * and thus in the stack trace.
4864
4868
  *
4865
4869
  * @codeGenApi
4866
4870
  */
4867
4871
  function ɵɵinvalidFactoryDep(index) {
4868
- const msg = ngDevMode ?
4872
+ throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
4869
4873
  `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
4870
4874
  This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
4871
4875
 
4872
- Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.` :
4873
- 'invalid';
4874
- throw new Error(msg);
4876
+ Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
4875
4877
  }
4876
4878
  /**
4877
4879
  * Injects a token from the currently active injector.
@@ -4946,10 +4948,7 @@ function injectArgs(types) {
4946
4948
  const arg = resolveForwardRef(types[i]);
4947
4949
  if (Array.isArray(arg)) {
4948
4950
  if (arg.length === 0) {
4949
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4950
- 'Arguments array must have arguments.' :
4951
- '';
4952
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
4951
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
4953
4952
  }
4954
4953
  let type = undefined;
4955
4954
  let flags = InjectFlags.Default;
@@ -5138,7 +5137,7 @@ function reflectDependency(dep) {
5138
5137
  }
5139
5138
  else if (param instanceof Attribute) {
5140
5139
  if (param.attributeName === undefined) {
5141
- throw new Error(`Attribute name must be defined.`);
5140
+ throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
5142
5141
  }
5143
5142
  meta.attribute = param.attributeName;
5144
5143
  }
@@ -6200,10 +6199,8 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
6200
6199
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
6201
6200
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
6202
6201
  }
6203
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6204
- 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
6205
- '';
6206
- throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
6202
+ throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
6203
+ 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
6207
6204
  }
6208
6205
  /**
6209
6206
  * A `script` sanitizer which only lets trusted javascript through.
@@ -6225,10 +6222,7 @@ function ɵɵsanitizeScript(unsafeScript) {
6225
6222
  if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
6226
6223
  return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
6227
6224
  }
6228
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6229
- 'unsafe value used in a script context' :
6230
- '';
6231
- throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
6225
+ throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
6232
6226
  }
6233
6227
  /**
6234
6228
  * A template tag function for promoting the associated constant literal to a
@@ -9814,7 +9808,7 @@ class ReflectiveKey {
9814
9808
  this.token = token;
9815
9809
  this.id = id;
9816
9810
  if (!token) {
9817
- throw new Error('Token must be defined!');
9811
+ throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
9818
9812
  }
9819
9813
  this.displayName = stringify(this.token);
9820
9814
  }
@@ -13885,6 +13879,7 @@ const NULL_INJECTOR = {
13885
13879
  function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
13886
13880
  ngDevMode && publishDefaultGlobalUtils$1();
13887
13881
  ngDevMode && assertComponentType(componentType);
13882
+ enableRenderer3();
13888
13883
  const rendererFactory = opts.rendererFactory || domRendererFactory3;
13889
13884
  const sanitizer = opts.sanitizer || null;
13890
13885
  const componentDef = getComponentDef(componentType);
@@ -14072,10 +14067,8 @@ function ɵɵInheritDefinitionFeature(definition) {
14072
14067
  }
14073
14068
  else {
14074
14069
  if (superType.ɵcmp) {
14075
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
14076
- `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
14077
- '';
14078
- throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, errorMessage);
14070
+ throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
14071
+ `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
14079
14072
  }
14080
14073
  // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14081
14074
  superDef = superType.ɵdir;
@@ -19196,7 +19189,7 @@ function findLocaleData(locale) {
19196
19189
  if (parentLocale === 'en') {
19197
19190
  return localeEn;
19198
19191
  }
19199
- throw new Error(`Missing locale data for the locale "${locale}".`);
19192
+ throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
19200
19193
  }
19201
19194
  /**
19202
19195
  * Retrieves the default currency code for the given locale.
@@ -21772,7 +21765,7 @@ class Version {
21772
21765
  /**
21773
21766
  * @publicApi
21774
21767
  */
21775
- const VERSION = new Version('14.0.1');
21768
+ const VERSION = new Version('14.0.4');
21776
21769
 
21777
21770
  /**
21778
21771
  * @license
@@ -22110,8 +22103,7 @@ class ViewRef$1 {
22110
22103
  }
22111
22104
  attachToViewContainerRef() {
22112
22105
  if (this._appRef) {
22113
- const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
22114
- throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
22106
+ throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');
22115
22107
  }
22116
22108
  this._attachedToViewContainer = true;
22117
22109
  }
@@ -22121,8 +22113,7 @@ class ViewRef$1 {
22121
22113
  }
22122
22114
  attachToAppRef(appRef) {
22123
22115
  if (this._attachedToViewContainer) {
22124
- const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
22125
- throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
22116
+ throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
22126
22117
  }
22127
22118
  this._appRef = appRef;
22128
22119
  }
@@ -24813,6 +24804,7 @@ function setScopeOnDeclaredComponents(moduleType, ngModule) {
24813
24804
  const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
24814
24805
  const transitiveScopes = transitiveScopesFor(moduleType);
24815
24806
  declarations.forEach(declaration => {
24807
+ declaration = resolveForwardRef(declaration);
24816
24808
  if (declaration.hasOwnProperty(NG_COMP_DEF)) {
24817
24809
  // A `ɵcmp` field exists - go ahead and patch the component directly.
24818
24810
  const component = declaration;
@@ -25152,14 +25144,20 @@ function getStandaloneDefFunctions(type, imports) {
25152
25144
  // Standalone components are always able to self-reference, so include the component's own
25153
25145
  // definition in its `directiveDefs`.
25154
25146
  cachedDirectiveDefs = [getComponentDef(type)];
25147
+ const seen = new Set();
25155
25148
  for (const rawDep of imports) {
25156
25149
  ngDevMode && verifyStandaloneImport(rawDep, type);
25157
25150
  const dep = resolveForwardRef(rawDep);
25151
+ if (seen.has(dep)) {
25152
+ continue;
25153
+ }
25154
+ seen.add(dep);
25158
25155
  if (!!getNgModuleDef(dep)) {
25159
25156
  const scope = transitiveScopesFor(dep);
25160
25157
  for (const dir of scope.exported.directives) {
25161
25158
  const def = getComponentDef(dir) || getDirectiveDef(dir);
25162
- if (def) {
25159
+ if (def && !seen.has(dir)) {
25160
+ seen.add(dir);
25163
25161
  cachedDirectiveDefs.push(def);
25164
25162
  }
25165
25163
  }
@@ -25177,11 +25175,22 @@ function getStandaloneDefFunctions(type, imports) {
25177
25175
  const pipeDefs = () => {
25178
25176
  if (cachedPipeDefs === null) {
25179
25177
  cachedPipeDefs = [];
25178
+ const seen = new Set();
25180
25179
  for (const rawDep of imports) {
25181
25180
  const dep = resolveForwardRef(rawDep);
25181
+ if (seen.has(dep)) {
25182
+ continue;
25183
+ }
25184
+ seen.add(dep);
25182
25185
  if (!!getNgModuleDef(dep)) {
25183
25186
  const scope = transitiveScopesFor(dep);
25184
- cachedPipeDefs.push(...Array.from(scope.exported.pipes).map(pipe => getPipeDef$1(pipe)));
25187
+ for (const pipe of scope.exported.pipes) {
25188
+ const def = getPipeDef$1(pipe);
25189
+ if (def && !seen.has(pipe)) {
25190
+ seen.add(pipe);
25191
+ cachedPipeDefs.push(def);
25192
+ }
25193
+ }
25185
25194
  }
25186
25195
  else {
25187
25196
  const def = getPipeDef$1(dep);
@@ -26293,7 +26302,7 @@ class NgZone {
26293
26302
  */
26294
26303
  this.onError = new EventEmitter(false);
26295
26304
  if (typeof Zone == 'undefined') {
26296
- throw new Error(`In this configuration Angular requires Zone.js`);
26305
+ throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
26297
26306
  }
26298
26307
  Zone.assertZonePatched();
26299
26308
  const self = this;
@@ -26320,12 +26329,12 @@ class NgZone {
26320
26329
  }
26321
26330
  static assertInAngularZone() {
26322
26331
  if (!NgZone.isInAngularZone()) {
26323
- throw new Error('Expected to be in Angular Zone, but it is not!');
26332
+ throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
26324
26333
  }
26325
26334
  }
26326
26335
  static assertNotInAngularZone() {
26327
26336
  if (NgZone.isInAngularZone()) {
26328
- throw new Error('Expected to not be in Angular Zone, but it is!');
26337
+ throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
26329
26338
  }
26330
26339
  }
26331
26340
  /**
@@ -26896,7 +26905,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
26896
26905
  * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
26897
26906
  * entire class tree-shakeable.
26898
26907
  */
26899
- const PLATFORM_ON_DESTROY = new InjectionToken('PlatformOnDestroy');
26908
+ const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
26900
26909
  const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
26901
26910
  function compileNgModuleFactory(injector, options, moduleType) {
26902
26911
  ngDevMode && assertNgModuleType(moduleType);
@@ -26961,10 +26970,8 @@ class NgProbeToken {
26961
26970
  */
26962
26971
  function createPlatform(injector) {
26963
26972
  if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
26964
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26965
- 'There can be only one platform. Destroy the previous one to create a new one.' :
26966
- '';
26967
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
26973
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
26974
+ 'There can be only one platform. Destroy the previous one to create a new one.');
26968
26975
  }
26969
26976
  publishDefaultGlobalUtils();
26970
26977
  _platformInjector = injector;
@@ -27037,7 +27044,15 @@ function internalBootstrapApplication(config) {
27037
27044
  const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
27038
27045
  setLocaleId(localeId || DEFAULT_LOCALE_ID);
27039
27046
  const appRef = appInjector.get(ApplicationRef);
27040
- appRef.onDestroy(() => onErrorSubscription.unsubscribe());
27047
+ // If the whole platform is destroyed, invoke the `destroy` method
27048
+ // for all bootstrapped applications as well.
27049
+ const destroyListener = () => appRef.destroy();
27050
+ const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
27051
+ onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.add(destroyListener);
27052
+ appRef.onDestroy(() => {
27053
+ onPlatformDestroyListeners === null || onPlatformDestroyListeners === void 0 ? void 0 : onPlatformDestroyListeners.delete(destroyListener);
27054
+ onErrorSubscription.unsubscribe();
27055
+ });
27041
27056
  appRef.bootstrap(rootComponent);
27042
27057
  return appRef;
27043
27058
  });
@@ -27084,8 +27099,7 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
27084
27099
  function assertPlatform(requiredToken) {
27085
27100
  const platform = getPlatform();
27086
27101
  if (!platform) {
27087
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
27088
- throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
27102
+ throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
27089
27103
  }
27090
27104
  if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
27091
27105
  !platform.injector.get(requiredToken, null)) {
@@ -27102,7 +27116,7 @@ function createPlatformInjector(providers = [], name) {
27102
27116
  name,
27103
27117
  providers: [
27104
27118
  { provide: INJECTOR_SCOPE, useValue: 'platform' },
27105
- { provide: PLATFORM_ON_DESTROY, useValue: () => _platformInjector = null },
27119
+ { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
27106
27120
  ...providers
27107
27121
  ],
27108
27122
  });
@@ -27165,10 +27179,7 @@ class PlatformRef {
27165
27179
  const moduleRef = moduleFactory.create(ngZoneInjector);
27166
27180
  const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
27167
27181
  if (!exceptionHandler) {
27168
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27169
- 'No ErrorHandler. Is platform module (BrowserModule) included?' :
27170
- '';
27171
- throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
27182
+ throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');
27172
27183
  }
27173
27184
  ngZone.runOutsideAngular(() => {
27174
27185
  const subscription = ngZone.onError.subscribe({
@@ -27224,12 +27235,10 @@ class PlatformRef {
27224
27235
  moduleRef.instance.ngDoBootstrap(appRef);
27225
27236
  }
27226
27237
  else {
27227
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27238
+ throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
27228
27239
  `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
27229
27240
  `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
27230
- `Please define one of these.` :
27231
- '';
27232
- throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
27241
+ `Please define one of these.`);
27233
27242
  }
27234
27243
  this._modules.push(moduleRef);
27235
27244
  }
@@ -27252,15 +27261,15 @@ class PlatformRef {
27252
27261
  */
27253
27262
  destroy() {
27254
27263
  if (this._destroyed) {
27255
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27256
- 'The platform has already been destroyed!' :
27257
- '';
27258
- throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
27264
+ throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
27259
27265
  }
27260
27266
  this._modules.slice().forEach(module => module.destroy());
27261
27267
  this._destroyListeners.forEach(listener => listener());
27262
- const destroyListener = this._injector.get(PLATFORM_ON_DESTROY, null);
27263
- destroyListener === null || destroyListener === void 0 ? void 0 : destroyListener();
27268
+ const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
27269
+ if (destroyListeners) {
27270
+ destroyListeners.forEach(listener => listener());
27271
+ destroyListeners.clear();
27272
+ }
27264
27273
  this._destroyed = true;
27265
27274
  }
27266
27275
  /**
@@ -27420,11 +27429,10 @@ function optionsReducer(dst, objs) {
27420
27429
  */
27421
27430
  class ApplicationRef {
27422
27431
  /** @internal */
27423
- constructor(_zone, _injector, _exceptionHandler, _initStatus) {
27432
+ constructor(_zone, _injector, _exceptionHandler) {
27424
27433
  this._zone = _zone;
27425
27434
  this._injector = _injector;
27426
27435
  this._exceptionHandler = _exceptionHandler;
27427
- this._initStatus = _initStatus;
27428
27436
  /** @internal */
27429
27437
  this._bootstrapListeners = [];
27430
27438
  this._views = [];
@@ -27541,7 +27549,8 @@ class ApplicationRef {
27541
27549
  bootstrap(componentOrFactory, rootSelectorOrNode) {
27542
27550
  NG_DEV_MODE && this.warnIfDestroyed();
27543
27551
  const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
27544
- if (!this._initStatus.done) {
27552
+ const initStatus = this._injector.get(ApplicationInitStatus);
27553
+ if (!initStatus.done) {
27545
27554
  const standalone = !isComponentFactory && isStandalone(componentOrFactory);
27546
27555
  const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
27547
27556
  (standalone ? '' :
@@ -27589,10 +27598,7 @@ class ApplicationRef {
27589
27598
  tick() {
27590
27599
  NG_DEV_MODE && this.warnIfDestroyed();
27591
27600
  if (this._runningTick) {
27592
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27593
- 'ApplicationRef.tick is called recursively' :
27594
- '';
27595
- throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
27601
+ throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
27596
27602
  }
27597
27603
  try {
27598
27604
  this._runningTick = true;
@@ -27681,7 +27687,7 @@ class ApplicationRef {
27681
27687
  */
27682
27688
  destroy() {
27683
27689
  if (this._destroyed) {
27684
- throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
27690
+ throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
27685
27691
  }
27686
27692
  const injector = this._injector;
27687
27693
  // Check that this injector instance supports destroy operation.
@@ -27703,13 +27709,13 @@ class ApplicationRef {
27703
27709
  }
27704
27710
  }
27705
27711
  }
27706
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
27712
+ ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)); };
27707
27713
  ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
27708
27714
  (function () {
27709
27715
  (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
27710
27716
  type: Injectable,
27711
27717
  args: [{ providedIn: 'root' }]
27712
- }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null);
27718
+ }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }]; }, null);
27713
27719
  })();
27714
27720
  function remove(list, el) {
27715
27721
  const index = list.indexOf(el);
@@ -28720,10 +28726,8 @@ class DefaultIterableDiffer {
28720
28726
  if (collection == null)
28721
28727
  collection = [];
28722
28728
  if (!isListLikeIterable(collection)) {
28723
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28724
- `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
28725
- '';
28726
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
28729
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
28730
+ `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
28727
28731
  }
28728
28732
  if (this.check(collection)) {
28729
28733
  return this;
@@ -29324,10 +29328,8 @@ class DefaultKeyValueDiffer {
29324
29328
  map = new Map();
29325
29329
  }
29326
29330
  else if (!(map instanceof Map || isJsObject(map))) {
29327
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29328
- `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
29329
- '';
29330
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
29331
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
29332
+ `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
29331
29333
  }
29332
29334
  return this.check(map) ? this : null;
29333
29335
  }
@@ -29574,10 +29576,8 @@ class IterableDiffers {
29574
29576
  return factory;
29575
29577
  }
29576
29578
  else {
29577
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29578
- `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
29579
- '';
29580
- throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
29579
+ throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&
29580
+ `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
29581
29581
  }
29582
29582
  }
29583
29583
  }
@@ -29651,10 +29651,7 @@ class KeyValueDiffers {
29651
29651
  if (factory) {
29652
29652
  return factory;
29653
29653
  }
29654
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29655
- `Cannot find a differ supporting object '${kv}'` :
29656
- '';
29657
- throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
29654
+ throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
29658
29655
  }
29659
29656
  }
29660
29657
  /** @nocollapse */