@angular/core 14.1.0-next.0 → 14.1.0-next.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 +31 -35
- 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 +6 -16
- 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/features/inherit_definition_feature.mjs +3 -5
- package/esm2020/src/render3/interfaces/renderer.mjs +10 -1
- package/esm2020/src/render3/jit/directive.mjs +20 -3
- package/esm2020/src/render3/jit/module.mjs +2 -1
- package/esm2020/src/render3/ng_module_ref.mjs +10 -2
- 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/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/esm2020/testing/src/r3_test_bed_compiler.mjs +30 -25
- package/fesm2015/core.mjs +96 -91
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +131 -126
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +96 -91
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +131 -126
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +15 -7
- 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.1.0-next.
|
|
2
|
+
* @license Angular v14.1.0-next.3
|
|
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
|
};
|
|
@@ -4858,10 +4867,8 @@ function setCurrentInjector(injector) {
|
|
|
4858
4867
|
}
|
|
4859
4868
|
function injectInjectorOnly(token, flags = InjectFlags.Default) {
|
|
4860
4869
|
if (_currentInjector === undefined) {
|
|
4861
|
-
|
|
4862
|
-
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`
|
|
4863
|
-
'';
|
|
4864
|
-
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
|
|
4870
|
+
throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
|
|
4871
|
+
`inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
|
|
4865
4872
|
}
|
|
4866
4873
|
else if (_currentInjector === null) {
|
|
4867
4874
|
return injectRootLimpMode(token, undefined, flags);
|
|
@@ -4877,22 +4884,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
|
|
|
4877
4884
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
4878
4885
|
* particular class.
|
|
4879
4886
|
*
|
|
4880
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
4881
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
4882
|
-
*
|
|
4883
4887
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
4884
4888
|
* and thus in the stack trace.
|
|
4885
4889
|
*
|
|
4886
4890
|
* @codeGenApi
|
|
4887
4891
|
*/
|
|
4888
4892
|
function ɵɵinvalidFactoryDep(index) {
|
|
4889
|
-
|
|
4893
|
+
throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
|
|
4890
4894
|
`This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
|
|
4891
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.
|
|
4892
4896
|
|
|
4893
|
-
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
|
-
'invalid';
|
|
4895
|
-
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.`);
|
|
4896
4898
|
}
|
|
4897
4899
|
/**
|
|
4898
4900
|
* Injects a token from the currently active injector.
|
|
@@ -4967,10 +4969,7 @@ function injectArgs(types) {
|
|
|
4967
4969
|
const arg = resolveForwardRef(types[i]);
|
|
4968
4970
|
if (Array.isArray(arg)) {
|
|
4969
4971
|
if (arg.length === 0) {
|
|
4970
|
-
|
|
4971
|
-
'Arguments array must have arguments.' :
|
|
4972
|
-
'';
|
|
4973
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
4972
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
|
|
4974
4973
|
}
|
|
4975
4974
|
let type = undefined;
|
|
4976
4975
|
let flags = InjectFlags.Default;
|
|
@@ -5159,7 +5158,7 @@ function reflectDependency(dep) {
|
|
|
5159
5158
|
}
|
|
5160
5159
|
else if (param instanceof Attribute) {
|
|
5161
5160
|
if (param.attributeName === undefined) {
|
|
5162
|
-
throw new
|
|
5161
|
+
throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
|
|
5163
5162
|
}
|
|
5164
5163
|
meta.attribute = param.attributeName;
|
|
5165
5164
|
}
|
|
@@ -6215,10 +6214,8 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
|
6215
6214
|
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
6216
6215
|
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6217
6216
|
}
|
|
6218
|
-
|
|
6219
|
-
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)'
|
|
6220
|
-
'';
|
|
6221
|
-
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
|
|
6217
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
|
|
6218
|
+
'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
|
|
6222
6219
|
}
|
|
6223
6220
|
/**
|
|
6224
6221
|
* A `script` sanitizer which only lets trusted javascript through.
|
|
@@ -6240,10 +6237,7 @@ function ɵɵsanitizeScript(unsafeScript) {
|
|
|
6240
6237
|
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
6241
6238
|
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6242
6239
|
}
|
|
6243
|
-
|
|
6244
|
-
'unsafe value used in a script context' :
|
|
6245
|
-
'';
|
|
6246
|
-
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
|
|
6240
|
+
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
|
|
6247
6241
|
}
|
|
6248
6242
|
/**
|
|
6249
6243
|
* A template tag function for promoting the associated constant literal to a
|
|
@@ -9828,7 +9822,7 @@ class ReflectiveKey {
|
|
|
9828
9822
|
this.token = token;
|
|
9829
9823
|
this.id = id;
|
|
9830
9824
|
if (!token) {
|
|
9831
|
-
throw new
|
|
9825
|
+
throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
|
|
9832
9826
|
}
|
|
9833
9827
|
this.displayName = stringify(this.token);
|
|
9834
9828
|
}
|
|
@@ -13898,6 +13892,7 @@ const NULL_INJECTOR = {
|
|
|
13898
13892
|
function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
|
|
13899
13893
|
ngDevMode && publishDefaultGlobalUtils$1();
|
|
13900
13894
|
ngDevMode && assertComponentType(componentType);
|
|
13895
|
+
enableRenderer3();
|
|
13901
13896
|
const rendererFactory = opts.rendererFactory || domRendererFactory3;
|
|
13902
13897
|
const sanitizer = opts.sanitizer || null;
|
|
13903
13898
|
const componentDef = getComponentDef(componentType);
|
|
@@ -14085,10 +14080,8 @@ function ɵɵInheritDefinitionFeature(definition) {
|
|
|
14085
14080
|
}
|
|
14086
14081
|
else {
|
|
14087
14082
|
if (superType.ɵcmp) {
|
|
14088
|
-
|
|
14089
|
-
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`
|
|
14090
|
-
'';
|
|
14091
|
-
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, errorMessage);
|
|
14083
|
+
throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
|
|
14084
|
+
`Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
|
|
14092
14085
|
}
|
|
14093
14086
|
// Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
|
|
14094
14087
|
superDef = superType.ɵdir;
|
|
@@ -19209,7 +19202,7 @@ function findLocaleData(locale) {
|
|
|
19209
19202
|
if (parentLocale === 'en') {
|
|
19210
19203
|
return localeEn;
|
|
19211
19204
|
}
|
|
19212
|
-
throw new
|
|
19205
|
+
throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
|
|
19213
19206
|
}
|
|
19214
19207
|
/**
|
|
19215
19208
|
* Retrieves the default currency code for the given locale.
|
|
@@ -21785,7 +21778,7 @@ class Version {
|
|
|
21785
21778
|
/**
|
|
21786
21779
|
* @publicApi
|
|
21787
21780
|
*/
|
|
21788
|
-
const VERSION = new Version('14.1.0-next.
|
|
21781
|
+
const VERSION = new Version('14.1.0-next.3');
|
|
21789
21782
|
|
|
21790
21783
|
/**
|
|
21791
21784
|
* @license
|
|
@@ -22123,8 +22116,7 @@ class ViewRef$1 {
|
|
|
22123
22116
|
}
|
|
22124
22117
|
attachToViewContainerRef() {
|
|
22125
22118
|
if (this._appRef) {
|
|
22126
|
-
|
|
22127
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
22119
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');
|
|
22128
22120
|
}
|
|
22129
22121
|
this._attachedToViewContainer = true;
|
|
22130
22122
|
}
|
|
@@ -22134,8 +22126,7 @@ class ViewRef$1 {
|
|
|
22134
22126
|
}
|
|
22135
22127
|
attachToAppRef(appRef) {
|
|
22136
22128
|
if (this._attachedToViewContainer) {
|
|
22137
|
-
|
|
22138
|
-
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
|
|
22129
|
+
throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
|
|
22139
22130
|
}
|
|
22140
22131
|
this._appRef = appRef;
|
|
22141
22132
|
}
|
|
@@ -22456,10 +22447,18 @@ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
|
|
|
22456
22447
|
/**
|
|
22457
22448
|
* Create a new environment injector.
|
|
22458
22449
|
*
|
|
22450
|
+
* Learn more about environment injectors in
|
|
22451
|
+
* [this guide](guide/standalone-components#environment-injectors).
|
|
22452
|
+
*
|
|
22453
|
+
* @param providers An array of providers.
|
|
22454
|
+
* @param parent A parent environment injector.
|
|
22455
|
+
* @param debugName An optional name for this injector instance, which will be used in error
|
|
22456
|
+
* messages.
|
|
22457
|
+
*
|
|
22459
22458
|
* @publicApi
|
|
22460
22459
|
* @developerPreview
|
|
22461
22460
|
*/
|
|
22462
|
-
function createEnvironmentInjector(providers, parent
|
|
22461
|
+
function createEnvironmentInjector(providers, parent, debugName = null) {
|
|
22463
22462
|
const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
|
|
22464
22463
|
return adapter.injector;
|
|
22465
22464
|
}
|
|
@@ -24825,6 +24824,7 @@ function setScopeOnDeclaredComponents(moduleType, ngModule) {
|
|
|
24825
24824
|
const declarations = flatten(ngModule.declarations || EMPTY_ARRAY);
|
|
24826
24825
|
const transitiveScopes = transitiveScopesFor(moduleType);
|
|
24827
24826
|
declarations.forEach(declaration => {
|
|
24827
|
+
declaration = resolveForwardRef(declaration);
|
|
24828
24828
|
if (declaration.hasOwnProperty(NG_COMP_DEF)) {
|
|
24829
24829
|
// A `ɵcmp` field exists - go ahead and patch the component directly.
|
|
24830
24830
|
const component = declaration;
|
|
@@ -25176,14 +25176,20 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25176
25176
|
// Standalone components are always able to self-reference, so include the component's own
|
|
25177
25177
|
// definition in its `directiveDefs`.
|
|
25178
25178
|
cachedDirectiveDefs = [getComponentDef(type)];
|
|
25179
|
+
const seen = new Set();
|
|
25179
25180
|
for (const rawDep of imports) {
|
|
25180
25181
|
ngDevMode && verifyStandaloneImport(rawDep, type);
|
|
25181
25182
|
const dep = resolveForwardRef(rawDep);
|
|
25183
|
+
if (seen.has(dep)) {
|
|
25184
|
+
continue;
|
|
25185
|
+
}
|
|
25186
|
+
seen.add(dep);
|
|
25182
25187
|
if (!!getNgModuleDef(dep)) {
|
|
25183
25188
|
const scope = transitiveScopesFor(dep);
|
|
25184
25189
|
for (const dir of scope.exported.directives) {
|
|
25185
25190
|
const def = getComponentDef(dir) || getDirectiveDef(dir);
|
|
25186
|
-
if (def) {
|
|
25191
|
+
if (def && !seen.has(dir)) {
|
|
25192
|
+
seen.add(dir);
|
|
25187
25193
|
cachedDirectiveDefs.push(def);
|
|
25188
25194
|
}
|
|
25189
25195
|
}
|
|
@@ -25201,11 +25207,22 @@ function getStandaloneDefFunctions(type, imports) {
|
|
|
25201
25207
|
const pipeDefs = () => {
|
|
25202
25208
|
if (cachedPipeDefs === null) {
|
|
25203
25209
|
cachedPipeDefs = [];
|
|
25210
|
+
const seen = new Set();
|
|
25204
25211
|
for (const rawDep of imports) {
|
|
25205
25212
|
const dep = resolveForwardRef(rawDep);
|
|
25213
|
+
if (seen.has(dep)) {
|
|
25214
|
+
continue;
|
|
25215
|
+
}
|
|
25216
|
+
seen.add(dep);
|
|
25206
25217
|
if (!!getNgModuleDef(dep)) {
|
|
25207
25218
|
const scope = transitiveScopesFor(dep);
|
|
25208
|
-
|
|
25219
|
+
for (const pipe of scope.exported.pipes) {
|
|
25220
|
+
const def = getPipeDef$1(pipe);
|
|
25221
|
+
if (def && !seen.has(pipe)) {
|
|
25222
|
+
seen.add(pipe);
|
|
25223
|
+
cachedPipeDefs.push(def);
|
|
25224
|
+
}
|
|
25225
|
+
}
|
|
25209
25226
|
}
|
|
25210
25227
|
else {
|
|
25211
25228
|
const def = getPipeDef$1(dep);
|
|
@@ -26317,7 +26334,7 @@ class NgZone {
|
|
|
26317
26334
|
*/
|
|
26318
26335
|
this.onError = new EventEmitter(false);
|
|
26319
26336
|
if (typeof Zone == 'undefined') {
|
|
26320
|
-
throw new
|
|
26337
|
+
throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
|
|
26321
26338
|
}
|
|
26322
26339
|
Zone.assertZonePatched();
|
|
26323
26340
|
const self = this;
|
|
@@ -26344,12 +26361,12 @@ class NgZone {
|
|
|
26344
26361
|
}
|
|
26345
26362
|
static assertInAngularZone() {
|
|
26346
26363
|
if (!NgZone.isInAngularZone()) {
|
|
26347
|
-
throw new
|
|
26364
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
|
|
26348
26365
|
}
|
|
26349
26366
|
}
|
|
26350
26367
|
static assertNotInAngularZone() {
|
|
26351
26368
|
if (NgZone.isInAngularZone()) {
|
|
26352
|
-
throw new
|
|
26369
|
+
throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
|
|
26353
26370
|
}
|
|
26354
26371
|
}
|
|
26355
26372
|
/**
|
|
@@ -26913,7 +26930,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
|
|
|
26913
26930
|
* `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
|
|
26914
26931
|
* entire class tree-shakeable.
|
|
26915
26932
|
*/
|
|
26916
|
-
const
|
|
26933
|
+
const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
|
|
26917
26934
|
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
26918
26935
|
function compileNgModuleFactory(injector, options, moduleType) {
|
|
26919
26936
|
ngDevMode && assertNgModuleType(moduleType);
|
|
@@ -26978,10 +26995,8 @@ class NgProbeToken {
|
|
|
26978
26995
|
*/
|
|
26979
26996
|
function createPlatform(injector) {
|
|
26980
26997
|
if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
|
|
26981
|
-
|
|
26982
|
-
'There can be only one platform. Destroy the previous one to create a new one.'
|
|
26983
|
-
'';
|
|
26984
|
-
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
|
|
26998
|
+
throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
|
|
26999
|
+
'There can be only one platform. Destroy the previous one to create a new one.');
|
|
26985
27000
|
}
|
|
26986
27001
|
publishDefaultGlobalUtils();
|
|
26987
27002
|
_platformInjector = injector;
|
|
@@ -27054,7 +27069,15 @@ function internalBootstrapApplication(config) {
|
|
|
27054
27069
|
const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
|
|
27055
27070
|
setLocaleId(localeId || DEFAULT_LOCALE_ID);
|
|
27056
27071
|
const appRef = appInjector.get(ApplicationRef);
|
|
27057
|
-
|
|
27072
|
+
// If the whole platform is destroyed, invoke the `destroy` method
|
|
27073
|
+
// for all bootstrapped applications as well.
|
|
27074
|
+
const destroyListener = () => appRef.destroy();
|
|
27075
|
+
const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27076
|
+
onPlatformDestroyListeners?.add(destroyListener);
|
|
27077
|
+
appRef.onDestroy(() => {
|
|
27078
|
+
onPlatformDestroyListeners?.delete(destroyListener);
|
|
27079
|
+
onErrorSubscription.unsubscribe();
|
|
27080
|
+
});
|
|
27058
27081
|
appRef.bootstrap(rootComponent);
|
|
27059
27082
|
return appRef;
|
|
27060
27083
|
});
|
|
@@ -27101,8 +27124,7 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
|
|
|
27101
27124
|
function assertPlatform(requiredToken) {
|
|
27102
27125
|
const platform = getPlatform();
|
|
27103
27126
|
if (!platform) {
|
|
27104
|
-
|
|
27105
|
-
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
|
|
27127
|
+
throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
|
|
27106
27128
|
}
|
|
27107
27129
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
27108
27130
|
!platform.injector.get(requiredToken, null)) {
|
|
@@ -27119,7 +27141,7 @@ function createPlatformInjector(providers = [], name) {
|
|
|
27119
27141
|
name,
|
|
27120
27142
|
providers: [
|
|
27121
27143
|
{ provide: INJECTOR_SCOPE, useValue: 'platform' },
|
|
27122
|
-
{ provide:
|
|
27144
|
+
{ provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
|
|
27123
27145
|
...providers
|
|
27124
27146
|
],
|
|
27125
27147
|
});
|
|
@@ -27180,10 +27202,7 @@ class PlatformRef {
|
|
|
27180
27202
|
const moduleRef = moduleFactory.create(ngZoneInjector);
|
|
27181
27203
|
const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
|
|
27182
27204
|
if (!exceptionHandler) {
|
|
27183
|
-
|
|
27184
|
-
'No ErrorHandler. Is platform module (BrowserModule) included?' :
|
|
27185
|
-
'';
|
|
27186
|
-
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
|
|
27205
|
+
throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');
|
|
27187
27206
|
}
|
|
27188
27207
|
ngZone.runOutsideAngular(() => {
|
|
27189
27208
|
const subscription = ngZone.onError.subscribe({
|
|
@@ -27239,12 +27258,10 @@ class PlatformRef {
|
|
|
27239
27258
|
moduleRef.instance.ngDoBootstrap(appRef);
|
|
27240
27259
|
}
|
|
27241
27260
|
else {
|
|
27242
|
-
|
|
27261
|
+
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
|
|
27243
27262
|
`The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
|
|
27244
27263
|
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
|
|
27245
|
-
`Please define one of these.`
|
|
27246
|
-
'';
|
|
27247
|
-
throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
|
|
27264
|
+
`Please define one of these.`);
|
|
27248
27265
|
}
|
|
27249
27266
|
this._modules.push(moduleRef);
|
|
27250
27267
|
}
|
|
@@ -27267,15 +27284,15 @@ class PlatformRef {
|
|
|
27267
27284
|
*/
|
|
27268
27285
|
destroy() {
|
|
27269
27286
|
if (this._destroyed) {
|
|
27270
|
-
|
|
27271
|
-
'The platform has already been destroyed!' :
|
|
27272
|
-
'';
|
|
27273
|
-
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
|
|
27287
|
+
throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
|
|
27274
27288
|
}
|
|
27275
27289
|
this._modules.slice().forEach(module => module.destroy());
|
|
27276
27290
|
this._destroyListeners.forEach(listener => listener());
|
|
27277
|
-
const
|
|
27278
|
-
|
|
27291
|
+
const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
|
|
27292
|
+
if (destroyListeners) {
|
|
27293
|
+
destroyListeners.forEach(listener => listener());
|
|
27294
|
+
destroyListeners.clear();
|
|
27295
|
+
}
|
|
27279
27296
|
this._destroyed = true;
|
|
27280
27297
|
}
|
|
27281
27298
|
/**
|
|
@@ -27433,11 +27450,10 @@ function optionsReducer(dst, objs) {
|
|
|
27433
27450
|
*/
|
|
27434
27451
|
class ApplicationRef {
|
|
27435
27452
|
/** @internal */
|
|
27436
|
-
constructor(_zone, _injector, _exceptionHandler
|
|
27453
|
+
constructor(_zone, _injector, _exceptionHandler) {
|
|
27437
27454
|
this._zone = _zone;
|
|
27438
27455
|
this._injector = _injector;
|
|
27439
27456
|
this._exceptionHandler = _exceptionHandler;
|
|
27440
|
-
this._initStatus = _initStatus;
|
|
27441
27457
|
/** @internal */
|
|
27442
27458
|
this._bootstrapListeners = [];
|
|
27443
27459
|
this._views = [];
|
|
@@ -27554,7 +27570,8 @@ class ApplicationRef {
|
|
|
27554
27570
|
bootstrap(componentOrFactory, rootSelectorOrNode) {
|
|
27555
27571
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27556
27572
|
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
27557
|
-
|
|
27573
|
+
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
27574
|
+
if (!initStatus.done) {
|
|
27558
27575
|
const standalone = !isComponentFactory && isStandalone(componentOrFactory);
|
|
27559
27576
|
const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
|
|
27560
27577
|
(standalone ? '' :
|
|
@@ -27602,10 +27619,7 @@ class ApplicationRef {
|
|
|
27602
27619
|
tick() {
|
|
27603
27620
|
NG_DEV_MODE && this.warnIfDestroyed();
|
|
27604
27621
|
if (this._runningTick) {
|
|
27605
|
-
|
|
27606
|
-
'ApplicationRef.tick is called recursively' :
|
|
27607
|
-
'';
|
|
27608
|
-
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
|
|
27622
|
+
throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
|
|
27609
27623
|
}
|
|
27610
27624
|
try {
|
|
27611
27625
|
this._runningTick = true;
|
|
@@ -27694,7 +27708,7 @@ class ApplicationRef {
|
|
|
27694
27708
|
*/
|
|
27695
27709
|
destroy() {
|
|
27696
27710
|
if (this._destroyed) {
|
|
27697
|
-
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */,
|
|
27711
|
+
throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
|
|
27698
27712
|
}
|
|
27699
27713
|
const injector = this._injector;
|
|
27700
27714
|
// Check that this injector instance supports destroy operation.
|
|
@@ -27716,12 +27730,12 @@ class ApplicationRef {
|
|
|
27716
27730
|
}
|
|
27717
27731
|
}
|
|
27718
27732
|
}
|
|
27719
|
-
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)
|
|
27733
|
+
ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)); };
|
|
27720
27734
|
ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
|
|
27721
27735
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
|
|
27722
27736
|
type: Injectable,
|
|
27723
27737
|
args: [{ providedIn: 'root' }]
|
|
27724
|
-
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }
|
|
27738
|
+
}], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }]; }, null); })();
|
|
27725
27739
|
function remove(list, el) {
|
|
27726
27740
|
const index = list.indexOf(el);
|
|
27727
27741
|
if (index > -1) {
|
|
@@ -28731,10 +28745,8 @@ class DefaultIterableDiffer {
|
|
|
28731
28745
|
if (collection == null)
|
|
28732
28746
|
collection = [];
|
|
28733
28747
|
if (!isListLikeIterable(collection)) {
|
|
28734
|
-
|
|
28735
|
-
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`
|
|
28736
|
-
'';
|
|
28737
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
28748
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
28749
|
+
`Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
|
|
28738
28750
|
}
|
|
28739
28751
|
if (this.check(collection)) {
|
|
28740
28752
|
return this;
|
|
@@ -29335,10 +29347,8 @@ class DefaultKeyValueDiffer {
|
|
|
29335
29347
|
map = new Map();
|
|
29336
29348
|
}
|
|
29337
29349
|
else if (!(map instanceof Map || isJsObject(map))) {
|
|
29338
|
-
|
|
29339
|
-
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`
|
|
29340
|
-
'';
|
|
29341
|
-
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
|
|
29350
|
+
throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
|
|
29351
|
+
`Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
|
|
29342
29352
|
}
|
|
29343
29353
|
return this.check(map) ? this : null;
|
|
29344
29354
|
}
|
|
@@ -29585,10 +29595,8 @@ class IterableDiffers {
|
|
|
29585
29595
|
return factory;
|
|
29586
29596
|
}
|
|
29587
29597
|
else {
|
|
29588
|
-
|
|
29589
|
-
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`
|
|
29590
|
-
'';
|
|
29591
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29598
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&
|
|
29599
|
+
`Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
|
|
29592
29600
|
}
|
|
29593
29601
|
}
|
|
29594
29602
|
}
|
|
@@ -29662,10 +29670,7 @@ class KeyValueDiffers {
|
|
|
29662
29670
|
if (factory) {
|
|
29663
29671
|
return factory;
|
|
29664
29672
|
}
|
|
29665
|
-
|
|
29666
|
-
`Cannot find a differ supporting object '${kv}'` :
|
|
29667
|
-
'';
|
|
29668
|
-
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
|
|
29673
|
+
throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
|
|
29669
29674
|
}
|
|
29670
29675
|
}
|
|
29671
29676
|
/** @nocollapse */
|