@angular/core 13.1.0-next.3 → 13.1.3

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 (41) hide show
  1. package/core.d.ts +49 -27
  2. package/esm2020/src/application_ref.mjs +10 -10
  3. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +6 -2
  4. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +6 -2
  5. package/esm2020/src/change_detection/differs/iterable_differs.mjs +6 -2
  6. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +6 -2
  7. package/esm2020/src/core_private_export.mjs +2 -2
  8. package/esm2020/src/di/injector_compatibility.mjs +10 -3
  9. package/esm2020/src/di/r3_injector.mjs +16 -5
  10. package/esm2020/src/error_details_base_url.mjs +16 -0
  11. package/esm2020/src/error_handler.mjs +2 -2
  12. package/esm2020/src/errors.mjs +18 -12
  13. package/esm2020/src/metadata/directives.mjs +2 -2
  14. package/esm2020/src/render3/errors.mjs +4 -6
  15. package/esm2020/src/render3/errors_di.mjs +11 -4
  16. package/esm2020/src/render3/features/inherit_definition_feature.mjs +6 -2
  17. package/esm2020/src/render3/i18n/i18n_apply.mjs +5 -2
  18. package/esm2020/src/render3/i18n/i18n_parse.mjs +2 -2
  19. package/esm2020/src/render3/instructions/element.mjs +3 -3
  20. package/esm2020/src/render3/instructions/shared.mjs +4 -4
  21. package/esm2020/src/render3/ng_module_ref.mjs +2 -2
  22. package/esm2020/src/render3/pipe.mjs +3 -3
  23. package/esm2020/src/render3/view_ref.mjs +6 -3
  24. package/esm2020/src/sanitization/sanitization.mjs +14 -7
  25. package/esm2020/src/util/errors.mjs +10 -2
  26. package/esm2020/src/version.mjs +1 -1
  27. package/esm2020/testing/src/logger.mjs +3 -3
  28. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  29. package/fesm2015/core.mjs +98 -79
  30. package/fesm2015/core.mjs.map +1 -1
  31. package/fesm2015/testing.mjs +2 -2
  32. package/fesm2020/core.mjs +98 -79
  33. package/fesm2020/core.mjs.map +1 -1
  34. package/fesm2020/testing.mjs +2 -2
  35. package/package.json +1 -1
  36. package/schematics/utils/import_manager.d.ts +0 -5
  37. package/schematics/utils/import_manager.js +3 -7
  38. package/schematics/utils/typescript/imports.js +2 -5
  39. package/testing/testing.d.ts +2 -2
  40. package/esm2020/src/render3/error_code.mjs +0 -42
  41. package/esm2020/src/render3/error_details_base_url.mjs +0 -16
package/fesm2015/core.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v13.1.0-next.3
3
- * (c) 2010-2021 Google LLC. https://angular.io/
2
+ * @license Angular v13.1.3
3
+ * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -141,7 +141,7 @@ function isForwardRef(fn) {
141
141
  *
142
142
  * Keep the files below in full sync:
143
143
  * - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
144
- * - packages/core/src/render3/error_details_base_url.ts
144
+ * - packages/core/src/error_details_base_url.ts
145
145
  */
146
146
  const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
147
147
 
@@ -158,30 +158,15 @@ class RuntimeError extends Error {
158
158
  this.code = code;
159
159
  }
160
160
  }
161
- // Contains a set of error messages that have details guides at angular.io.
162
- // Full list of available error guides can be found at https://angular.io/errors
163
- /* tslint:disable:no-toplevel-property-access */
164
- const RUNTIME_ERRORS_WITH_GUIDES = new Set([
165
- "100" /* EXPRESSION_CHANGED_AFTER_CHECKED */,
166
- "200" /* CYCLIC_DI_DEPENDENCY */,
167
- "201" /* PROVIDER_NOT_FOUND */,
168
- "300" /* MULTIPLE_COMPONENTS_MATCH */,
169
- "301" /* EXPORT_NOT_FOUND */,
170
- "302" /* PIPE_NOT_FOUND */,
171
- ]);
172
- /* tslint:enable:no-toplevel-property-access */
173
161
  /** Called to format a runtime error */
