@angular/core 13.2.0-next.1 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.d.ts +68 -28
- package/esm2020/src/application_ref.mjs +10 -10
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +6 -2
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +6 -2
- package/esm2020/src/change_detection/differs/iterable_differs.mjs +6 -2
- package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +6 -2
- package/esm2020/src/core_private_export.mjs +2 -2
- package/esm2020/src/di/injector_compatibility.mjs +10 -3
- package/esm2020/src/di/r3_injector.mjs +16 -5
- package/esm2020/src/error_details_base_url.mjs +16 -0
- package/esm2020/src/error_handler.mjs +2 -2
- package/esm2020/src/errors.mjs +18 -12
- package/esm2020/src/linker/compiler.mjs +1 -1
- package/esm2020/src/linker/component_factory.mjs +4 -1
- package/esm2020/src/linker/component_factory_resolver.mjs +4 -1
- package/esm2020/src/linker/ng_module_factory.mjs +1 -1
- package/esm2020/src/metadata/directives.mjs +2 -2
- package/esm2020/src/reflection/reflection_capabilities.mjs +2 -2
- package/esm2020/src/render3/component_ref.mjs +1 -1
- package/esm2020/src/render3/errors.mjs +4 -6
- package/esm2020/src/render3/errors_di.mjs +11 -4
- package/esm2020/src/render3/features/inherit_definition_feature.mjs +6 -2
- package/esm2020/src/render3/i18n/i18n_apply.mjs +5 -2
- package/esm2020/src/render3/i18n/i18n_parse.mjs +2 -2
- package/esm2020/src/render3/instructions/element.mjs +3 -3
- package/esm2020/src/render3/instructions/shared.mjs +4 -4
- package/esm2020/src/render3/namespaces.mjs +10 -3
- package/esm2020/src/render3/ng_module_ref.mjs +2 -2
- package/esm2020/src/render3/node_manipulation.mjs +5 -3
- package/esm2020/src/render3/pipe.mjs +3 -3
- package/esm2020/src/render3/view_ref.mjs +6 -3
- package/esm2020/src/sanitization/sanitization.mjs +14 -7
- package/esm2020/src/util/errors.mjs +10 -2
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +3 -2
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +119 -85
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +2 -2
- package/fesm2020/core.mjs +119 -85
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +2 -2
- package/package.json +1 -1
- package/schematics/migrations/typed-forms/index.js +3 -3
- package/testing/testing.d.ts +2 -2
- package/esm2020/src/render3/error_code.mjs +0 -42
- package/esm2020/src/render3/error_details_base_url.mjs +0 -16
package/fesm2015/testing.mjs
CHANGED
package/fesm2020/core.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.2.0
|
|
3
|
-
* (c) 2010-
|
|
2
|
+
* @license Angular v13.2.0
|
|
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/
|
|
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
|
|
176
|
-
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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(
|
|
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(
|
|
237
|
+
throw new RuntimeError(-201 /* PROVIDER_NOT_FOUND */, `No provider for ${stringifyForError(token)} found${injectorDetails}`);
|
|
246
238
|
}
|
|
247
239
|
|
|
248
240
|
/**
|
|
@@ -1567,8 +1559,15 @@ const profiler = function (event, instance, hookOrListener) {
|
|
|
1567
1559
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1568
1560
|
* found in the LICENSE file at https://angular.io/license
|
|
1569
1561
|
*/
|
|
1570
|
-
const SVG_NAMESPACE = '
|
|
1571
|
-
const
|
|
1562
|
+
const SVG_NAMESPACE = 'svg';
|
|
1563
|
+
const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg';
|
|
1564
|
+
const MATH_ML_NAMESPACE = 'math';
|
|
1565
|
+
const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/';
|
|
1566
|
+
function getNamespaceUri(namespace) {
|
|
1567
|
+
const name = namespace.toLowerCase();
|
|
1568
|
+
return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI :
|
|
1569
|
+
(name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
|
|
1570
|
+
}
|
|
1572
1571
|
|
|
1573
1572
|
/**
|
|
1574
1573
|
* @license
|
|
@@ -4479,7 +4478,7 @@ const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{
|
|
|
4479
4478
|
* Regular expression that detects ES2015 classes which extend from other classes
|
|
4480
4479
|
* and inherit a constructor.
|
|
4481
4480
|
*/
|
|
4482
|
-
const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{
|
|
4481
|
+
const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/;
|
|
4483
4482
|
/**
|
|
4484
4483
|
* Determine whether a stringified type is a class which delegates its constructor
|
|
4485
4484
|
* to its parent.
|
|
@@ -4758,7 +4757,10 @@ function setCurrentInjector(injector) {
|
|
|
4758
4757
|
}
|
|
4759
4758
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4760
4759
|
if (_currentInjector === undefined) {
|
|
4761
|
-
|
|
4760
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4761
|
+
`inject() must be called from an injection context` :
|
|
4762
|
+
'';
|
|
4763
|
+
throw new RuntimeError(203 /* MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4762
4764
|
}
|
|
4763
4765
|
else if (_currentInjector === null) {
|
|
4764
4766
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4822,7 +4824,10 @@ function injectArgs(types) {
|
|
|
4822
4824
|
const arg = resolveForwardRef(types[i]);
|
|
4823
4825
|
if (Array.isArray(arg)) {
|
|
4824
4826
|
if (arg.length === 0) {
|
|
4825
|
-
|
|
4827
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
4828
|
+
'Arguments array must have arguments.' :
|
|
4829
|
+
'';
|
|
4830
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
4826
4831
|
}
|
|
4827
4832
|
let type = undefined;
|
|
4828
4833
|
let flags = InjectFlags.Default;
|
|
@@ -6013,7 +6018,10 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
6013
6018
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* ResourceUrl */)) {
|
|
6014
6019
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6015
6020
|
}
|
|
6016
|
-
|
|
6021
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6022
|
+
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
|
|
6023
|
+
'';
|
|
6024
|
+
throw new RuntimeError(904 /* UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
6017
6025
|
}
|
|
6018
6026
|
/**
|
|
6019
6027
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6035,7 +6043,10 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6035
6043
|
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* Script */)) {
|
|
6036
6044
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6037
6045
|
}
|
|
6038
|
-
|
|
6046
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
6047
|
+
'unsafe value used in a script context' :
|
|
6048
|
+
'';
|
|
6049
|
+
throw new RuntimeError(905 /* UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6039
6050
|
}
|
|
6040
6051
|
/**
|
|
6041
6052
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -6123,18 +6134,18 @@ function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
|
|
|
6123
6134
|
}
|
|
6124
6135
|
function validateAgainstEventProperties(name) {
|
|
6125
6136
|
if (name.toLowerCase().startsWith('on')) {
|
|
6126
|
-
const
|
|
6137
|
+
const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
|
|
6127
6138
|
`please use (${name.slice(2)})=...` +
|
|
6128
6139
|
`\nIf '${name}' is a directive input, make sure the directive is imported by the` +
|
|
6129
6140
|
` current module.`;
|
|
6130
|
-
throw new
|
|
6141
|
+
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6131
6142
|
}
|
|
6132
6143
|
}
|
|
6133
6144
|
function validateAgainstEventAttributes(name) {
|
|
6134
6145
|
if (name.toLowerCase().startsWith('on')) {
|
|
6135
|
-
const
|
|
6146
|
+
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
|
|
6136
6147
|
`please use (${name.slice(2)})=...`;
|
|
6137
|
-
throw new
|
|
6148
|
+
throw new RuntimeError(306 /* INVALID_EVENT_BINDING */, errorMessage);
|
|
6138
6149
|
}
|
|
6139
6150
|
}
|
|
6140
6151
|
function getSanitizer() {
|
|
@@ -6454,7 +6465,6 @@ function discoverLocalRefs(lView, nodeIndex) {
|
|
|
6454
6465
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6455
6466
|
* found in the LICENSE file at https://angular.io/license
|
|
6456
6467
|
*/
|
|
6457
|
-
const ERROR_TYPE = 'ngType';
|
|
6458
6468
|
const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
|
|
6459
6469
|
const ERROR_LOGGER = 'ngErrorLogger';
|
|
6460
6470
|
function wrappedError(message, originalError) {
|
|
@@ -6463,17 +6473,6 @@ function wrappedError(message, originalError) {
|
|
|
6463
6473
|
error[ERROR_ORIGINAL_ERROR] = originalError;
|
|
6464
6474
|
return error;
|
|
6465
6475
|
}
|
|
6466
|
-
|
|
6467
|
-
/**
|
|
6468
|
-
* @license
|
|
6469
|
-
* Copyright Google LLC All Rights Reserved.
|
|
6470
|
-
*
|
|
6471
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6472
|
-
* found in the LICENSE file at https://angular.io/license
|
|
6473
|
-
*/
|
|
6474
|
-
function getType(error) {
|
|
6475
|
-
return error[ERROR_TYPE];
|
|
6476
|
-
}
|
|
6477
6476
|
function getOriginalError(error) {
|
|
6478
6477
|
return error[ERROR_ORIGINAL_ERROR];
|
|
6479
6478
|
}
|
|
@@ -6718,7 +6717,7 @@ function maybeUnwrapFn(value) {
|
|
|
6718
6717
|
*/
|
|
6719
6718
|
/** Called when there are multiple component selectors that match a given node */
|
|
6720
6719
|
function throwMultipleComponentError(tNode) {
|
|
6721
|
-
throw new RuntimeError(
|
|
6720
|
+
throw new RuntimeError(-300 /* MULTIPLE_COMPONENTS_MATCH */, `Multiple components match node with tagname ${tNode.value}`);
|
|
6722
6721
|
}
|
|
6723
6722
|
/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
|
|
6724
6723
|
function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName) {
|
|
@@ -6729,9 +6728,7 @@ function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName)
|
|
|
6729
6728
|
` It seems like the view has been created after its parent and its children have been dirty checked.` +
|
|
6730
6729
|
` Has it been created in a change detection hook?`;
|
|
6731
6730
|
}
|
|
6732
|
-
|
|
6733
|
-
// `packages/core/src/view/errors.ts` for reference.
|
|
6734
|
-
throw new RuntimeError("100" /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
|
|
6731
|
+
throw new RuntimeError(-100 /* EXPRESSION_CHANGED_AFTER_CHECKED */, msg);
|
|
6735
6732
|
}
|
|
6736
6733
|
function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {
|
|
6737
6734
|
const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);
|
|
@@ -6998,8 +6995,9 @@ function createElementNode(renderer, name, namespace) {
|
|
|
6998
6995
|
return renderer.createElement(name, namespace);
|
|
6999
6996
|
}
|
|
7000
6997
|
else {
|
|
7001
|
-
|
|
7002
|
-
|
|
6998
|
+
const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
|
|
6999
|
+
return namespaceUri === null ? renderer.createElement(name) :
|
|
7000
|
+
renderer.createElementNS(namespaceUri, name);
|
|
7003
7001
|
}
|
|
7004
7002
|
}
|
|
7005
7003
|
/**
|
|
@@ -10141,7 +10139,7 @@ function matchingSchemas(tView, tagName) {
|
|
|
10141
10139
|
*/
|
|
10142
10140
|
function logUnknownPropertyError(propName, tNode) {
|
|
10143
10141
|
let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
|
|
10144
|
-
console.error(formatRuntimeError(
|
|
10142
|
+
console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
|
|
10145
10143
|
}
|
|
10146
10144
|
/**
|
|
10147
10145
|
* Instantiate a root component.
|
|
@@ -10394,7 +10392,7 @@ function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
|
10394
10392
|
for (let i = 0; i < localRefs.length; i += 2) {
|
|
10395
10393
|
const index = exportsMap[localRefs[i + 1]];
|
|
10396
10394
|
if (index == null)
|
|
10397
|
-
throw new RuntimeError(
|
|
10395
|
+
throw new RuntimeError(-301 /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);
|
|
10398
10396
|
localNames.push(localRefs[i], index);
|
|
10399
10397
|
}
|
|
10400
10398
|
}
|
|
@@ -11320,7 +11318,10 @@ class R3Injector {
|
|
|
11320
11318
|
}
|
|
11321
11319
|
assertNotDestroyed() {
|
|
11322
11320
|
if (this._destroyed) {
|
|
11323
|
-
|
|
11321
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11322
|
+
'Injector has already been destroyed.' :
|
|
11323
|
+
'';
|
|
11324
|
+
throw new RuntimeError(205 /* INJECTOR_ALREADY_DESTROYED */, errorMessage);
|
|
11324
11325
|
}
|
|
11325
11326
|
}
|
|
11326
11327
|
/**
|
|
@@ -11484,21 +11485,28 @@ function injectableDefOrInjectorDefFactory(token) {
|
|
|
11484
11485
|
// InjectionTokens should have an injectable def (ɵprov) and thus should be handled above.
|
|
11485
11486
|
// If it's missing that, it's an error.
|
|
11486
11487
|
if (token instanceof InjectionToken) {
|
|
11487
|
-
|
|
11488
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11489
|
+
`Token ${stringify(token)} is missing a ɵprov definition.` :
|
|
11490
|
+
'';
|
|
11491
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11488
11492
|
}
|
|
11489
11493
|
// Undecorated types can sometimes be created if they have no constructor arguments.
|
|
11490
11494
|
if (token instanceof Function) {
|
|
11491
11495
|
return getUndecoratedInjectableFactory(token);
|
|
11492
11496
|
}
|
|
11493
11497
|
// There was no way to resolve a factory for this token.
|
|
11494
|
-
|
|
11498
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'unreachable' : '';
|
|
11499
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11495
11500
|
}
|
|
11496
11501
|
function getUndecoratedInjectableFactory(token) {
|
|
11497
11502
|
// If the token has parameters then it has dependencies that we cannot resolve implicitly.
|
|
11498
11503
|
const paramLength = token.length;
|
|
11499
11504
|
if (paramLength > 0) {
|
|
11500
11505
|
const args = newArray(paramLength, '?');
|
|
11501
|
-
|
|
11506
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
11507
|
+
`Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).` :
|
|
11508
|
+
'';
|
|
11509
|
+
throw new RuntimeError(204 /* INVALID_INJECTION_TOKEN */, errorMessage);
|
|
11502
11510
|
}
|
|
11503
11511
|
// The constructor function appears to have no parameters.
|
|
11504
11512
|
// This might be because it inherits from a super-class. In which case, use an injectable
|
|
@@ -12356,7 +12364,10 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
12356
12364
|
}
|
|
12357
12365
|
else {
|
|
12358
12366
|
if (superType.ɵcmp) {
|
|
12359
|
-
|
|
12367
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
12368
|
+
'Directives cannot inherit Components' :
|
|
12369
|
+
'';
|
|
12370
|
+
throw new RuntimeError(903 /* INVALID_INHERITANCE */, errorMessage);
|
|
12360
12371
|
}
|
|
12361
12372
|
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
12362
12373
|
superDef = superType.ɵdir;
|
|
@@ -14618,7 +14629,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
|
|
|
14618
14629
|
message +=
|
|
14619
14630
|
`2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`;
|
|
14620
14631
|
}
|
|
14621
|
-
console.error(formatRuntimeError(
|
|
14632
|
+
console.error(formatRuntimeError(304 /* UNKNOWN_ELEMENT */, message));
|
|
14622
14633
|
}
|
|
14623
14634
|
}
|
|
14624
14635
|
}
|
|
@@ -19137,7 +19148,9 @@ function applyMutableOpCodes(tView, mutableOpCodes, lView, anchorRNode) {
|
|
|
19137
19148
|
setElementAttribute(renderer, getNativeByIndex(elementNodeIndex, lView), null, null, attrName, attrValue, null);
|
|
19138
19149
|
break;
|
|
19139
19150
|
default:
|
|
19140
|
-
|
|
19151
|
+
if (ngDevMode) {
|
|
19152
|
+
throw new RuntimeError(700 /* INVALID_I18N_STRUCTURE */, `Unable to determine the type of mutate operation for "${opCode}"`);
|
|
19153
|
+
}
|
|
19141
19154
|
}
|
|
19142
19155
|
}
|
|
19143
19156
|
else {
|
|
@@ -19763,7 +19776,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
|
|
|
19763
19776
|
};
|
|
19764
19777
|
}
|
|
19765
19778
|
/**
|
|
19766
|
-
* Allocate space in i18n Range add create OpCode instruction to
|
|
19779
|
+
* Allocate space in i18n Range add create OpCode instruction to create a text or comment node.
|
|
19767
19780
|
*
|
|
19768
19781
|
* @param tView Current `TView` needed to allocate space in i18n range.
|
|
19769
19782
|
* @param rootTNode Root `TNode` of the i18n block. This node determines if the new TNode will be
|
|
@@ -20864,6 +20877,9 @@ class ComponentRef$1 {
|
|
|
20864
20877
|
* @see [Dynamic Components](guide/dynamic-component-loader)
|
|
20865
20878
|
*
|
|
20866
20879
|
* @publicApi
|
|
20880
|
+
*
|
|
20881
|
+
* @deprecated Angular no longer requires Component factories. Please use other APIs where
|
|
20882
|
+
* Component class can be used directly.
|
|
20867
20883
|
*/
|
|
20868
20884
|
class ComponentFactory$1 {
|
|
20869
20885
|
}
|
|
@@ -20900,6 +20916,9 @@ class _NullComponentFactoryResolver {
|
|
|
20900
20916
|
* does **not** require resolving component factory: component class can be used directly.
|
|
20901
20917
|
*
|
|
20902
20918
|
* @publicApi
|
|
20919
|
+
*
|
|
20920
|
+
* @deprecated Angular no longer requires Component factories. Please use other APIs where
|
|
20921
|
+
* Component class can be used directly.
|
|
20903
20922
|
*/
|
|
20904
20923
|
class ComponentFactoryResolver$1 {
|
|
20905
20924
|
}
|
|
@@ -21064,7 +21083,7 @@ class Version {
|
|
|
21064
21083
|
/**
|
|
21065
21084
|
* @publicApi
|
|
21066
21085
|
*/
|
|
21067
|
-
const VERSION = new Version('13.2.0
|
|
21086
|
+
const VERSION = new Version('13.2.0');
|
|
21068
21087
|
|
|
21069
21088
|
/**
|
|
21070
21089
|
* @license
|
|
@@ -21400,7 +21419,8 @@ class ViewRef$1 {
|
|
|
21400
21419
|
}
|
|
21401
21420
|
attachToViewContainerRef() {
|
|
21402
21421
|
if (this._appRef) {
|
|
21403
|
-
|
|
21422
|
+
const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
|
|
21423
|
+
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21404
21424
|
}
|
|
21405
21425
|
this._attachedToViewContainer = true;
|
|
21406
21426
|
}
|
|
@@ -21410,7 +21430,8 @@ class ViewRef$1 {
|
|
|
21410
21430
|
}
|
|
21411
21431
|
attachToAppRef(appRef) {
|
|
21412
21432
|
if (this._attachedToViewContainer) {
|
|
21413
|
-
|
|
21433
|
+
const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
|
|
21434
|
+
throw new RuntimeError(902 /* VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
21414
21435
|
}
|
|
21415
21436
|
this._appRef = appRef;
|
|
21416
21437
|
}
|
|
@@ -21802,7 +21823,7 @@ class NgModuleRef extends NgModuleRef$1 {
|
|
|
21802
21823
|
}
|
|
21803
21824
|
], stringify(ngModuleType));
|
|
21804
21825
|
// We need to resolve the injector types separately from the injector creation, because
|
|
21805
|
-
// the module might be trying to use this ref in its
|
|
21826
|
+
// the module might be trying to use this ref in its constructor for DI which will cause a
|
|
21806
21827
|
// circular error that will eventually error out, because the injector isn't created yet.
|
|
21807
21828
|
this._r3Injector._resolveInjectorDefTypes();
|
|
21808
21829
|
this.instance = this.get(ngModuleType);
|
|
@@ -22281,7 +22302,7 @@ function getPipeDef(name, registry) {
|
|
|
22281
22302
|
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
|
|
22282
22303
|
const context = declarationLView[CONTEXT];
|
|
22283
22304
|
const component = context ? ` in the '${context.constructor.name}' component` : '';
|
|
22284
|
-
throw new RuntimeError(
|
|
22305
|
+
throw new RuntimeError(-302 /* PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
|
|
22285
22306
|
}
|
|
22286
22307
|
}
|
|
22287
22308
|
/**
|
|
@@ -24542,7 +24563,7 @@ const HostBinding = makePropDecorator('HostBinding', (hostPropertyName) => ({ ho
|
|
|
24542
24563
|
* @HostListener('click', ['$event.target'])
|
|
24543
24564
|
* onClick(btn) {
|
|
24544
24565
|
* console.log('button', btn, 'number of clicks:', this.numberOfClicks++);
|
|
24545
|
-
*
|
|
24566
|
+
* }
|
|
24546
24567
|
* }
|
|
24547
24568
|
*
|
|
24548
24569
|
* @Component({
|
|
@@ -25302,7 +25323,8 @@ class NgZone {
|
|
|
25302
25323
|
forkInnerZoneWithAngularBehavior(self);
|
|
25303
25324
|
}
|
|
25304
25325
|
static isInAngularZone() {
|
|
25305
|
-
|
|
25326
|
+
// Zone needs to be checked, because this method might be called even when NoopNgZone is used.
|
|
25327
|
+
return typeof Zone !== 'undefined' && Zone.current.get('isAngularZone') === true;
|
|
25306
25328
|
}
|
|
25307
25329
|
static assertInAngularZone() {
|
|
25308
25330
|
if (!NgZone.isInAngularZone()) {
|
|
@@ -25882,7 +25904,7 @@ function createPlatform(injector) {
|
|
|
25882
25904
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
25883
25905
|
'There can be only one platform. Destroy the previous one to create a new one.' :
|
|
25884
25906
|
'';
|
|
25885
|
-
throw new RuntimeError(
|
|
25907
|
+
throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, errorMessage);
|
|
25886
25908
|
}
|
|
25887
25909
|
publishDefaultGlobalUtils();
|
|
25888
25910
|
_platform = injector.get(PlatformRef);
|
|
@@ -25931,11 +25953,11 @@ function assertPlatform(requiredToken) {
|
|
|
25931
25953
|
const platform = getPlatform();
|
|
25932
25954
|
if (!platform) {
|
|
25933
25955
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
|
|
25934
|
-
throw new RuntimeError(
|
|
25956
|
+
throw new RuntimeError(401 /* PLATFORM_NOT_FOUND */, errorMessage);
|
|
25935
25957
|
}
|
|
25936
25958
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
25937
25959
|
!platform.injector.get(requiredToken, null)) {
|
|
25938
|
-
throw new RuntimeError(
|
|
25960
|
+
throw new RuntimeError(400 /* MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
|
|
25939
25961
|
}
|
|
25940
25962
|
return platform;
|
|
25941
25963
|
}
|
|
@@ -26022,7 +26044,7 @@ class PlatformRef {
|
|
|
26022
26044
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26023
26045
|
'No ErrorHandler. Is platform module (BrowserModule) included?' :
|
|
26024
26046
|
'';
|
|
26025
|
-
throw new RuntimeError(
|
|
26047
|
+
throw new RuntimeError(402 /* ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
26026
26048
|
}
|
|
26027
26049
|
ngZone.runOutsideAngular(() => {
|
|
26028
26050
|
const subscription = ngZone.onError.subscribe({
|
|
@@ -26083,7 +26105,7 @@ class PlatformRef {
|
|
|
26083
26105
|
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
26084
26106
|
`Please define one of these.` :
|
|
26085
26107
|
'';
|
|
26086
|
-
throw new RuntimeError(
|
|
26108
|
+
throw new RuntimeError(403 /* BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
26087
26109
|
}
|
|
26088
26110
|
this._modules.push(moduleRef);
|
|
26089
26111
|
}
|
|
@@ -26109,7 +26131,7 @@ class PlatformRef {
|
|
|
26109
26131
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26110
26132
|
'The platform has already been destroyed!' :
|
|
26111
26133
|
'';
|
|
26112
|
-
throw new RuntimeError(
|
|
26134
|
+
throw new RuntimeError(404 /* ALREADY_DESTROYED_PLATFORM */, errorMessage);
|
|
26113
26135
|
}
|
|
26114
26136
|
this._modules.slice().forEach(module => module.destroy());
|
|
26115
26137
|
this._destroyListeners.forEach(listener => listener());
|
|
@@ -26373,7 +26395,7 @@ class ApplicationRef {
|
|
|
26373
26395
|
'Cannot bootstrap as there are still asynchronous initializers running. ' +
|
|
26374
26396
|
'Bootstrap components in the `ngDoBootstrap` method of the root module.' :
|
|
26375
26397
|
'';
|
|
26376
|
-
throw new RuntimeError(
|
|
26398
|
+
throw new RuntimeError(405 /* ASYNC_INITIALIZERS_STILL_RUNNING */, errorMessage);
|
|
26377
26399
|
}
|
|
26378
26400
|
let componentFactory;
|
|
26379
26401
|
if (componentOrFactory instanceof ComponentFactory$1) {
|
|
@@ -26423,7 +26445,7 @@ class ApplicationRef {
|
|
|
26423
26445
|
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
26424
26446
|
'ApplicationRef.tick is called recursively' :
|
|
26425
26447
|
'';
|
|
26426
|
-
throw new RuntimeError(
|
|
26448
|
+
throw new RuntimeError(101 /* RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
26427
26449
|
}
|
|
26428
26450
|
try {
|
|
26429
26451
|
this._runningTick = true;
|
|
@@ -27412,7 +27434,10 @@ class DefaultIterableDiffer {
|
|
|
27412
27434
|
if (collection == null)
|
|
27413
27435
|
collection = [];
|
|
27414
27436
|
if (!isListLikeIterable(collection)) {
|
|
27415
|
-
|
|
27437
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
27438
|
+
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
|
|
27439
|
+
'';
|
|
27440
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
27416
27441
|
}
|
|
27417
27442
|
if (this.check(collection)) {
|
|
27418
27443
|
return this;
|
|
@@ -28013,7 +28038,10 @@ class DefaultKeyValueDiffer {
|
|
|
28013
28038
|
map = new Map();
|
|
28014
28039
|
}
|
|
28015
28040
|
else if (!(map instanceof Map || isJsObject(map))) {
|
|
28016
|
-
|
|
28041
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28042
|
+
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
|
|
28043
|
+
'';
|
|
28044
|
+
throw new RuntimeError(900 /* INVALID_DIFFER_INPUT */, errorMessage);
|
|
28017
28045
|
}
|
|
28018
28046
|
return this.check(map) ? this : null;
|
|
28019
28047
|
}
|
|
@@ -28260,7 +28288,10 @@ class IterableDiffers {
|
|
|
28260
28288
|
return factory;
|
|
28261
28289
|
}
|
|
28262
28290
|
else {
|
|
28263
|
-
|
|
28291
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28292
|
+
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
|
|
28293
|
+
'';
|
|
28294
|
+
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
28264
28295
|
}
|
|
28265
28296
|
}
|
|
28266
28297
|
}
|
|
@@ -28334,7 +28365,10 @@ class KeyValueDiffers {
|
|
|
28334
28365
|
if (factory) {
|
|
28335
28366
|
return factory;
|
|
28336
28367
|
}
|
|
28337
|
-
|
|
28368
|
+
const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
|
|
28369
|
+
`Cannot find a differ supporting object '${kv}'` :
|
|
28370
|
+
'';
|
|
28371
|
+
throw new RuntimeError(901 /* NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
28338
28372
|
}
|
|
28339
28373
|
}
|
|
28340
28374
|
/** @nocollapse */
|