@angular/core 14.0.2 → 14.0.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.
- package/esm2020/src/application_ref.mjs +10 -24
- package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +3 -5
- package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +3 -5
- package/esm2020/src/change_detection/differs/iterable_differs.mjs +3 -5
- package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -5
- package/esm2020/src/di/injector_compatibility.mjs +4 -9
- package/esm2020/src/render3/features/inherit_definition_feature.mjs +3 -5
- package/esm2020/src/render3/jit/directive.mjs +20 -3
- package/esm2020/src/render3/view_ref.mjs +3 -5
- package/esm2020/src/sanitization/sanitization.mjs +4 -9
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/esm2020/testing/src/r3_test_bed_compiler.mjs +30 -25
- package/fesm2015/core.mjs +47 -67
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +44 -53
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +47 -67
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +44 -53
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
package/fesm2015/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -4837,10 +4837,8 @@ function setCurrentInjector(injector) {
|
|
|
4837
4837
|
}
|
|
4838
4838
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4839
4839
|
if (_currentInjector === undefined) {
|
|
4840
|
-
|
|
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);
|
|
4840
|
+
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
|
|
4841
|
+
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
|
|
4844
4842
|
}
|
|
4845
4843
|
else if (_currentInjector === null) {
|
|
4846
4844
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4946,10 +4944,7 @@ function injectArgs(types) {
|
|
|
4946
4944
|
const arg = resolveForwardRef(types[i]);
|
|
4947
4945
|
if (Array.isArray(arg)) {
|
|
4948
4946
|
if (arg.length === 0) {
|
|
4949
|
-
|
|
4950
|
-
'Arguments array must have arguments.' :
|
|
4951
|
-
'';
|
|
4952
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
4947
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
|
|
4953
4948
|
}
|
|
4954
4949
|
let type = undefined;
|
|
4955
4950
|
let flags = InjectFlags.Default;
|
|
@@ -6200,10 +6195,8 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
6200
6195
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
6201
6196
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6202
6197
|
}
|
|
6203
|
-
|
|
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);
|
|
6198
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
|
|
6199
|
+
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
|
6207
6200
|
}
|
|
6208
6201
|
/**
|
|
6209
6202
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6225,10 +6218,7 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6225
6218
|
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
6226
6219
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6227
6220
|
}
|
|
6228
|
-
|
|
6229
|
-
'unsafe value used in a script context' :
|
|
6230
|
-
'';
|
|
6231
|
-
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6221
|
+
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
|
|
6232
6222
|
}
|
|
6233
6223
|
/**
|
|
6234
6224
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -14072,10 +14062,8 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
14072
14062
|
}
|
|
14073
14063
|
else {
|
|
14074
14064
|
if (superType.ɵcmp) {
|
|
14075
|
-
|
|
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);
|
|
14065
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
14066
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
14079
14067
|
}
|
|
14080
14068
|
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14081
14069
|
superDef = superType.ɵdir;
|
|
@@ -21772,7 +21760,7 @@ class Version {
|
|
|
21772
21760
|
/**
|
|
21773
21761
|
* @publicApi
|
|
21774
21762
|
*/
|
|
21775
|
-
const VERSION = new Version('14.0.
|
|
21763
|
+
const VERSION = new Version('14.0.3');
|
|
21776
21764
|
|
|
21777
21765
|
/**
|
|
21778
21766
|
* @license
|
|
@@ -22110,8 +22098,7 @@ class ViewRef$1 {
|
|
|
22110
22098
|
}
|
|
22111
22099
|
attachToViewContainerRef() {
|
|
22112
22100
|
if (this._appRef) {
|
|
22113
|
-
|
|
22114
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
22101
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');
|
|
22115
22102
|
}
|
|
22116
22103
|
this._attachedToViewContainer = true;
|
|
22117
22104
|
}
|
|
@@ -22121,8 +22108,7 @@ class ViewRef$1 {
|
|
|
22121
22108
|
}
|
|
22122
22109
|
attachToAppRef(appRef) {
|
|
22123
22110
|
if (this._attachedToViewContainer) {
|
|
22124
|
-
|
|
22125
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
22111
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
|
|
22126
22112
|
}
|
|
22127
22113
|
this._appRef = appRef;
|
|
22128
22114
|
}
|
|
@@ -25153,14 +25139,20 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25153
25139
|
// Standalone components are always able to self-reference, so include the component's own
|
|
25154
25140
|
// definition in its `directiveDefs`.
|
|
25155
25141
|
cachedDirectiveDefs = [getComponentDef(type)];
|
|
25142
|
+
const seen = new Set();
|
|
25156
25143
|
for (const rawDep of imports) {
|
|
25157
25144
|
ngDevMode && verifyStandaloneImport(rawDep, type);
|
|
25158
25145
|
const dep = resolveForwardRef(rawDep);
|
|
25146
|
+
if (seen.has(dep)) {
|
|
25147
|
+
continue;
|
|
25148
|
+
}
|
|
25149
|
+
seen.add(dep);
|
|
25159
25150
|
if (!!getNgModuleDef(dep)) {
|
|
25160
25151
|
const scope = transitiveScopesFor(dep);
|
|
25161
25152
|
for (const dir of scope.exported.directives) {
|
|
25162
25153
|
const def = getComponentDef(dir) || getDirectiveDef(dir);
|
|
25163
|
-
if (def) {
|
|
25154
|
+
if (def && !seen.has(dir)) {
|
|
25155
|
+
seen.add(dir);
|
|
25164
25156
|
cachedDirectiveDefs.push(def);
|
|
25165
25157
|
}
|
|
25166
25158
|
}
|
|
@@ -25178,11 +25170,22 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25178
25170
|
const pipeDefs = () => {
|
|
25179
25171
|
if (cachedPipeDefs === null) {
|
|
25180
25172
|
cachedPipeDefs = [];
|
|
25173
|
+
const seen = new Set();
|
|
25181
25174
|
for (const rawDep of imports) {
|
|
25182
25175
|
const dep = resolveForwardRef(rawDep);
|
|
25176
|
+
if (seen.has(dep)) {
|
|
25177
|
+
continue;
|
|
25178
|
+
}
|
|
25179
|
+
seen.add(dep);
|
|
25183
25180
|
if (!!getNgModuleDef(dep)) {
|
|
25184
25181
|
const scope = transitiveScopesFor(dep);
|
|
25185
|
-
|
|
25182
|
+
for (const pipe of scope.exported.pipes) {
|
|
25183
|
+
const def = getPipeDef$1(pipe);
|
|
25184
|
+
if (def && !seen.has(pipe)) {
|
|
25185
|
+
seen.add(pipe);
|
|
25186
|
+
cachedPipeDefs.push(def);
|
|
25187
|
+
}
|
|
25188
|
+
}
|
|
25186
25189
|
}
|
|
25187
25190
|
else {
|
|
25188
25191
|
const def = getPipeDef$1(dep);
|
|
@@ -26962,10 +26965,8 @@ class NgProbeToken {
|
|
|
26962
26965
|
*/
|
|
26963
26966
|
function createPlatform(injector) {
|
|
26964
26967
|
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26965
|
-
|
|
26966
|
-
'There can be only one platform. Destroy the previous one to create a new one.'
|
|
26967
|
-
'';
|
|
26968
|
-
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
|
|
26968
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
|
|
26969
|
+
'There can be only one platform. Destroy the previous one to create a new one.');
|
|
26969
26970
|
}
|
|
26970
26971
|
publishDefaultGlobalUtils();
|
|
26971
26972
|
_platformInjector = injector;
|
|
@@ -27085,8 +27086,7 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
|
27085
27086
|
function assertPlatform(requiredToken) {
|
|
27086
27087
|
const platform = getPlatform();
|
|
27087
27088
|
if (!platform) {
|
|
27088
|
-
|
|
27089
|
-
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
|
|
27089
|
+
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
|
|
27090
27090
|
}
|
|
27091
27091
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
27092
27092
|
!platform.injector.get(requiredToken, null)) {
|
|
@@ -27166,10 +27166,7 @@ class PlatformRef {
|
|
|
27166
27166
|
const moduleRef = moduleFactory.create(ngZoneInjector);
|
|
27167
27167
|
const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
|
|
27168
27168
|
if (!exceptionHandler) {
|
|
27169
|
-
|
|
27170
|
-
'No ErrorHandler. Is platform module (BrowserModule) included?' :
|
|
27171
|
-
'';
|
|
27172
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
27169
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
27173
27170
|
}
|
|
27174
27171
|
ngZone.runOutsideAngular(() => {
|
|
27175
27172
|
const subscription = ngZone.onError.subscribe({
|
|
@@ -27225,12 +27222,10 @@ class PlatformRef {
|
|
|
27225
27222
|
moduleRef.instance.ngDoBootstrap(appRef);
|
|
27226
27223
|
}
|
|
27227
27224
|
else {
|
|
27228
|
-
|
|
27225
|
+
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
|
|
27229
27226
|
`The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
|
|
27230
27227
|
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
27231
|
-
`Please define one of these.`
|
|
27232
|
-
'';
|
|
27233
|
-
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
27228
|
+
`Please define one of these.`);
|
|
27234
27229
|
}
|
|
27235
27230
|
this._modules.push(moduleRef);
|
|
27236
27231
|
}
|
|
@@ -27253,10 +27248,7 @@ class PlatformRef {
|
|
|
27253
27248
|
*/
|
|
27254
27249
|
destroy() {
|
|
27255
27250
|
if (this._destroyed) {
|
|
27256
|
-
|
|
27257
|
-
'The platform has already been destroyed!' :
|
|
27258
|
-
'';
|
|
27259
|
-
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
27251
|
+
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
|
|
27260
27252
|
}
|
|
27261
27253
|
this._modules.slice().forEach(module => module.destroy());
|
|
27262
27254
|
this._destroyListeners.forEach(listener => listener());
|
|
@@ -27590,10 +27582,7 @@ class ApplicationRef {
|
|
|
27590
27582
|
tick() {
|
|
27591
27583
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27592
27584
|
if (this._runningTick) {
|
|
27593
|
-
|
|
27594
|
-
'ApplicationRef.tick is called recursively' :
|
|
27595
|
-
'';
|
|
27596
|
-
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
27585
|
+
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
|
|
27597
27586
|
}
|
|
27598
27587
|
try {
|
|
27599
27588
|
this._runningTick = true;
|
|
@@ -27682,7 +27671,7 @@ class ApplicationRef {
|
|
|
27682
27671
|
*/
|
|
27683
27672
|
destroy() {
|
|
27684
27673
|
if (this._destroyed) {
|
|
27685
|
-
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */,
|
|
27674
|
+
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27686
27675
|
}
|
|
27687
27676
|
const injector = this._injector;
|
|
27688
27677
|
// Check that this injector instance supports destroy operation.
|
|
@@ -28721,10 +28710,8 @@ class DefaultIterableDiffer {
|
|
|
28721
28710
|
if (collection == null)
|
|
28722
28711
|
collection = [];
|
|
28723
28712
|
if (!isListLikeIterable(collection)) {
|
|
28724
|
-
|
|
28725
|
-
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`
|
|
28726
|
-
'';
|
|
28727
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
28713
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
28714
|
+
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
|
|
28728
28715
|
}
|
|
28729
28716
|
if (this.check(collection)) {
|
|
28730
28717
|
return this;
|
|
@@ -29325,10 +29312,8 @@ class DefaultKeyValueDiffer {
|
|
|
29325
29312
|
map = new Map();
|
|
29326
29313
|
}
|
|
29327
29314
|
else if (!(map instanceof Map || isJsObject(map))) {
|
|
29328
|
-
|
|
29329
|
-
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`
|
|
29330
|
-
'';
|
|
29331
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
29315
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
29316
|
+
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
|
|
29332
29317
|
}
|
|
29333
29318
|
return this.check(map) ? this : null;
|
|
29334
29319
|
}
|
|
@@ -29575,10 +29560,8 @@ class IterableDiffers {
|
|
|
29575
29560
|
return factory;
|
|
29576
29561
|
}
|
|
29577
29562
|
else {
|
|
29578
|
-
|
|
29579
|
-
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`
|
|
29580
|
-
'';
|
|
29581
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29563
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&
|
|
29564
|
+
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
|
|
29582
29565
|
}
|
|
29583
29566
|
}
|
|
29584
29567
|
}
|
|
@@ -29652,10 +29635,7 @@ class KeyValueDiffers {
|
|
|
29652
29635
|
if (factory) {
|
|
29653
29636
|
return factory;
|
|
29654
29637
|
}
|
|
29655
|
-
|
|
29656
|
-
`Cannot find a differ supporting object '${kv}'` :
|
|
29657
|
-
'';
|
|
29658
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29638
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
|
|
29659
29639
|
}
|
|
29660
29640
|
}
|
|
29661
29641
|
/** @nocollapse */
|