174
162
  function formatRuntimeError(code, message) {
175
- const fullCode = code ? `NG0${code}: ` : '';
176
- let errorMessage = `${fullCode}${message}`;
177
- // Some runtime errors are still thrown without `ngDevMode` (for example
178
- // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling
179
- // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.
180
- // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added
181
- // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check
182
- // from this code).
183
- if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {
184
- errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/NG0${code}`;
163
+ const codeAsNumber = code;
164
+ // Error code might be a negative number, which is a special marker that instructs the logic to
165
+ // generate a link to the error details page on angular.io.
166
+ const fullCode = `NG0${Math.abs(codeAsNumber)}`;
167
+ let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;
168
+ if (ngDevMode && codeAsNumber < 0) {
169
+ errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
185
170
  }
186
171
  return errorMessage;
187
172
  }
@@ -222,10 +207,17 @@ function stringifyForError(value) {
222
207
  return renderStringify(value);
223
208
  }
224
209
 
210
+ /**
211
+ * @license
212
+ * Copyright Google LLC All Rights Reserved.
213
+ *
214
+ * Use of this source code is governed by an MIT-style license that can be
215
+ * found in the LICENSE file at https://angular.io/license
216
+ */
225
217
  /** Called when directives inject each other (creating a circular dependency) */
226
218
  function throwCyclicDependencyError(token, path) {
227
219
  const depPath = path ? `. Dependency path: ${path.join(' > ')} > ${token}` : '';
228
- throw new RuntimeError("200" /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
220
+ throw new RuntimeError(-200 /* CYCLIC_DI_DEPENDENCY */, `Circular dependency in DI detected for ${token}${depPath}`);
229
221
  }
230
222
  function throwMixedMultiProviderError() {
231
223
  throw new Error(`Cannot mix multi providers and regular providers`);
@@ -242,7 +234,7 @@ function throwInvalidProviderError(ngModuleType, providers, provider) {
242
234
  /** Throws an error when a token is not found in DI. */
243
235
  function throwProviderNotFoundError(token, injectorName) {
244
236
  const injectorDetails = injectorName ? ` in ${injectorName}` : '';
245
- throw new RuntimeError("201" /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
237
+ throw new RuntimeError(-201 /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
246
238
  }
247
239
 
248
240
  /**
@@ -4737,7 +4729,10 @@ function setCurrentInjector(injector) {
4737
4729
  }
4738
4730
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
4739
4731
  if (_currentInjector === undefined) {
4740
- throw new Error(`inject() must be called from an injection context`);
4732
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4733
+ `inject() must be called from an injection context` :
4734
+ '';
4735
+ throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
4741
4736
  }
4742
4737
  else if (_currentInjector === null) {
4743
4738
  return injectRootLimpMode(token, undefined, flags);
@@ -4801,7 +4796,10 @@ function injectArgs(types) {
4801
4796
  const arg = resolveForwardRef(types[i]);
4802
4797
  if (Array.isArray(arg)) {
4803
4798
  if (arg.length === 0) {
4804
- throw new Error('Arguments array must have arguments.');
4799
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4800
+ 'Arguments array must have arguments.' :
4801
+ '';
4802
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
4805
4803
  }
4806
4804
  let type = undefined;
4807
4805
  let flags = InjectFlags.Default;
@@ -5998,7 +5996,10 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
5998
5996
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
5999
5997
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
6000
5998
  }
6001
- throw new Error('unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
5999
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6000
+ 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
6001
+ '';
6002
+ throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
6002
6003
  }
6003
6004
  /**
6004
6005
  * A `script` sanitizer which only lets trusted javascript through.
@@ -6020,7 +6021,10 @@ function ɵɵsanitizeScript(unsafeScript) {
6020
6021
  if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
6021
6022
  return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
6022
6023
  }
6023
- throw new Error('unsafe value used in a script context');
6024
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6025
+ 'unsafe value used in a script context' :
6026
+ '';
6027
+ throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
6024
6028
  }
6025
6029
  /**
6026
6030
  * A template tag function for promoting the associated constant literal to a
@@ -6108,18 +6112,18 @@ function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
6108
6112
  }
6109
6113
  function validateAgainstEventProperties(name) {
6110
6114
  if (name.toLowerCase().startsWith('on')) {
6111
- const msg = `Binding to event property '${name}' is disallowed for security reasons, ` +
6115
+ const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
6112
6116
  `please use (${name.slice(2)})=...` +
6113
6117
  `\nIf '${name}' is a directive input, make sure the directive is imported by the` +
6114
6118
  ` current module.`;
6115
- throw new Error(msg);
6119
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6116
6120
  }
6117
6121
  }
6118
6122
  function validateAgainstEventAttributes(name) {
6119
6123
  if (name.toLowerCase().startsWith('on')) {
6120
- const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6124
+ const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
6121
6125
  `please use (${name.slice(2)})=...`;
6122
- throw new Error(msg);
6126
+ throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
6123
6127
  }
6124
6128
  }
6125
6129
  function getSanitizer() {
@@ -6439,7 +6443,6 @@ function discoverLocalRefs(lView, nodeIndex) {
6439
6443
  * Use of this source code is governed by an MIT-style license that can be
6440
6444
  * found in the LICENSE file at https://angular.io/license
6441
6445
  */
6442
- const ERROR_TYPE = 'ngType';
6443
6446
  const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
6444
6447
  const ERROR_LOGGER = 'ngErrorLogger';
6445
6448
  function wrappedError(message, originalError) {
@@ -6448,17 +6451,6 @@ function wrappedError(message, originalError) {
6448
6451
  error[ERROR_ORIGINAL_ERROR] = originalError;
6449
6452
  return error;
6450
6453
  }
6451
-
6452
- /**
6453
- * @license
6454
- * Copyright Google LLC All Rights Reserved.
6455
- *
6456
- * Use of this source code is governed by an MIT-style license that can be
6457
- * found in the LICENSE file at https://angular.io/license
6458
- */
6459
- function getType(error) {
6460
- return error[ERROR_TYPE];
6461
- }
6462
6454
  function getOriginalError(error) {
6463
6455
  return error[ERROR_ORIGINAL_ERROR];
6464
6456
  }
@@ -6703,7 +6695,7 @@ function maybeUnwrapFn(value) {
6703
6695
  */
6704
6696
  /** Called when there are multiple component selectors that match a given node */
6705
6697
  function throwMultipleComponentError(tNode) {
6706
- throw new RuntimeError("300" /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6698
+ throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
6707
6699
  }
6708
6700
  /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
6709
6701
  function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
@@ -6714,9 +6706,7 @@ function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName)
6714
6706
  ` It seems like the view has been created after its parent and its children have been dirty checked.` +
6715
6707
  ` Has it been created in a change detection hook?`;
6716
6708
  }
6717
- // TODO: include debug context, see `viewDebugError` function in
6718
- // `packages/core/src/view/errors.ts` for reference.
6719
- throw new RuntimeError("100" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6709
+ throw new RuntimeError(-100 /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
6720
6710
  }
6721
6711
  function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
6722
6712
  const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
@@ -10126,7 +10116,7 @@ function matchingSchemas(tView, tagName) {
10126
10116
  */
10127
10117
  function logUnknownPropertyError(propName, tNode) {
10128
10118
  let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
10129
- console.error(formatRuntimeError("303" /* UNKNOWN_BINDING */, message));
10119
+ console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
10130
10120
  }
10131
10121
  /**
10132
10122
  * Instantiate a root component.
@@ -10379,7 +10369,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
10379
10369
  for (let i = 0; i < localRefs.length; i += 2) {
10380
10370
  const index = exportsMap[localRefs[i + 1]];
10381
10371
  if (index == null)
10382
- throw new RuntimeError("301" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10372
+ throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
10383
10373
  localNames.push(localRefs[i], index);
10384
10374
  }
10385
10375
  }
@@ -11305,7 +11295,10 @@ class R3Injector {
11305
11295
  }
11306
11296
  assertNotDestroyed() {
11307
11297
  if (this._destroyed) {
11308
- throw new Error('Injector has already been destroyed.');
11298
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11299
+ 'Injector has already been destroyed.' :
11300
+ '';
11301
+ throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
11309
11302
  }
11310
11303
  }
11311
11304
  /**
@@ -11469,21 +11462,28 @@ function injectableDefOrInjectorDefFactory(token) {
11469
11462
  // InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
11470
11463
  // If it's missing that, it's an error.
11471
11464
  if (token instanceof InjectionToken) {
11472
- throw new Error(`Token ${stringify(token)} is missing a ɵprov definition.`);
11465
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11466
+ `Token ${stringify(token)} is missing a ɵprov definition.` :
11467
+ '';
11468
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11473
11469
  }
11474
11470
  // Undecorated types can sometimes be created if they have no constructor arguments.
11475
11471
  if (token instanceof Function) {
11476
11472
  return getUndecoratedInjectableFactory(token);
11477
11473
  }
11478
11474
  // There was no way to resolve a factory for this token.
11479
- throw new Error('unreachable');
11475
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'unreachable' : '';
11476
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11480
11477
  }
11481
11478
  function getUndecoratedInjectableFactory(token) {
11482
11479
  // If the token has parameters then it has dependencies that we cannot resolve implicitly.
11483
11480
  const paramLength = token.length;
11484
11481
  if (paramLength > 0) {
11485
11482
  const args = newArray(paramLength, '?');
11486
- throw new Error(`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);
11483
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
11484
+ `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
11485
+ '';
11486
+ throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
11487
11487
  }
11488
11488
  // The constructor function appears to have no parameters.
11489
11489
  // This might be because it inherits from a super-class. In which case, use an injectable
@@ -12342,7 +12342,10 @@ function ɵɵInheritDefinitionFeature(definition) {
12342
12342
  }
12343
12343
  else {
12344
12344
  if (superType.ɵcmp) {
12345
- throw new Error('Directives cannot inherit Components');
12345
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
12346
+ 'Directives cannot inherit Components' :
12347
+ '';
12348
+ throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
12346
12349
  }
12347
12350
  // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
12348
12351
  superDef = superType.ɵdir;
@@ -14604,7 +14607,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14604
14607
  message +=
14605
14608
  `2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
14606
14609
  }
