@angular/core 14.0.3 → 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.
- package/esm2020/src/application_ref.mjs +22 -12
- package/esm2020/src/di/injector_compatibility.mjs +3 -8
- package/esm2020/src/di/jit/util.mjs +3 -2
- package/esm2020/src/di/reflective_key.mjs +3 -2
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/locale_data_api.mjs +3 -2
- package/esm2020/src/render3/component.mjs +3 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +10 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +5 -4
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +41 -25
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +79 -74
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +41 -25
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +79 -74
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +6 -6
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/schematics/utils/schematics_prompt.d.ts +0 -17
- package/schematics/utils/schematics_prompt.js +0 -45
package/fesm2020/core.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.4
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1665,8 +1665,17 @@ var RendererStyleFlags3;
|
|
|
1665
1665
|
function isProceduralRenderer(renderer) {
|
|
1666
1666
|
return !!(renderer.listen);
|
|
1667
1667
|
}
|
|
1668
|
+
let renderer3Enabled = false;
|
|
1669
|
+
function enableRenderer3() {
|
|
1670
|
+
renderer3Enabled = true;
|
|
1671
|
+
}
|
|
1668
1672
|
const domRendererFactory3 = {
|
|
1669
1673
|
createRenderer: (hostElement, rendererType) => {
|
|
1674
|
+
if (!renderer3Enabled) {
|
|
1675
|
+
throw new Error(ngDevMode ?
|
|
1676
|
+
`Renderer3 is not supported. This problem is likely caused by some component in the hierarchy was constructed without a correct parent injector.` :
|
|
1677
|
+
'Renderer3 disabled');
|
|
1678
|
+
}
|
|
1670
1679
|
return getDocument();
|
|
1671
1680
|
}
|
|
1672
1681
|
};
|
|
@@ -4875,22 +4884,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
|
|
|
4875
4884
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
4876
4885
|
* particular class.
|
|
4877
4886
|
*
|
|
4878
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
4879
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
4880
|
-
*
|
|
4881
4887
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
4882
4888
|
* and thus in the stack trace.
|
|
4883
4889
|
*
|
|
4884
4890
|
* @codeGenApi
|
|
4885
4891
|
*/
|
|
4886
4892
|
function ɵɵinvalidFactoryDep(index) {
|
|
4887
|
-
|
|
4893
|
+
throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
|
|
4888
4894
|
`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
|
|
4889
4895
|
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.
|
|
4890
4896
|
|
|
4891
|
-
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.`
|
|
4892
|
-
'invalid';
|
|
4893
|
-
throw new Error(msg);
|
|
4897
|
+
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.`);
|
|
4894
4898
|
}
|
|
4895
4899
|
/**
|
|
4896
4900
|
* Injects a token from the currently active injector.
|
|
@@ -5154,7 +5158,7 @@ function reflectDependency(dep) {
|
|
|
5154
5158
|
}
|
|
5155
5159
|
else if (param instanceof Attribute) {
|
|
5156
5160
|
if (param.attributeName === undefined) {
|
|
5157
|
-
throw new
|
|
5161
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
|
|
5158
5162
|
}
|
|
5159
5163
|
meta.attribute = param.attributeName;
|
|
5160
5164
|
}
|
|
@@ -9818,7 +9822,7 @@ class ReflectiveKey {
|
|
|
9818
9822
|
this.token = token;
|
|
9819
9823
|
this.id = id;
|
|
9820
9824
|
if (!token) {
|
|
9821
|
-
throw new
|
|
9825
|
+
throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
|
|
9822
9826
|
}
|
|
9823
9827
|
this.displayName = stringify(this.token);
|
|
9824
9828
|
}
|
|
@@ -13888,6 +13892,7 @@ const NULL_INJECTOR = {
|
|
|
13888
13892
|
function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
|
|
13889
13893
|
ngDevMode && publishDefaultGlobalUtils$1();
|
|
13890
13894
|
ngDevMode && assertComponentType(componentType);
|
|
13895
|
+
enableRenderer3();
|
|
13891
13896
|
const rendererFactory = opts.rendererFactory || domRendererFactory3;
|
|
13892
13897
|
const sanitizer = opts.sanitizer || null;
|
|
13893
13898
|
const componentDef = getComponentDef(componentType);
|
|
@@ -19197,7 +19202,7 @@ function findLocaleData(locale) {
|
|
|
19197
19202
|
if (parentLocale === 'en') {
|
|
19198
19203
|
return localeEn;
|
|
19199
19204
|
}
|
|
19200
|
-
throw new
|
|
19205
|
+
throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
|
|
19201
19206
|
}
|
|
19202
19207
|
/**
|
|
19203
19208
|
* Retrieves the default currency code for the given locale.
|
|
@@ -21773,7 +21778,7 @@ class Version {
|
|
|
21773
21778
|
/**
|
|
21774
21779
|
* @publicApi
|
|
21775
21780
|
*/
|
|
21776
|
-
const VERSION = new Version('14.0.
|
|
21781
|
+
const VERSION = new Version('14.0.4');
|
|
21777
21782
|
|
|
21778
21783
|
/**
|
|
21779
21784
|
* @license
|
|
@@ -26321,7 +26326,7 @@ class NgZone {
|
|
|
26321
26326
|
*/
|
|
26322
26327
|
this.onError = new EventEmitter(false);
|
|
26323
26328
|
if (typeof Zone == 'undefined') {
|
|
26324
|
-
throw new
|
|
26329
|
+
throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
|
|
26325
26330
|
}
|
|
26326
26331
|
Zone.assertZonePatched();
|
|
26327
26332
|
const self = this;
|
|
@@ -26348,12 +26353,12 @@ class NgZone {
|
|
|
26348
26353
|
}
|
|
26349
26354
|
static assertInAngularZone() {
|
|
26350
26355
|
if (!NgZone.isInAngularZone()) {
|
|
26351
|
-
throw new
|
|
26356
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
|
|
26352
26357
|
}
|
|
26353
26358
|
}
|
|
26354
26359
|
static assertNotInAngularZone() {
|
|
26355
26360
|
if (NgZone.isInAngularZone()) {
|
|
26356
|
-
throw new
|
|
26361
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
|
|
26357
26362
|
}
|
|
26358
26363
|
}
|
|
26359
26364
|
/**
|
|
@@ -26917,7 +26922,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
|
26917
26922
|
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26918
26923
|
* entire class tree-shakeable.
|
|
26919
26924
|
*/
|
|
26920
|
-
const
|
|
26925
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
26921
26926
|
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26922
26927
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26923
26928
|
ngDevMode && assertNgModuleType(moduleType);
|
|
@@ -27056,7 +27061,15 @@ function internalBootstrapApplication(config) {
|
|
|
27056
27061
|
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
27057
27062
|
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
27058
27063
|
const appRef = appInjector.get(ApplicationRef);
|
|
27059
|
-
|
|
27064
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
27065
|
+
// for all bootstrapped applications as well.
|
|
27066
|
+
const destroyListener = () => appRef.destroy();
|
|
27067
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27068
|
+
onPlatformDestroyListeners?.add(destroyListener);
|
|
27069
|
+
appRef.onDestroy(() => {
|
|
27070
|
+
onPlatformDestroyListeners?.delete(destroyListener);
|
|
27071
|
+
onErrorSubscription.unsubscribe();
|
|
27072
|
+
});
|
|
27060
27073
|
appRef.bootstrap(rootComponent);
|
|
27061
27074
|
return appRef;
|
|
27062
27075
|
});
|
|
@@ -27120,7 +27133,7 @@ function createPlatformInjector(providers = [], name) {
|
|
|
27120
27133
|
name,
|
|
27121
27134
|
providers: [
|
|
27122
27135
|
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
27123
|
-
{ provide:
|
|
27136
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
27124
27137
|
...providers
|
|
27125
27138
|
],
|
|
27126
27139
|
});
|
|
@@ -27267,8 +27280,11 @@ class PlatformRef {
|
|
|
27267
27280
|
}
|
|
27268
27281
|
this._modules.slice().forEach(module => module.destroy());
|
|
27269
27282
|
this._destroyListeners.forEach(listener => listener());
|
|
27270
|
-
const
|
|
27271
|
-
|
|
27283
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27284
|
+
if (destroyListeners) {
|
|
27285
|
+
destroyListeners.forEach(listener => listener());
|
|
27286
|
+
destroyListeners.clear();
|
|
27287
|
+
}
|
|
27272
27288
|
this._destroyed = true;
|
|
27273
27289
|
}
|
|
27274
27290
|
/**
|
|
@@ -27426,11 +27442,10 @@ function optionsReducer(dst, objs) {
|
|
|
27426
27442
|
*/
|
|
27427
27443
|
class ApplicationRef {
|
|
27428
27444
|
/** @internal */
|
|
27429
|
-
constructor(_zone, _injector, _exceptionHandler
|
|
27445
|
+
constructor(_zone, _injector, _exceptionHandler) {
|
|
27430
27446
|
this._zone = _zone;
|
|
27431
27447
|
this._injector = _injector;
|
|
27432
27448
|
this._exceptionHandler = _exceptionHandler;
|
|
27433
|
-
this._initStatus = _initStatus;
|
|
27434
27449
|
/** @internal */
|
|
27435
27450
|
this._bootstrapListeners = [];
|
|
27436
27451
|
this._views = [];
|
|
@@ -27547,7 +27562,8 @@ class ApplicationRef {
|
|
|
27547
27562
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27548
27563
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27549
27564
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
27550
|
-
|
|
27565
|
+
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
27566
|
+
if (!initStatus.done) {
|
|
27551
27567
|
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27552
27568
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27553
27569
|
(standalone ? '' :
|
|
@@ -27706,12 +27722,12 @@ class ApplicationRef {
|
|
|
27706
27722
|
}
|
|
27707
27723
|
}
|
|
27708
27724
|
}
|
|
27709
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)
|
|
27725
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)); };
|
|
27710
27726
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
27711
27727
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
27712
27728
|
type: Injectable,
|
|
27713
27729
|
args: [{ providedIn: 'root' }]
|
|
27714
|
-
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }
|
|
27730
|
+
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }]; }, null); })();
|
|
27715
27731
|
function remove(list, el) {
|
|
27716
27732
|
const index = list.indexOf(el);
|
|
27717
27733
|
if (index > -1) {
|