@angular/core 22.0.0-next.5 → 22.0.0-next.7
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/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_debug_node-chunk.mjs +164 -70
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +1 -1
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_pending_tasks-chunk.mjs +2 -2
- package/fesm2022/_pending_tasks-chunk.mjs.map +1 -1
- package/fesm2022/_resource-chunk.mjs +1 -1
- package/fesm2022/_untracked-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/core.mjs +2 -2
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -5
- package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives-signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/package.json +2 -2
- package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
- package/schematics/bundles/can-match-snapshot-required.cjs +104 -0
- package/schematics/bundles/change-detection-eager.cjs +1 -1
- package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
- package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
- package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
- package/schematics/bundles/control-flow-migration.cjs +1 -1
- package/schematics/bundles/http-xhr-backend.cjs +6 -11
- package/schematics/bundles/imports-CKV-ITqD.cjs +1 -1
- package/schematics/bundles/{index-BtLcQH8g.cjs → index-DADA7AvC.cjs} +7 -3
- package/schematics/bundles/inject-migration.cjs +1 -1
- package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Dp33iyGx.cjs → migrate_ts_type_references-B9LlDDUg.cjs} +2 -2
- package/schematics/bundles/ng_component_template-DPAF1aEA.cjs +1 -1
- package/schematics/bundles/ng_decorators-IVztR9rk.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
- package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
- package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +2 -2
- package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
- package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
- package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
- package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +22 -2
- package/schematics/bundles/router-testing-module-migration.cjs +1 -1
- package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
- package/schematics/bundles/signal-input-migration.cjs +3 -3
- package/schematics/bundles/signal-queries-migration.cjs +3 -3
- package/schematics/bundles/signals.cjs +3 -3
- package/schematics/bundles/standalone-migration.cjs +29 -17
- package/schematics/bundles/strict-templates.cjs +55 -0
- package/schematics/migrations.json +10 -0
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
- package/types/_debug_node-chunk.d.ts +13 -55
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +1 -1
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +2 -23
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +1 -1
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-next.
|
|
2
|
+
* @license Angular v22.0.0-next.7
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3354,10 +3354,37 @@ function ɵɵtrustConstantResourceUrl(url) {
|
|
|
3354
3354
|
}
|
|
3355
3355
|
return trustedScriptURLFromString(url[0]);
|
|
3356
3356
|
}
|
|
3357
|
-
const
|
|
3358
|
-
|
|
3357
|
+
const RESOURCE_MAP = {
|
|
3358
|
+
'embed': {
|
|
3359
|
+
'src': true
|
|
3360
|
+
},
|
|
3361
|
+
'frame': {
|
|
3362
|
+
'src': true
|
|
3363
|
+
},
|
|
3364
|
+
'iframe': {
|
|
3365
|
+
'src': true
|
|
3366
|
+
},
|
|
3367
|
+
'media': {
|
|
3368
|
+
'src': true
|
|
3369
|
+
},
|
|
3370
|
+
'script': {
|
|
3371
|
+
'src': true,
|
|
3372
|
+
'href': true,
|
|
3373
|
+
'xlink:href': true
|
|
3374
|
+
},
|
|
3375
|
+
'base': {
|
|
3376
|
+
'href': true
|
|
3377
|
+
},
|
|
3378
|
+
'link': {
|
|
3379
|
+
'href': true
|
|
3380
|
+
},
|
|
3381
|
+
'object': {
|
|
3382
|
+
'data': true,
|
|
3383
|
+
'codebase': true
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3359
3386
|
function getUrlSanitizer(tag, prop) {
|
|
3360
|
-
const isResource =
|
|
3387
|
+
const isResource = RESOURCE_MAP[tag]?.[prop] === true;
|
|
3361
3388
|
return isResource ? ɵɵsanitizeResourceUrl : ɵɵsanitizeUrl;
|
|
3362
3389
|
}
|
|
3363
3390
|
function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
|
|
@@ -3379,18 +3406,38 @@ function getSanitizer() {
|
|
|
3379
3406
|
const lView = getLView();
|
|
3380
3407
|
return lView && lView[ENVIRONMENT].sanitizer;
|
|
3381
3408
|
}
|
|
3382
|
-
const
|
|
3409
|
+
const SECURITY_SENSITIVE_ATTRIBUTE_NAMES = new Set(['href', 'xlink:href']);
|
|
3383
3410
|
const SECURITY_SENSITIVE_ELEMENTS = {
|
|
3384
|
-
'iframe':
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3411
|
+
'iframe': {
|
|
3412
|
+
'sandbox': true,
|
|
3413
|
+
'allow': true,
|
|
3414
|
+
'allowfullscreen': true,
|
|
3415
|
+
'referrerpolicy': true,
|
|
3416
|
+
'csp': true,
|
|
3417
|
+
'fetchpriority': true
|
|
3418
|
+
},
|
|
3419
|
+
'animate': {
|
|
3420
|
+
'attributename': true,
|
|
3421
|
+
'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,
|
|
3422
|
+
'values': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,
|
|
3423
|
+
'from': SECURITY_SENSITIVE_ATTRIBUTE_NAMES
|
|
3424
|
+
},
|
|
3425
|
+
'set': {
|
|
3426
|
+
'attributename': true,
|
|
3427
|
+
'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES
|
|
3428
|
+
},
|
|
3429
|
+
'animatemotion': {
|
|
3430
|
+
'attributename': true
|
|
3431
|
+
},
|
|
3432
|
+
'animatetransform': {
|
|
3433
|
+
'attributename': true
|
|
3434
|
+
}
|
|
3389
3435
|
};
|
|
3390
3436
|
function ɵɵvalidateAttribute(value, tagName, attributeName) {
|
|
3391
3437
|
const lowerCaseTagName = tagName.toLowerCase();
|
|
3392
3438
|
const lowerCaseAttrName = attributeName.toLowerCase();
|
|
3393
|
-
|
|
3439
|
+
const validationConfig = SECURITY_SENSITIVE_ELEMENTS[lowerCaseTagName]?.[lowerCaseAttrName];
|
|
3440
|
+
if (!validationConfig) {
|
|
3394
3441
|
return value;
|
|
3395
3442
|
}
|
|
3396
3443
|
const tNode = getSelectedTNode();
|
|
@@ -3402,6 +3449,15 @@ function ɵɵvalidateAttribute(value, tagName, attributeName) {
|
|
|
3402
3449
|
const element = getNativeByTNode(tNode, lView);
|
|
3403
3450
|
enforceIframeSecurity(element);
|
|
3404
3451
|
}
|
|
3452
|
+
if (typeof validationConfig !== 'boolean') {
|
|
3453
|
+
const element = getNativeByTNode(tNode, lView);
|
|
3454
|
+
const attributeNameValue = element.getAttribute('attributeName');
|
|
3455
|
+
if (attributeNameValue && validationConfig.has(attributeNameValue.toLowerCase())) {
|
|
3456
|
+
const errorMessage = ngDevMode && `Angular has detected that the \`${attributeName}\` was applied ` + `as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` + `as a static attribute only when the "attributeName" is set to \'${attributeNameValue}\'. \n` + `To fix this, switch the \`${attributeNameValue}\` binding to a static attribute ` + `in a template or in host bindings section.`;
|
|
3457
|
+
throw new RuntimeError(-910, errorMessage);
|
|
3458
|
+
}
|
|
3459
|
+
return value;
|
|
3460
|
+
}
|
|
3405
3461
|
const errorMessage = ngDevMode && `Angular has detected that the \`${attributeName}\` was applied ` + `as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` + `as a static attribute only. \n` + `To fix this, switch the \`${attributeName}\` binding to a static attribute ` + `in a template or in host bindings section.`;
|
|
3406
3462
|
throw new RuntimeError(-910, errorMessage);
|
|
3407
3463
|
}
|
|
@@ -8890,7 +8946,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
8890
8946
|
}
|
|
8891
8947
|
}
|
|
8892
8948
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
8893
|
-
const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.
|
|
8949
|
+
const tAttributes = rootSelectorOrNode ? ['ng-version', '22.0.0-next.7'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
8894
8950
|
let creationBindings = null;
|
|
8895
8951
|
let updateBindings = null;
|
|
8896
8952
|
let varsToAllocate = 0;
|
|
@@ -9081,34 +9137,26 @@ class R3ViewContainerRef extends ViewContainerRef {
|
|
|
9081
9137
|
this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView));
|
|
9082
9138
|
return viewRef;
|
|
9083
9139
|
}
|
|
9084
|
-
createComponent(
|
|
9085
|
-
const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType);
|
|
9140
|
+
createComponent(componentType, opts, injector, projectableNodes, environmentInjector, directives, bindings) {
|
|
9086
9141
|
let index;
|
|
9087
|
-
if (
|
|
9088
|
-
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9092
|
-
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
|
|
9097
|
-
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
injector = options.injector;
|
|
9103
|
-
projectableNodes = options.projectableNodes;
|
|
9104
|
-
environmentInjector = options.environmentInjector || options.ngModuleRef;
|
|
9105
|
-
directives = options.directives;
|
|
9106
|
-
bindings = options.bindings;
|
|
9107
|
-
}
|
|
9108
|
-
const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory(getComponentDef(componentFactoryOrType));
|
|
9142
|
+
if (ngDevMode) {
|
|
9143
|
+
assertDefined(getComponentDef(componentType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`);
|
|
9144
|
+
assertEqual(typeof opts !== 'number', true, 'It looks like Component type was provided as the first argument ' + "and a number (representing an index at which to insert the new component's " + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.');
|
|
9145
|
+
}
|
|
9146
|
+
const options = opts || {};
|
|
9147
|
+
if (ngDevMode && options.environmentInjector && options.ngModuleRef) {
|
|
9148
|
+
throwError(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`);
|
|
9149
|
+
}
|
|
9150
|
+
index = options.index;
|
|
9151
|
+
injector = options.injector;
|
|
9152
|
+
projectableNodes = options.projectableNodes;
|
|
9153
|
+
environmentInjector = options.environmentInjector || options.ngModuleRef;
|
|
9154
|
+
directives = options.directives;
|
|
9155
|
+
bindings = options.bindings;
|
|
9156
|
+
const componentFactory = new ComponentFactory(getComponentDef(componentType));
|
|
9109
9157
|
const contextInjector = injector || this.parentInjector;
|
|
9110
9158
|
if (!environmentInjector && componentFactory.ngModule == null) {
|
|
9111
|
-
const _injector =
|
|
9159
|
+
const _injector = this.parentInjector;
|
|
9112
9160
|
const result = _injector.get(EnvironmentInjector, null);
|
|
9113
9161
|
if (result) {
|
|
9114
9162
|
environmentInjector = result;
|
|
@@ -9237,7 +9285,10 @@ function populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) {
|
|
|
9237
9285
|
}
|
|
9238
9286
|
const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex);
|
|
9239
9287
|
const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex];
|
|
9240
|
-
|
|
9288
|
+
if (serializedViews === undefined) {
|
|
9289
|
+
ngDevMode && console.warn('Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.');
|
|
9290
|
+
return false;
|
|
9291
|
+
}
|
|
9241
9292
|
const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews);
|
|
9242
9293
|
if (ngDevMode) {
|
|
9243
9294
|
validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true);
|
|
@@ -10250,7 +10301,7 @@ function resolveHostDirectives(matches) {
|
|
|
10250
10301
|
const start = allDirectiveDefs.length;
|
|
10251
10302
|
hostDirectiveDefs ??= new Map();
|
|
10252
10303
|
hostDirectiveRanges ??= new Map();
|
|
10253
|
-
findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs);
|
|
10304
|
+
findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs, matches);
|
|
10254
10305
|
hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]);
|
|
10255
10306
|
}
|
|
10256
10307
|
if (i === 0 && isComponentDef(def)) {
|
|
@@ -10261,37 +10312,59 @@ function resolveHostDirectives(matches) {
|
|
|
10261
10312
|
for (let i = hasComponent ? 1 : 0; i < matches.length; i++) {
|
|
10262
10313
|
allDirectiveDefs.push(matches[i]);
|
|
10263
10314
|
}
|
|
10315
|
+
if (hostDirectiveDefs !== null) {
|
|
10316
|
+
hostDirectiveDefs.forEach((def, hostDirectiveDef) => {
|
|
10317
|
+
patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs);
|
|
10318
|
+
});
|
|
10319
|
+
}
|
|
10264
10320
|
return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges];
|
|
10265
10321
|
}
|
|
10266
|
-
function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) {
|
|
10322
|
+
function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs, templateMatches) {
|
|
10267
10323
|
if (currentDef.hostDirectives !== null) {
|
|
10268
10324
|
for (const configOrFn of currentDef.hostDirectives) {
|
|
10269
10325
|
if (typeof configOrFn === 'function') {
|
|
10270
10326
|
const resolved = configOrFn();
|
|
10271
10327
|
for (const config of resolved) {
|
|
10272
|
-
trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs);
|
|
10328
|
+
trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs, templateMatches);
|
|
10273
10329
|
}
|
|
10274
10330
|
} else {
|
|
10275
|
-
trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs);
|
|
10331
|
+
trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs, templateMatches);
|
|
10276
10332
|
}
|
|
10277
10333
|
}
|
|
10278
10334
|
}
|
|
10279
10335
|
}
|
|
10280
|
-
function trackHostDirectiveDef(def,
|
|
10336
|
+
function trackHostDirectiveDef(def, finalMatches, hostDirectiveDefs, templateMatches) {
|
|
10281
10337
|
const hostDirectiveDef = getDirectiveDef(def.directive);
|
|
10282
10338
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
10283
10339
|
validateHostDirective(def, hostDirectiveDef);
|
|
10284
10340
|
}
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10341
|
+
findHostDirectiveDefs(hostDirectiveDef, finalMatches, hostDirectiveDefs, templateMatches);
|
|
10342
|
+
if (hostDirectiveDefs.has(hostDirectiveDef)) {
|
|
10343
|
+
const existing = hostDirectiveDefs.get(hostDirectiveDef);
|
|
10344
|
+
mergeBindingMaps(existing, def.inputs, 'input');
|
|
10345
|
+
mergeBindingMaps(existing, def.outputs, 'output');
|
|
10346
|
+
} else if (!templateMatches.includes(hostDirectiveDef)) {
|
|
10347
|
+
hostDirectiveDefs.set(hostDirectiveDef, def);
|
|
10348
|
+
finalMatches.push(hostDirectiveDef);
|
|
10349
|
+
}
|
|
10350
|
+
}
|
|
10351
|
+
function mergeBindingMaps(existingDef, newMap, kind) {
|
|
10352
|
+
const targetMap = kind === 'input' ? existingDef.inputs : existingDef.outputs;
|
|
10353
|
+
Object.keys(newMap).forEach(publicName => {
|
|
10354
|
+
const alias = newMap[publicName];
|
|
10355
|
+
if (!targetMap.hasOwnProperty(publicName) || targetMap[publicName] === alias) {
|
|
10356
|
+
targetMap[publicName] = alias;
|
|
10357
|
+
} else if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
10358
|
+
const message = `${kind === 'input' ? 'Input' : 'Output'} "${publicName}" from ${existingDef.directive.name} ` + `is exposed under the following conflicting names: "${targetMap[publicName]}" and "${alias}". ` + `An ${kind} can only be exposed under a single name.`;
|
|
10359
|
+
throw new RuntimeError(312, message);
|
|
10360
|
+
}
|
|
10361
|
+
});
|
|
10289
10362
|
}
|
|
10290
10363
|
function createHostDirectiveDef(config) {
|
|
10291
10364
|
return typeof config === 'function' ? {
|
|
10292
10365
|
directive: resolveForwardRef(config),
|
|
10293
|
-
inputs:
|
|
10294
|
-
outputs:
|
|
10366
|
+
inputs: {},
|
|
10367
|
+
outputs: {}
|
|
10295
10368
|
} : {
|
|
10296
10369
|
directive: resolveForwardRef(config.directive),
|
|
10297
10370
|
inputs: bindingArrayToMap(config.inputs),
|
|
@@ -10299,12 +10372,11 @@ function createHostDirectiveDef(config) {
|
|
|
10299
10372
|
};
|
|
10300
10373
|
}
|
|
10301
10374
|
function bindingArrayToMap(bindings) {
|
|
10302
|
-
if (bindings === undefined || bindings.length === 0) {
|
|
10303
|
-
return EMPTY_OBJ;
|
|
10304
|
-
}
|
|
10305
10375
|
const result = {};
|
|
10306
|
-
|
|
10307
|
-
|
|
10376
|
+
if (bindings !== undefined && bindings.length > 0) {
|
|
10377
|
+
for (let i = 0; i < bindings.length; i += 2) {
|
|
10378
|
+
result[bindings[i]] = bindings[i + 1];
|
|
10379
|
+
}
|
|
10308
10380
|
}
|
|
10309
10381
|
return result;
|
|
10310
10382
|
}
|
|
@@ -12122,35 +12194,34 @@ class ApplicationRef {
|
|
|
12122
12194
|
get injector() {
|
|
12123
12195
|
return this._injector;
|
|
12124
12196
|
}
|
|
12125
|
-
bootstrap(
|
|
12126
|
-
return this.bootstrapImpl(
|
|
12197
|
+
bootstrap(component, rootSelectorOrNode) {
|
|
12198
|
+
return this.bootstrapImpl(component, rootSelectorOrNode);
|
|
12127
12199
|
}
|
|
12128
|
-
bootstrapImpl(
|
|
12200
|
+
bootstrapImpl(component, hostElementOrOptions, injector = Injector.NULL) {
|
|
12129
12201
|
const ngZone = this._injector.get(NgZone);
|
|
12130
12202
|
return ngZone.run(() => {
|
|
12131
12203
|
profiler(ProfilerEvent.BootstrapComponentStart);
|
|
12132
12204
|
(typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
|
|
12133
|
-
const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
|
|
12134
12205
|
const initStatus = this._injector.get(ApplicationInitStatus);
|
|
12135
12206
|
if (!initStatus.done) {
|
|
12136
12207
|
let errorMessage = '';
|
|
12137
12208
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
12138
|
-
const standalone =
|
|
12209
|
+
const standalone = isStandalone(component);
|
|
12139
12210
|
errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' + (standalone ? '' : ' Bootstrap components in the `ngDoBootstrap` method of the root module.');
|
|
12140
12211
|
}
|
|
12141
12212
|
throw new RuntimeError(405, errorMessage);
|
|
12142
12213
|
}
|
|
12143
|
-
|
|
12144
|
-
|
|
12145
|
-
componentFactory = componentOrFactory;
|
|
12146
|
-
} else {
|
|
12147
|
-
const resolver = this._injector.get(ComponentFactoryResolver$1);
|
|
12148
|
-
componentFactory = resolver.resolveComponentFactory(componentOrFactory);
|
|
12149
|
-
}
|
|
12214
|
+
const resolver = this._injector.get(ComponentFactoryResolver$1);
|
|
12215
|
+
const componentFactory = resolver.resolveComponentFactory(component);
|
|
12150
12216
|
this.componentTypes.push(componentFactory.componentType);
|
|
12151
12217
|
const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef$1);
|
|
12152
|
-
const
|
|
12153
|
-
|
|
12218
|
+
const {
|
|
12219
|
+
hostElement,
|
|
12220
|
+
directives,
|
|
12221
|
+
bindings
|
|
12222
|
+
} = normalizeBootstrapOptions(hostElementOrOptions);
|
|
12223
|
+
const selectorOrNode = hostElement || componentFactory.selector;
|
|
12224
|
+
const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule, directives, bindings);
|
|
12154
12225
|
const nativeElement = compRef.location.nativeElement;
|
|
12155
12226
|
const testability = compRef.injector.get(TESTABILITY, null);
|
|
12156
12227
|
testability?.registerApplication(nativeElement);
|
|
@@ -12342,6 +12413,14 @@ class ApplicationRef {
|
|
|
12342
12413
|
}]
|
|
12343
12414
|
}], () => [], null);
|
|
12344
12415
|
})();
|
|
12416
|
+
function normalizeBootstrapOptions(hostElementOrOptions) {
|
|
12417
|
+
if (hostElementOrOptions === undefined || typeof hostElementOrOptions === 'string' || hostElementOrOptions instanceof Element) {
|
|
12418
|
+
return {
|
|
12419
|
+
hostElement: hostElementOrOptions
|
|
12420
|
+
};
|
|
12421
|
+
}
|
|
12422
|
+
return hostElementOrOptions;
|
|
12423
|
+
}
|
|
12345
12424
|
function warnIfDestroyed(destroyed) {
|
|
12346
12425
|
if (destroyed) {
|
|
12347
12426
|
console.warn(formatRuntimeError(406, 'This instance of the `ApplicationRef` has already been destroyed.'));
|
|
@@ -12853,9 +12932,11 @@ function triggerResourceLoading(tDetails, lView, tNode) {
|
|
|
12853
12932
|
}
|
|
12854
12933
|
tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => {
|
|
12855
12934
|
let failed = false;
|
|
12935
|
+
let failedReason = null;
|
|
12856
12936
|
const directiveDefs = [];
|
|
12857
12937
|
const pipeDefs = [];
|
|
12858
|
-
for (
|
|
12938
|
+
for (let i = 0; i < results.length; i++) {
|
|
12939
|
+
const result = results[i];
|
|
12859
12940
|
if (result.status === 'fulfilled') {
|
|
12860
12941
|
const dependency = result.value;
|
|
12861
12942
|
const directiveDef = getComponentDef(dependency) || getDirectiveDef(dependency);
|
|
@@ -12869,6 +12950,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
|
|
|
12869
12950
|
}
|
|
12870
12951
|
} else {
|
|
12871
12952
|
failed = true;
|
|
12953
|
+
failedReason = result.reason instanceof Error ? result.reason : new Error(String(result.reason));
|
|
12872
12954
|
break;
|
|
12873
12955
|
}
|
|
12874
12956
|
}
|
|
@@ -12876,7 +12958,19 @@ function triggerResourceLoading(tDetails, lView, tNode) {
|
|
|
12876
12958
|
tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
|
|
12877
12959
|
if (tDetails.errorTmplIndex === null) {
|
|
12878
12960
|
const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';
|
|
12879
|
-
|
|
12961
|
+
let errorMsg = '';
|
|
12962
|
+
if (ngDevMode) {
|
|
12963
|
+
errorMsg = 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.';
|
|
12964
|
+
const depsFn = tDetails.dependencyResolverFn;
|
|
12965
|
+
const errorReason = failedReason?.message;
|
|
12966
|
+
if (depsFn) {
|
|
12967
|
+
errorMsg += `\n\nAngular tried to invoke the following dependency function (compiler-generated):\n` + `\`\`\`\n${depsFn.toString()}\n\`\`\``;
|
|
12968
|
+
}
|
|
12969
|
+
if (errorReason) {
|
|
12970
|
+
errorMsg += depsFn ? `\n\nbut it resulted in the following error:\n\n${errorReason}` : `\n\nThe loading resulted in the following error:\n\n${errorReason}`;
|
|
12971
|
+
}
|
|
12972
|
+
}
|
|
12973
|
+
const error = new RuntimeError(-750, errorMsg);
|
|
12880
12974
|
handleUncaughtError(lView, error);
|
|
12881
12975
|
}
|
|
12882
12976
|
} else {
|