14607
- console.error(formatRuntimeError("304" /* UNKNOWN_ELEMENT */, message));
14610
+ console.error(formatRuntimeError(304 /* UNKNOWN_ELEMENT */, message));
14608
14611
  }
14609
14612
  }
14610
14613
  }
@@ -19123,7 +19126,9 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
19123
19126
  setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
19124
19127
  break;
19125
19128
  default:
19126
- throw new Error(`Unable to determine the type of mutate operation for "${opCode}"`);
19129
+ if (ngDevMode) {
19130
+ throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
19131
+ }
19127
19132
  }
19128
19133
  }
19129
19134
  else {
@@ -19749,7 +19754,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
19749
19754
  };
19750
19755
  }
19751
19756
  /**
19752
- * Allocate space in i18n Range add create OpCode instruction to crete a text or comment node.
19757
+ * Allocate space in i18n Range add create OpCode instruction to create a text or comment node.
19753
19758
  *
19754
19759
  * @param tView Current `TView` needed to allocate space in i18n range.
19755
19760
  * @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be
@@ -21050,7 +21055,7 @@ class Version {
21050
21055
  /**
21051
21056
  * @publicApi
21052
21057
  */
21053
- const VERSION = new Version('13.1.0-next.3');
21058
+ const VERSION = new Version('13.1.3');
21054
21059
 
