@angular/core 16.0.0-rc.1 → 16.0.0-rc.2
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/esm2022/src/hydration/annotate.mjs +5 -2
- package/esm2022/src/hydration/api.mjs +2 -2
- package/esm2022/src/hydration/node_lookup_utils.mjs +13 -8
- package/esm2022/src/hydration/tokens.mjs +3 -4
- package/esm2022/src/render3/collect_native_nodes.mjs +18 -3
- package/esm2022/src/render3/i18n/i18n_parse.mjs +5 -6
- package/esm2022/src/render3/instructions/shared.mjs +52 -25
- package/esm2022/src/render3/instructions/styling.mjs +22 -2
- package/esm2022/src/render3/instructions/template.mjs +2 -2
- package/esm2022/src/render3/reactive_lview_consumer.mjs +4 -4
- package/esm2022/src/render3/reactivity/effect.mjs +8 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed_compiler.mjs +3 -8
- package/esm2022/testing/src/testing_internal.mjs +1 -2
- package/fesm2022/core.mjs +121 -49
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +118 -54
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +618 -161
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/testing/src/ng_zone_mock.mjs +0 -34
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.0.0-rc.
|
|
2
|
+
* @license Angular v16.0.0-rc.2
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getDebugNode, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, provideZoneChangeDetection, Compiler, COMPILER_OPTIONS,
|
|
7
|
+
import { getDebugNode, RendererFactory2 as RendererFactory2$1, InjectionToken as InjectionToken$1, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef as resolveForwardRef$1, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID as LOCALE_ID$1, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, provideZoneChangeDetection, Compiler, COMPILER_OPTIONS, Injector as Injector$1, ɵisEnvironmentProviders, ɵNgModuleFactory, ModuleWithComponentFactories, ɵconvertToBitFlags, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, EnvironmentInjector as EnvironmentInjector$1, NgZone, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
import { ResourceLoader } from '@angular/compiler';
|
|
9
9
|
import { Subject, Subscription } from 'rxjs';
|
|
10
10
|
|
|
@@ -10359,7 +10359,7 @@ class Version {
|
|
|
10359
10359
|
/**
|
|
10360
10360
|
* @publicApi
|
|
10361
10361
|
*/
|
|
10362
|
-
const VERSION = new Version('16.0.0-rc.
|
|
10362
|
+
const VERSION = new Version('16.0.0-rc.2');
|
|
10363
10363
|
|
|
10364
10364
|
// This default value is when checking the hierarchy for a token.
|
|
10365
10365
|
//
|
|
@@ -10507,12 +10507,11 @@ function isInSkipHydrationBlock(tNode) {
|
|
|
10507
10507
|
return false;
|
|
10508
10508
|
}
|
|
10509
10509
|
|
|
10510
|
-
const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
10511
10510
|
/**
|
|
10512
10511
|
* Internal token that specifies whether DOM reuse logic
|
|
10513
10512
|
* during hydration is enabled.
|
|
10514
10513
|
*/
|
|
10515
|
-
const IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken(
|
|
10514
|
+
const IS_HYDRATION_DOM_REUSE_ENABLED = new InjectionToken((typeof ngDevMode === 'undefined' || !!ngDevMode) ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');
|
|
10516
10515
|
// By default (in client rendering mode), we remove all the contents
|
|
10517
10516
|
// of the host element and render an application after that.
|
|
10518
10517
|
const PRESERVE_HOST_CONTENT_DEFAULT = false;
|
|
@@ -10520,7 +10519,7 @@ const PRESERVE_HOST_CONTENT_DEFAULT = false;
|
|
|
10520
10519
|
* Internal token that indicates whether host element content should be
|
|
10521
10520
|
* retained during the bootstrap.
|
|
10522
10521
|
*/
|
|
10523
|
-
const PRESERVE_HOST_CONTENT = new InjectionToken(
|
|
10522
|
+
const PRESERVE_HOST_CONTENT = new InjectionToken((typeof ngDevMode === 'undefined' || !!ngDevMode) ? 'PRESERVE_HOST_CONTENT' : '', {
|
|
10524
10523
|
providedIn: 'root',
|
|
10525
10524
|
factory: () => PRESERVE_HOST_CONTENT_DEFAULT,
|
|
10526
10525
|
});
|
|
@@ -10630,7 +10629,6 @@ function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValu
|
|
|
10630
10629
|
return { propName: undefined, oldValue, newValue };
|
|
10631
10630
|
}
|
|
10632
10631
|
|
|
10633
|
-
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
|
|
10634
10632
|
class ReactiveLViewConsumer extends ReactiveNode {
|
|
10635
10633
|
constructor() {
|
|
10636
10634
|
super(...arguments);
|
|
@@ -10638,11 +10636,12 @@ class ReactiveLViewConsumer extends ReactiveNode {
|
|
|
10638
10636
|
this._lView = null;
|
|
10639
10637
|
}
|
|
10640
10638
|
set lView(lView) {
|
|
10641
|
-
|
|
10639
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
10640
|
+
assertEqual(this._lView, null, 'Consumer already associated with a view.');
|
|
10642
10641
|
this._lView = lView;
|
|
10643
10642
|
}
|
|
10644
10643
|
onConsumerDependencyMayHaveChanged() {
|
|
10645
|
-
|
|
10644
|
+
(typeof ngDevMode === 'undefined' || ngDevMode) &&
|
|
10646
10645
|
assertDefined(this._lView, 'Updating a signal during template or host binding execution is not allowed.');
|
|
10647
10646
|
markViewDirty(this._lView);
|
|
10648
10647
|
}
|
|
@@ -11060,8 +11059,9 @@ function processHostBindingOpCodes(tView, lView) {
|
|
|
11060
11059
|
}
|
|
11061
11060
|
}
|
|
11062
11061
|
finally {
|
|
11063
|
-
lView[REACTIVE_HOST_BINDING_CONSUMER] === null
|
|
11062
|
+
if (lView[REACTIVE_HOST_BINDING_CONSUMER] === null) {
|
|
11064
11063
|
commitLViewConsumerIfHasProducers(lView, REACTIVE_HOST_BINDING_CONSUMER);
|
|
11064
|
+
}
|
|
11065
11065
|
setSelectedIndex(-1);
|
|
11066
11066
|
}
|
|
11067
11067
|
}
|
|
@@ -11116,7 +11116,6 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, enviro
|
|
|
11116
11116
|
lView[ID] = getUniqueLViewId();
|
|
11117
11117
|
lView[HYDRATION] = hydrationInfo;
|
|
11118
11118
|
lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;
|
|
11119
|
-
lView[REACTIVE_TEMPLATE_CONSUMER] = null;
|
|
11120
11119
|
ngDevMode &&
|
|
11121
11120
|
assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
11122
11121
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
@@ -11414,10 +11413,21 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
|
|
|
11414
11413
|
}
|
|
11415
11414
|
const preHookType = isUpdatePhase ? 2 /* ProfilerEvent.TemplateUpdateStart */ : 0 /* ProfilerEvent.TemplateCreateStart */;
|
|
11416
11415
|
profiler(preHookType, context);
|
|
11417
|
-
|
|
11416
|
+
if (isUpdatePhase) {
|
|
11417
|
+
consumer.runInContext(templateFn, rf, context);
|
|
11418
|
+
}
|
|
11419
|
+
else {
|
|
11420
|
+
const prevConsumer = setActiveConsumer(null);
|
|
11421
|
+
try {
|
|
11422
|
+
templateFn(rf, context);
|
|
11423
|
+
}
|
|
11424
|
+
finally {
|
|
11425
|
+
setActiveConsumer(prevConsumer);
|
|
11426
|
+
}
|
|
11427
|
+
}
|
|
11418
11428
|
}
|
|
11419
11429
|
finally {
|
|
11420
|
-
if (lView[REACTIVE_TEMPLATE_CONSUMER] === null) {
|
|
11430
|
+
if (isUpdatePhase && lView[REACTIVE_TEMPLATE_CONSUMER] === null) {
|
|
11421
11431
|
commitLViewConsumerIfHasProducers(lView, REACTIVE_TEMPLATE_CONSUMER);
|
|
11422
11432
|
}
|
|
11423
11433
|
setSelectedIndex(prevSelectedIndex);
|
|
@@ -11430,14 +11440,20 @@ function executeTemplate(tView, lView, templateFn, rf, context) {
|
|
|
11430
11440
|
//////////////////////////
|
|
11431
11441
|
function executeContentQueries(tView, tNode, lView) {
|
|
11432
11442
|
if (isContentQueryHost(tNode)) {
|
|
11433
|
-
const
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
const
|
|
11437
|
-
|
|
11438
|
-
def
|
|
11443
|
+
const prevConsumer = setActiveConsumer(null);
|
|
11444
|
+
try {
|
|
11445
|
+
const start = tNode.directiveStart;
|
|
11446
|
+
const end = tNode.directiveEnd;
|
|
11447
|
+
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
|
|
11448
|
+
const def = tView.data[directiveIndex];
|
|
11449
|
+
if (def.contentQueries) {
|
|
11450
|
+
def.contentQueries(1 /* RenderFlags.Create */, lView[directiveIndex], directiveIndex);
|
|
11451
|
+
}
|
|
11439
11452
|
}
|
|
11440
11453
|
}
|
|
11454
|
+
finally {
|
|
11455
|
+
setActiveConsumer(prevConsumer);
|
|
11456
|
+
}
|
|
11441
11457
|
}
|
|
11442
11458
|
}
|
|
11443
11459
|
/**
|
|
@@ -12256,17 +12272,11 @@ function setElementAttribute(renderer, element, namespace, tagName, name, value,
|
|
|
12256
12272
|
function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {
|
|
12257
12273
|
const initialInputs = initialInputData[directiveIndex];
|
|
12258
12274
|
if (initialInputs !== null) {
|
|
12259
|
-
const setInput = def.setInput;
|
|
12260
12275
|
for (let i = 0; i < initialInputs.length;) {
|
|
12261
12276
|
const publicName = initialInputs[i++];
|
|
12262
12277
|
const privateName = initialInputs[i++];
|
|
12263
12278
|
const value = initialInputs[i++];
|
|
12264
|
-
|
|
12265
|
-
def.setInput(instance, value, publicName, privateName);
|
|
12266
|
-
}
|
|
12267
|
-
else {
|
|
12268
|
-
instance[privateName] = value;
|
|
12269
|
-
}
|
|
12279
|
+
writeToDirectiveInput(def, instance, publicName, privateName, value);
|
|
12270
12280
|
if (ngDevMode) {
|
|
12271
12281
|
const nativeElement = getNativeByTNode(tNode, lView);
|
|
12272
12282
|
setNgReflectProperty(lView, nativeElement, tNode.type, privateName, value);
|
|
@@ -12274,6 +12284,20 @@ function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initial
|
|
|
12274
12284
|
}
|
|
12275
12285
|
}
|
|
12276
12286
|
}
|
|
12287
|
+
function writeToDirectiveInput(def, instance, publicName, privateName, value) {
|
|
12288
|
+
const prevConsumer = setActiveConsumer(null);
|
|
12289
|
+
try {
|
|
12290
|
+
if (def.setInput !== null) {
|
|
12291
|
+
def.setInput(instance, value, publicName, privateName);
|
|
12292
|
+
}
|
|
12293
|
+
else {
|
|
12294
|
+
instance[privateName] = value;
|
|
12295
|
+
}
|
|
12296
|
+
}
|
|
12297
|
+
finally {
|
|
12298
|
+
setActiveConsumer(prevConsumer);
|
|
12299
|
+
}
|
|
12300
|
+
}
|
|
12277
12301
|
/**
|
|
12278
12302
|
* Generates initialInputData for a node and stores it in the template's static storage
|
|
12279
12303
|
* so subsequent template invocations don't have to recalculate it.
|
|
@@ -12568,7 +12592,13 @@ function checkNoChangesInternal(tView, lView, context, notifyErrorHandler = true
|
|
|
12568
12592
|
function executeViewQueryFn(flags, viewQueryFn, component) {
|
|
12569
12593
|
ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');
|
|
12570
12594
|
setCurrentQueryIndex(0);
|
|
12571
|
-
|
|
12595
|
+
const prevConsumer = setActiveConsumer(null);
|
|
12596
|
+
try {
|
|
12597
|
+
viewQueryFn(flags, component);
|
|
12598
|
+
}
|
|
12599
|
+
finally {
|
|
12600
|
+
setActiveConsumer(prevConsumer);
|
|
12601
|
+
}
|
|
12572
12602
|
}
|
|
12573
12603
|
///////////////////////////////
|
|
12574
12604
|
//// Bindings & interpolations
|
|
@@ -12656,12 +12686,7 @@ function setInputsForProperty(tView, lView, inputs, publicName, value) {
|
|
|
12656
12686
|
const instance = lView[index];
|
|
12657
12687
|
ngDevMode && assertIndexInRange(lView, index);
|
|
12658
12688
|
const def = tView.data[index];
|
|
12659
|
-
|
|
12660
|
-
def.setInput(instance, value, publicName, privateName);
|
|
12661
|
-
}
|
|
12662
|
-
else {
|
|
12663
|
-
instance[privateName] = value;
|
|
12664
|
-
}
|
|
12689
|
+
writeToDirectiveInput(def, instance, publicName, privateName, value);
|
|
12665
12690
|
}
|
|
12666
12691
|
}
|
|
12667
12692
|
/**
|
|
@@ -12719,7 +12744,7 @@ class EffectManager {
|
|
|
12719
12744
|
this.queue = new Map();
|
|
12720
12745
|
}
|
|
12721
12746
|
create(effectFn, destroyRef, allowSignalWrites) {
|
|
12722
|
-
const zone = Zone.current;
|
|
12747
|
+
const zone = (typeof Zone === 'undefined') ? null : Zone.current;
|
|
12723
12748
|
const watch = new Watch(effectFn, (watch) => {
|
|
12724
12749
|
if (!this.all.has(watch)) {
|
|
12725
12750
|
return;
|
|
@@ -12747,7 +12772,12 @@ class EffectManager {
|
|
|
12747
12772
|
}
|
|
12748
12773
|
for (const [watch, zone] of this.queue) {
|
|
12749
12774
|
this.queue.delete(watch);
|
|
12750
|
-
zone
|
|
12775
|
+
if (zone) {
|
|
12776
|
+
zone.run(() => watch.run());
|
|
12777
|
+
}
|
|
12778
|
+
else {
|
|
12779
|
+
watch.run();
|
|
12780
|
+
}
|
|
12751
12781
|
}
|
|
12752
12782
|
}
|
|
12753
12783
|
get isQueueEmpty() {
|
|
@@ -12829,6 +12859,21 @@ function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
|
|
|
12829
12859
|
collectNativeNodes(lViewInAContainer[TVIEW], lViewInAContainer, lViewFirstChildTNode, result);
|
|
12830
12860
|
}
|
|
12831
12861
|
}
|
|
12862
|
+
// When an LContainer is created, the anchor (comment) node is:
|
|
12863
|
+
// - (1) either reused in case of an ElementContainer (<ng-container>)
|
|
12864
|
+
// - (2) or a new comment node is created
|
|
12865
|
+
// In the first case, the anchor comment node would be added to the final
|
|
12866
|
+
// list by the code above (`result.push(unwrapRNode(lNode))`), but the second
|
|
12867
|
+
// case requires extra handling: the anchor node needs to be added to the
|
|
12868
|
+
// final list manually. See additional information in the `createAnchorNode`
|
|
12869
|
+
// function in the `view_container_ref.ts`.
|
|
12870
|
+
//
|
|
12871
|
+
// In the first case, the same reference would be stored in the `NATIVE`
|
|
12872
|
+
// and `HOST` slots in an LContainer. Otherwise, this is the second case and
|
|
12873
|
+
// we should add an element to the final list.
|
|
12874
|
+
if (lNode[NATIVE] !== lNode[HOST]) {
|
|
12875
|
+
result.push(lNode[NATIVE]);
|
|
12876
|
+
}
|
|
12832
12877
|
}
|
|
12833
12878
|
const tNodeType = tNode.type;
|
|
12834
12879
|
if (tNodeType & 8 /* TNodeType.ElementContainer */) {
|
|
@@ -15096,10 +15141,10 @@ function locateRNodeByPath(path, lView) {
|
|
|
15096
15141
|
const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);
|
|
15097
15142
|
let ref;
|
|
15098
15143
|
if (referenceNode === REFERENCE_NODE_HOST) {
|
|
15099
|
-
ref = lView[
|
|
15144
|
+
ref = lView[DECLARATION_COMPONENT_VIEW][HOST];
|
|
15100
15145
|
}
|
|
15101
15146
|
else if (referenceNode === REFERENCE_NODE_BODY) {
|
|
15102
|
-
ref = ɵɵresolveBody(lView[
|
|
15147
|
+
ref = ɵɵresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);
|
|
15103
15148
|
}
|
|
15104
15149
|
else {
|
|
15105
15150
|
const parentElementId = Number(referenceNode);
|
|
@@ -15143,6 +15188,7 @@ function navigateBetween(start, finish) {
|
|
|
15143
15188
|
}
|
|
15144
15189
|
/**
|
|
15145
15190
|
* Calculates a path between 2 sibling nodes (generates a number of `NextSibling` navigations).
|
|
15191
|
+
* Returns `null` if no such path exists between the given nodes.
|
|
15146
15192
|
*/
|
|
15147
15193
|
function navigateBetweenSiblings(start, finish) {
|
|
15148
15194
|
const nav = [];
|
|
@@ -15150,7 +15196,10 @@ function navigateBetweenSiblings(start, finish) {
|
|
|
15150
15196
|
for (node = start; node != null && node !== finish; node = node.nextSibling) {
|
|
15151
15197
|
nav.push(NodeNavigationStep.NextSibling);
|
|
15152
15198
|
}
|
|
15153
|
-
|
|
15199
|
+
// If the `node` becomes `null` or `undefined` at the end, that means that we
|
|
15200
|
+
// didn't find the `end` node, thus return `null` (which would trigger serialization
|
|
15201
|
+
// error to be produced).
|
|
15202
|
+
return node == null ? null : nav;
|
|
15154
15203
|
}
|
|
15155
15204
|
/**
|
|
15156
15205
|
* Calculates a path between 2 nodes in terms of `nextSibling` and `firstChild`
|
|
@@ -15173,10 +15222,11 @@ function calcPathForNode(tNode, lView) {
|
|
|
15173
15222
|
let parentIndex;
|
|
15174
15223
|
let parentRNode;
|
|
15175
15224
|
let referenceNodeName;
|
|
15176
|
-
if (parentTNode === null) {
|
|
15177
|
-
//
|
|
15225
|
+
if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {
|
|
15226
|
+
// If there is no parent TNode or a parent TNode does not represent an RNode
|
|
15227
|
+
// (i.e. not a DOM node), use component host element as a reference node.
|
|
15178
15228
|
parentIndex = referenceNodeName = REFERENCE_NODE_HOST;
|
|
15179
|
-
parentRNode = lView[HOST];
|
|
15229
|
+
parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];
|
|
15180
15230
|
}
|
|
15181
15231
|
else {
|
|
15182
15232
|
// Use parent TNode as a reference node.
|
|
@@ -15228,7 +15278,7 @@ function templateFirstCreatePass(index, tView, lView, templateFn, decls, vars, t
|
|
|
15228
15278
|
const hydrationInfo = lView[HYDRATION];
|
|
15229
15279
|
if (hydrationInfo) {
|
|
15230
15280
|
const noOffsetIndex = index - HEADER_OFFSET;
|
|
15231
|
-
ssrId =
|
|
15281
|
+
ssrId = hydrationInfo.data[TEMPLATES]?.[noOffsetIndex] ?? null;
|
|
15232
15282
|
}
|
|
15233
15283
|
// TODO(pk): refactor getOrCreateTNode to have the "create" only version
|
|
15234
15284
|
const tNode = getOrCreateTNode(tView, index, 4 /* TNodeType.Container */, tagName || null, getConstant(tViewConsts, attrsIndex));
|
|
@@ -17345,7 +17395,7 @@ function styleStringParser(keyValueArray, text) {
|
|
|
17345
17395
|
* @codeGenApi
|
|
17346
17396
|
*/
|
|
17347
17397
|
function ɵɵclassMap(classes) {
|
|
17348
|
-
checkStylingMap(
|
|
17398
|
+
checkStylingMap(classKeyValueArraySet, classStringParser, classes, true);
|
|
17349
17399
|
}
|
|
17350
17400
|
/**
|
|
17351
17401
|
* Parse text as class and add values to KeyValueArray.
|
|
@@ -17787,6 +17837,26 @@ function toStylingKeyValueArray(keyValueArraySet, stringParser, value) {
|
|
|
17787
17837
|
function styleKeyValueArraySet(keyValueArray, key, value) {
|
|
17788
17838
|
keyValueArraySet(keyValueArray, key, unwrapSafeValue(value));
|
|
17789
17839
|
}
|
|
17840
|
+
/**
|
|
17841
|
+
* Class-binding-specific function for setting the `value` for a `key`.
|
|
17842
|
+
*
|
|
17843
|
+
* See: `keyValueArraySet` for details
|
|
17844
|
+
*
|
|
17845
|
+
* @param keyValueArray KeyValueArray to add to.
|
|
17846
|
+
* @param key Style key to add.
|
|
17847
|
+
* @param value The value to set.
|
|
17848
|
+
*/
|
|
17849
|
+
function classKeyValueArraySet(keyValueArray, key, value) {
|
|
17850
|
+
// We use `classList.add` to eventually add the CSS classes to the DOM node. Any value passed into
|
|
17851
|
+
// `add` is stringified and added to the `class` attribute, e.g. even null, undefined or numbers
|
|
17852
|
+
// will be added. Stringify the key here so that our internal data structure matches the value in
|
|
17853
|
+
// the DOM. The only exceptions are empty strings and strings that contain spaces for which
|
|
17854
|
+
// the browser throws an error. We ignore such values, because the error is somewhat cryptic.
|
|
17855
|
+
const stringKey = String(key);
|
|
17856
|
+
if (stringKey !== '' && !stringKey.includes(' ')) {
|
|
17857
|
+
keyValueArraySet(keyValueArray, stringKey, value);
|
|
17858
|
+
}
|
|
17859
|
+
}
|
|
17790
17860
|
/**
|
|
17791
17861
|
* Update map based styling.
|
|
17792
17862
|
*
|
|
@@ -20516,11 +20586,10 @@ const MARKER = `�`;
|
|
|
20516
20586
|
const SUBTEMPLATE_REGEXP = /�\/?\*(\d+:\d+)�/gi;
|
|
20517
20587
|
const PH_REGEXP = /�(\/?[#*]\d+):?\d*�/gi;
|
|
20518
20588
|
/**
|
|
20519
|
-
* Angular
|
|
20520
|
-
*
|
|
20521
|
-
*
|
|
20522
|
-
*
|
|
20523
|
-
* might contain this special character.
|
|
20589
|
+
* Angular uses the special entity &ngsp; as a placeholder for non-removable space.
|
|
20590
|
+
* It's replaced by the 0xE500 PUA (Private Use Areas) unicode character and later on replaced by a
|
|
20591
|
+
* space.
|
|
20592
|
+
* We are re-implementing the same idea since translations might contain this special character.
|
|
20524
20593
|
*/
|
|
20525
20594
|
const NGSP_UNICODE_REGEXP = /\uE500/g;
|
|
20526
20595
|
function replaceNgsp(value) {
|
|
@@ -25663,12 +25732,7 @@ class TestBedCompiler {
|
|
|
25663
25732
|
if (this.compilerProviders !== null) {
|
|
25664
25733
|
providers.push(...this.compilerProviders);
|
|
25665
25734
|
}
|
|
25666
|
-
|
|
25667
|
-
class CompilerModule {
|
|
25668
|
-
}
|
|
25669
|
-
ɵcompileNgModuleDefs(CompilerModule, { providers });
|
|
25670
|
-
const CompilerModuleFactory = new ɵNgModuleFactory(CompilerModule);
|
|
25671
|
-
this._injector = CompilerModuleFactory.create(this.platform.injector).injector;
|
|
25735
|
+
this._injector = Injector$1.create({ providers, parent: this.platform.injector });
|
|
25672
25736
|
return this._injector;
|
|
25673
25737
|
}
|
|
25674
25738
|
// get overrides for a specific provider (if any)
|