21055
21060
  /**
21056
21061
  * @license
@@ -21386,7 +21391,8 @@ class ViewRef$1 {
21386
21391
  }
21387
21392
  attachToViewContainerRef() {
21388
21393
  if (this._appRef) {
21389
- throw new Error('This view is already attached directly to the ApplicationRef!');
21394
+ const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
21395
+ throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
21390
21396
  }
21391
21397
  this._attachedToViewContainer = true;
21392
21398
  }
@@ -21396,7 +21402,8 @@ class ViewRef$1 {
21396
21402
  }
21397
21403
  attachToAppRef(appRef) {
21398
21404
  if (this._attachedToViewContainer) {
21399
- throw new Error('This view is already attached to a ViewContainer!');
21405
+ const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
21406
+ throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
21400
21407
  }
21401
21408
  this._appRef = appRef;
21402
21409
  }
@@ -21788,7 +21795,7 @@ class NgModuleRef extends NgModuleRef$1 {
21788
21795
  }
21789
21796
  ], stringify(ngModuleType));
21790
21797
  // We need to resolve the injector types separately from the injector creation, because
21791
- // the module might be trying to use this ref in its contructor for DI which will cause a
21798
+ // the module might be trying to use this ref in its constructor for DI which will cause a
21792
21799
  // circular error that will eventually error out, because the injector isn't created yet.
21793
21800
  this._r3Injector._resolveInjectorDefTypes();
21794
21801
  this.instance = this.get(ngModuleType);
@@ -22267,7 +22274,7 @@ function getPipeDef(name, registry) {
22267
22274
  const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
22268
22275
  const context = declarationLView[CONTEXT];
22269
22276
  const component = context ? ` in the '${context.constructor.name}' component` : '';
22270
- throw new RuntimeError("302" /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
22277
+ throw new RuntimeError(-302 /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
22271
22278
  }
22272
22279
  }
22273
22280
  /**
@@ -24516,7 +24523,7 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
24516
24523
  * @HostListener('click', ['$event.target'])
24517
24524
  * onClick(btn) {
24518
24525
  * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
24519
- * }
24526
+ * }
24520
24527
  * }
24521
24528
  *
24522
24529
  * @Component({
@@ -25860,7 +25867,7 @@ function createPlatform(injector) {
25860
25867
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
25861
25868
  'There can be only one platform. Destroy the previous one to create a new one.' :
25862
25869
  '';
25863
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, errorMessage);
25870
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
25864
25871
  }
25865
25872
  publishDefaultGlobalUtils();
25866
25873
  _platform = injector.get(PlatformRef);
@@ -25909,11 +25916,11 @@ function assertPlatform(requiredToken) {
25909
25916
  const platform = getPlatform();
25910
25917
  if (!platform) {
25911
25918
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
25912
- throw new RuntimeError("401" /* PLATFORM_NOT_FOUND */, errorMessage);
25919
+ throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);
25913
25920
  }
25914
25921
  if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
25915
25922
  !platform.injector.get(requiredToken, null)) {
25916
- throw new RuntimeError("400" /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25923
+ throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
25917
25924
  }
25918
25925
  return platform;
25919
25926
  }
@@ -26000,7 +26007,7 @@ class PlatformRef {
26000
26007
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26001
26008
  'No ErrorHandler. Is platform module (BrowserModule) included?' :
26002
26009
  '';
26003
- throw new RuntimeError("402" /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26010
+ throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
26004
26011
  }
26005
26012
  ngZone.runOutsideAngular(() => {
26006
26013
  const subscription = ngZone.onError.subscribe({
@@ -26061,7 +26068,7 @@ class PlatformRef {
26061
26068
  `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
26062
26069
  `Please define one of these.` :
26063
26070
  '';
26064
- throw new RuntimeError("403" /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26071
+ throw new RuntimeError(403 /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
26065
26072
  }
26066
26073
  this._modules.push(moduleRef);
26067
26074
  }
@@ -26087,7 +26094,7 @@ class PlatformRef {
26087
26094
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26088
26095
  'The platform has already been destroyed!' :
26089
26096
  '';
26090
- throw new RuntimeError("404" /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26097
+ throw new RuntimeError(404 /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
26091
26098
  }
26092
26099
  this._modules.slice().forEach(module => module.destroy());
26093
26100
  this._destroyListeners.forEach(listener => listener());
@@ -26353,7 +26360,7 @@ class ApplicationRef {
26353
26360
  'Cannot bootstrap as there are still asynchronous initializers running. ' +
26354
26361
  'Bootstrap components in the `ngDoBootstrap` method of the root module.' :
26355
26362
  '';
26356
- throw new RuntimeError("405" /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26363
+ throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
26357
26364
  }
26358
26365
  let componentFactory;
26359
26366
  if (componentOrFactory instanceof ComponentFactory$1) {
@@ -26403,7 +26410,7 @@ class ApplicationRef {
26403
26410
  const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26404
26411
  'ApplicationRef.tick is called recursively' :
26405
26412
  '';
26406
- throw new RuntimeError("101" /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26413
+ throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
26407
26414
  }
26408
26415
  try {
26409
26416
  this._runningTick = true;
@@ -27394,7 +27401,10 @@ class DefaultIterableDiffer {
27394
27401
  if (collection == null)
27395
27402
  collection = [];
27396
27403
  if (!isListLikeIterable(collection)) {
27397
- throw new Error(`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
27404
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27405
+ `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
27406
+ '';
27407
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
27398
27408
  }
27399
27409
  if (this.check(collection)) {
27400
27410
  return this;
@@ -27995,7 +28005,10 @@ class DefaultKeyValueDiffer {
27995
28005
  map = new Map();
27996
28006
  }
27997
28007
  else if (!(map instanceof Map || isJsObject(map))) {
27998
- throw new Error(`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
28008
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28009
+ `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
28010
+ '';
28011
+ throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
27999
28012
  }
28000
28013
  return this.check(map) ? this : null;
28001
28014
  }
@@ -28242,7 +28255,10 @@ class IterableDiffers {
28242
28255
  return factory;
28243
28256
  }
28244
28257
  else {
28245
- throw new Error(`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
28258
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28259
+ `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
28260
+ '';
28261
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28246
28262
  }
28247
28263
  }
28248
28264
  }
@@ -28316,7 +28332,10 @@ class KeyValueDiffers {
28316
28332
  if (factory) {
28317
28333
  return factory;
28318
28334
  }
28319
- throw new Error(`Cannot find a differ supporting object '${kv}'`);
28335
+ const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28336
+ `Cannot find a differ supporting object '${kv}'` :
28337
+ '';
28338
+ throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
28320
28339
  }
28321
28340
  }
28322
28341
  /** @nocollapse */