@angular/core 15.0.1 → 15.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/di/create_injector.mjs +1 -1
- package/esm2020/src/render/api.mjs +1 -3
- package/esm2020/src/render3/assert.mjs +1 -10
- package/esm2020/src/render3/component_ref.mjs +1 -12
- package/esm2020/src/render3/index.mjs +2 -2
- package/esm2020/src/render3/instructions/shared.mjs +95 -169
- package/esm2020/src/render3/interfaces/view.mjs +1 -10
- package/esm2020/src/render3/namespaces.mjs +1 -8
- package/esm2020/src/render3/node_manipulation.mjs +3 -7
- package/esm2020/src/render3/node_selector_matcher.mjs +1 -4
- package/esm2020/src/render3/query.mjs +1 -6
- package/esm2020/src/render3/state.mjs +1 -4
- package/esm2020/src/render3/util/discovery_utils.mjs +3 -32
- package/esm2020/src/render3/util/view_utils.mjs +1 -15
- package/esm2020/src/util/array_utils.mjs +3 -71
- 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/fesm2015/core.mjs +270 -1248
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +273 -1251
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +270 -1248
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +273 -1251
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +1 -222
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/esm2020/src/render3/instructions/lview_debug.mjs +0 -684
- package/esm2020/src/util/named_array_type.mjs +0 -40
package/fesm2015/testing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.
|
|
2
|
+
* @license Angular v15.0.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { getDebugNode
|
|
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, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ɵisEnvironmentProviders, ModuleWithComponentFactories, ɵconvertToBitFlags, Injector as Injector$1, InjectFlags as InjectFlags$1, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode as ɵsetUnknownElementStrictMode$1, ɵsetUnknownPropertyStrictMode as ɵsetUnknownPropertyStrictMode$1, ɵgetUnknownElementStrictMode as ɵgetUnknownElementStrictMode$1, ɵgetUnknownPropertyStrictMode as ɵgetUnknownPropertyStrictMode$1, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
|
|
8
8
|
import { __awaiter } from 'tslib';
|
|
9
9
|
import { ResourceLoader } from '@angular/compiler';
|
|
10
10
|
import { Subject, Subscription } from 'rxjs';
|
|
@@ -86,7 +86,7 @@ class ComponentFixture {
|
|
|
86
86
|
this._onErrorSubscription = null;
|
|
87
87
|
this.changeDetectorRef = componentRef.changeDetectorRef;
|
|
88
88
|
this.elementRef = componentRef.location;
|
|
89
|
-
this.debugElement = getDebugNode
|
|
89
|
+
this.debugElement = getDebugNode(this.elementRef.nativeElement);
|
|
90
90
|
this.componentInstance = componentRef.instance;
|
|
91
91
|
this.nativeElement = this.elementRef.nativeElement;
|
|
92
92
|
this.componentRef = componentRef;
|
|
@@ -1095,17 +1095,6 @@ function assertOneOf(value, ...validValues) {
|
|
|
1095
1095
|
* Use of this source code is governed by an MIT-style license that can be
|
|
1096
1096
|
* found in the LICENSE file at https://angular.io/license
|
|
1097
1097
|
*/
|
|
1098
|
-
/**
|
|
1099
|
-
* Equivalent to ES6 spread, add each item to an array.
|
|
1100
|
-
*
|
|
1101
|
-
* @param items The items to add
|
|
1102
|
-
* @param arr The array to which you want to add the items
|
|
1103
|
-
*/
|
|
1104
|
-
function addAllToArray(items, arr) {
|
|
1105
|
-
for (let i = 0; i < items.length; i++) {
|
|
1106
|
-
arr.push(items[i]);
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
1098
|
/**
|
|
1110
1099
|
* Determines if the contents of two arrays is identical
|
|
1111
1100
|
*
|
|
@@ -1133,25 +1122,8 @@ function arrayEquals(a, b, identityAccessor) {
|
|
|
1133
1122
|
/**
|
|
1134
1123
|
* Flattens an array.
|
|
1135
1124
|
*/
|
|
1136
|
-
function flatten$1(list
|
|
1137
|
-
|
|
1138
|
-
dst = list;
|
|
1139
|
-
for (let i = 0; i < list.length; i++) {
|
|
1140
|
-
let item = list[i];
|
|
1141
|
-
if (Array.isArray(item)) {
|
|
1142
|
-
// we need to inline it.
|
|
1143
|
-
if (dst === list) {
|
|
1144
|
-
// Our assumption that the list was already flat was wrong and
|
|
1145
|
-
// we need to clone flat since we need to write to it.
|
|
1146
|
-
dst = list.slice(0, i);
|
|
1147
|
-
}
|
|
1148
|
-
flatten$1(item, dst);
|
|
1149
|
-
}
|
|
1150
|
-
else if (dst !== list) {
|
|
1151
|
-
dst.push(item);
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
return dst;
|
|
1125
|
+
function flatten$1(list) {
|
|
1126
|
+
return list.flat(Number.POSITIVE_INFINITY);
|
|
1155
1127
|
}
|
|
1156
1128
|
function deepForEach(input, fn) {
|
|
1157
1129
|
input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));
|
|
@@ -1261,46 +1233,6 @@ function arrayInsert2(array, index, value1, value2) {
|
|
|
1261
1233
|
array[index + 1] = value2;
|
|
1262
1234
|
}
|
|
1263
1235
|
}
|
|
1264
|
-
/**
|
|
1265
|
-
* Insert a `value` into an `array` so that the array remains sorted.
|
|
1266
|
-
*
|
|
1267
|
-
* NOTE:
|
|
1268
|
-
* - Duplicates are not allowed, and are ignored.
|
|
1269
|
-
* - This uses binary search algorithm for fast inserts.
|
|
1270
|
-
*
|
|
1271
|
-
* @param array A sorted array to insert into.
|
|
1272
|
-
* @param value The value to insert.
|
|
1273
|
-
* @returns index of the inserted value.
|
|
1274
|
-
*/
|
|
1275
|
-
function arrayInsertSorted(array, value) {
|
|
1276
|
-
let index = arrayIndexOfSorted(array, value);
|
|
1277
|
-
if (index < 0) {
|
|
1278
|
-
// if we did not find it insert it.
|
|
1279
|
-
index = ~index;
|
|
1280
|
-
arrayInsert(array, index, value);
|
|
1281
|
-
}
|
|
1282
|
-
return index;
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* Remove `value` from a sorted `array`.
|
|
1286
|
-
*
|
|
1287
|
-
* NOTE:
|
|
1288
|
-
* - This uses binary search algorithm for fast removals.
|
|
1289
|
-
*
|
|
1290
|
-
* @param array A sorted array to remove from.
|
|
1291
|
-
* @param value The value to remove.
|
|
1292
|
-
* @returns index of the removed value.
|
|
1293
|
-
* - positive index if value found and removed.
|
|
1294
|
-
* - negative index if value not found. (`~index` to get the value where it should have been
|
|
1295
|
-
* inserted)
|
|
1296
|
-
*/
|
|
1297
|
-
function arrayRemoveSorted(array, value) {
|
|
1298
|
-
const index = arrayIndexOfSorted(array, value);
|
|
1299
|
-
if (index >= 0) {
|
|
1300
|
-
arraySplice(array, index, 1);
|
|
1301
|
-
}
|
|
1302
|
-
return index;
|
|
1303
|
-
}
|
|
1304
1236
|
/**
|
|
1305
1237
|
* Get an index of an `value` in a sorted `array`.
|
|
1306
1238
|
*
|
|
@@ -2851,7 +2783,7 @@ const MOVED_VIEWS = 9;
|
|
|
2851
2783
|
const CONTAINER_HEADER_OFFSET = 10;
|
|
2852
2784
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2853
2785
|
// failure based on types.
|
|
2854
|
-
const unusedValueExportToPlacateAjd$
|
|
2786
|
+
const unusedValueExportToPlacateAjd$4 = 1;
|
|
2855
2787
|
|
|
2856
2788
|
/**
|
|
2857
2789
|
* @license
|
|
@@ -2894,18 +2826,9 @@ const EMBEDDED_VIEW_INJECTOR = 21;
|
|
|
2894
2826
|
* there should be no need to refer to `HEADER_OFFSET` anywhere else.
|
|
2895
2827
|
*/
|
|
2896
2828
|
const HEADER_OFFSET = 22;
|
|
2897
|
-
/**
|
|
2898
|
-
* Converts `TViewType` into human readable text.
|
|
2899
|
-
* Make sure this matches with `TViewType`
|
|
2900
|
-
*/
|
|
2901
|
-
const TViewTypeAsString = [
|
|
2902
|
-
'Root',
|
|
2903
|
-
'Component',
|
|
2904
|
-
'Embedded', // 2
|
|
2905
|
-
];
|
|
2906
2829
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
2907
2830
|
// failure based on types.
|
|
2908
|
-
const unusedValueExportToPlacateAjd$
|
|
2831
|
+
const unusedValueExportToPlacateAjd$3 = 1;
|
|
2909
2832
|
|
|
2910
2833
|
/**
|
|
2911
2834
|
* @license
|
|
@@ -2990,11 +2913,6 @@ function assertHasParent(tNode) {
|
|
|
2990
2913
|
assertDefined(tNode, 'currentTNode should exist!');
|
|
2991
2914
|
assertDefined(tNode.parent, 'currentTNode should have a parent');
|
|
2992
2915
|
}
|
|
2993
|
-
function assertDataNext(lView, index, arr) {
|
|
2994
|
-
if (arr == null)
|
|
2995
|
-
arr = lView;
|
|
2996
|
-
assertEqual(arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);
|
|
2997
|
-
}
|
|
2998
2916
|
function assertLContainer(value) {
|
|
2999
2917
|
assertDefined(value, 'LContainer must be defined');
|
|
3000
2918
|
assertEqual(isLContainer(value), true, 'Expecting LContainer');
|
|
@@ -3025,10 +2943,6 @@ function assertIndexInDeclRange(lView, index) {
|
|
|
3025
2943
|
const tView = lView[1];
|
|
3026
2944
|
assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);
|
|
3027
2945
|
}
|
|
3028
|
-
function assertIndexInVarsRange(lView, index) {
|
|
3029
|
-
const tView = lView[1];
|
|
3030
|
-
assertBetween(tView.bindingStartIndex, tView.expandoStartIndex, index);
|
|
3031
|
-
}
|
|
3032
2946
|
function assertIndexInExpandoRange(lView, index) {
|
|
3033
2947
|
const tView = lView[1];
|
|
3034
2948
|
assertBetween(tView.expandoStartIndex, lView.length, index);
|
|
@@ -3247,14 +3161,7 @@ const profiler = function (event, instance, hookOrListener) {
|
|
|
3247
3161
|
* found in the LICENSE file at https://angular.io/license
|
|
3248
3162
|
*/
|
|
3249
3163
|
const SVG_NAMESPACE = 'svg';
|
|
3250
|
-
const SVG_NAMESPACE_URI = 'http://www.w3.org/2000/svg';
|
|
3251
3164
|
const MATH_ML_NAMESPACE = 'math';
|
|
3252
|
-
const MATH_ML_NAMESPACE_URI = 'http://www.w3.org/1998/MathML/';
|
|
3253
|
-
function getNamespaceUri(namespace) {
|
|
3254
|
-
const name = namespace.toLowerCase();
|
|
3255
|
-
return name === SVG_NAMESPACE ? SVG_NAMESPACE_URI :
|
|
3256
|
-
(name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
|
|
3257
|
-
}
|
|
3258
3165
|
|
|
3259
3166
|
/**
|
|
3260
3167
|
* @license
|
|
@@ -3303,20 +3210,6 @@ function unwrapLView(value) {
|
|
|
3303
3210
|
}
|
|
3304
3211
|
return null;
|
|
3305
3212
|
}
|
|
3306
|
-
/**
|
|
3307
|
-
* Returns `LContainer` or `null` if not found.
|
|
3308
|
-
* @param value wrapped value of `RNode`, `LView`, `LContainer`
|
|
3309
|
-
*/
|
|
3310
|
-
function unwrapLContainer(value) {
|
|
3311
|
-
while (Array.isArray(value)) {
|
|
3312
|
-
// This check is same as `isLContainer()` but we don't call at as we don't want to call
|
|
3313
|
-
// `Array.isArray()` twice and give JITer more work for inlining.
|
|
3314
|
-
if (value[TYPE] === true)
|
|
3315
|
-
return value;
|
|
3316
|
-
value = value[HOST];
|
|
3317
|
-
}
|
|
3318
|
-
return null;
|
|
3319
|
-
}
|
|
3320
3213
|
/**
|
|
3321
3214
|
* Retrieves an element value from the provided `viewData`, by unwrapping
|
|
3322
3215
|
* from any containers, component views, or style contexts.
|
|
@@ -3576,9 +3469,6 @@ function isCurrentTNodeParent() {
|
|
|
3576
3469
|
function setCurrentTNodeAsNotParent() {
|
|
3577
3470
|
instructionState.lFrame.isParent = false;
|
|
3578
3471
|
}
|
|
3579
|
-
function setCurrentTNodeAsParent() {
|
|
3580
|
-
instructionState.lFrame.isParent = true;
|
|
3581
|
-
}
|
|
3582
3472
|
function getContextLView() {
|
|
3583
3473
|
const contextLView = instructionState.lFrame.contextLView;
|
|
3584
3474
|
ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');
|
|
@@ -4301,7 +4191,7 @@ function isFactory(obj) {
|
|
|
4301
4191
|
}
|
|
4302
4192
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
4303
4193
|
// failure based on types.
|
|
4304
|
-
const unusedValueExportToPlacateAjd$
|
|
4194
|
+
const unusedValueExportToPlacateAjd$2 = 1;
|
|
4305
4195
|
|
|
4306
4196
|
/**
|
|
4307
4197
|
* Converts `TNodeType` into human readable text.
|
|
@@ -4320,7 +4210,7 @@ function toTNodeTypeAsString(tNodeType) {
|
|
|
4320
4210
|
}
|
|
4321
4211
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
4322
4212
|
// failure based on types.
|
|
4323
|
-
const unusedValueExportToPlacateAjd$
|
|
4213
|
+
const unusedValueExportToPlacateAjd$1 = 1;
|
|
4324
4214
|
/**
|
|
4325
4215
|
* Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
|
|
4326
4216
|
*
|
|
@@ -6361,28 +6251,6 @@ function ensureIcuContainerVisitorLoaded(loader) {
|
|
|
6361
6251
|
}
|
|
6362
6252
|
}
|
|
6363
6253
|
|
|
6364
|
-
/**
|
|
6365
|
-
* @license
|
|
6366
|
-
* Copyright Google LLC All Rights Reserved.
|
|
6367
|
-
*
|
|
6368
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6369
|
-
* found in the LICENSE file at https://angular.io/license
|
|
6370
|
-
*/
|
|
6371
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
6372
|
-
// failure based on types.
|
|
6373
|
-
const unusedValueExportToPlacateAjd$4 = 1;
|
|
6374
|
-
|
|
6375
|
-
/**
|
|
6376
|
-
* @license
|
|
6377
|
-
* Copyright Google LLC All Rights Reserved.
|
|
6378
|
-
*
|
|
6379
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6380
|
-
* found in the LICENSE file at https://angular.io/license
|
|
6381
|
-
*/
|
|
6382
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
6383
|
-
// failure based on types.
|
|
6384
|
-
const unusedValueExportToPlacateAjd$3 = 1;
|
|
6385
|
-
|
|
6386
6254
|
/**
|
|
6387
6255
|
* @license
|
|
6388
6256
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -6454,7 +6322,6 @@ function getNearestLContainer(viewOrContainer) {
|
|
|
6454
6322
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6455
6323
|
* found in the LICENSE file at https://angular.io/license
|
|
6456
6324
|
*/
|
|
6457
|
-
const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
|
|
6458
6325
|
/**
|
|
6459
6326
|
* NOTE: for performance reasons, the possible actions are inlined within the function instead of
|
|
6460
6327
|
* being passed as an argument.
|
|
@@ -9442,7 +9309,6 @@ function unwrapElementRef(value) {
|
|
|
9442
9309
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9443
9310
|
* found in the LICENSE file at https://angular.io/license
|
|
9444
9311
|
*/
|
|
9445
|
-
const Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');
|
|
9446
9312
|
/**
|
|
9447
9313
|
* Creates and initializes a custom renderer that implements the `Renderer2` base class.
|
|
9448
9314
|
*
|
|
@@ -9526,7 +9392,7 @@ class Version {
|
|
|
9526
9392
|
/**
|
|
9527
9393
|
* @publicApi
|
|
9528
9394
|
*/
|
|
9529
|
-
const VERSION = new Version('15.0.
|
|
9395
|
+
const VERSION = new Version('15.0.3');
|
|
9530
9396
|
|
|
9531
9397
|
/**
|
|
9532
9398
|
* @license
|
|
@@ -9792,7 +9658,6 @@ function classIndexOf(className, classToSearch, startingIndex) {
|
|
|
9792
9658
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9793
9659
|
* found in the LICENSE file at https://angular.io/license
|
|
9794
9660
|
*/
|
|
9795
|
-
const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
|
|
9796
9661
|
const NG_TEMPLATE_SELECTOR = 'ng-template';
|
|
9797
9662
|
/**
|
|
9798
9663
|
* Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
|
|
@@ -11228,902 +11093,96 @@ class ReflectiveInjector_ {
|
|
|
11228
11093
|
return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
|
|
11229
11094
|
}
|
|
11230
11095
|
/** @internal */
|
|
11231
|
-
_getByKeyDefault(key, notFoundValue, visibility) {
|
|
11232
|
-
let inj;
|
|
11233
|
-
if (visibility instanceof SkipSelf) {
|
|
11234
|
-
inj = this.parent;
|
|
11235
|
-
}
|
|
11236
|
-
else {
|
|
11237
|
-
inj = this;
|
|
11238
|
-
}
|
|
11239
|
-
while (inj instanceof ReflectiveInjector_) {
|
|
11240
|
-
const inj_ = inj;
|
|
11241
|
-
const obj = inj_._getObjByKeyId(key.id);
|
|
11242
|
-
if (obj !== UNDEFINED)
|
|
11243
|
-
return obj;
|
|
11244
|
-
inj = inj_.parent;
|
|
11245
|
-
}
|
|
11246
|
-
if (inj !== null) {
|
|
11247
|
-
return inj.get(key.token, notFoundValue);
|
|
11248
|
-
}
|
|
11249
|
-
else {
|
|
11250
|
-
return this._throwOrNull(key, notFoundValue);
|
|
11251
|
-
}
|
|
11252
|
-
}
|
|
11253
|
-
get displayName() {
|
|
11254
|
-
const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ')
|
|
11255
|
-
.join(', ');
|
|
11256
|
-
return `ReflectiveInjector(providers: [${providers}])`;
|
|
11257
|
-
}
|
|
11258
|
-
toString() {
|
|
11259
|
-
return this.displayName;
|
|
11260
|
-
}
|
|
11261
|
-
}
|
|
11262
|
-
ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
|
|
11263
|
-
function _mapProviders(injector, fn) {
|
|
11264
|
-
const res = [];
|
|
11265
|
-
for (let i = 0; i < injector._providers.length; ++i) {
|
|
11266
|
-
res[i] = fn(injector.getProviderAtIndex(i));
|
|
11267
|
-
}
|
|
11268
|
-
return res;
|
|
11269
|
-
}
|
|
11270
|
-
|
|
11271
|
-
/**
|
|
11272
|
-
* @license
|
|
11273
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11274
|
-
*
|
|
11275
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11276
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11277
|
-
*/
|
|
11278
|
-
|
|
11279
|
-
/**
|
|
11280
|
-
* @license
|
|
11281
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11282
|
-
*
|
|
11283
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11284
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11285
|
-
*/
|
|
11286
|
-
|
|
11287
|
-
/**
|
|
11288
|
-
* @license
|
|
11289
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11290
|
-
*
|
|
11291
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11292
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11293
|
-
*/
|
|
11294
|
-
function ɵɵdirectiveInject(token, flags = InjectFlags.Default) {
|
|
11295
|
-
const lView = getLView();
|
|
11296
|
-
// Fall back to inject() if view hasn't been created. This situation can happen in tests
|
|
11297
|
-
// if inject utilities are used before bootstrapping.
|
|
11298
|
-
if (lView === null) {
|
|
11299
|
-
// Verify that we will not get into infinite loop.
|
|
11300
|
-
ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
|
|
11301
|
-
return ɵɵinject(token, flags);
|
|
11302
|
-
}
|
|
11303
|
-
const tNode = getCurrentTNode();
|
|
11304
|
-
return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
|
|
11305
|
-
}
|
|
11306
|
-
/**
|
|
11307
|
-
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
11308
|
-
* particular class.
|
|
11309
|
-
*
|
|
11310
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
11311
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
11312
|
-
*
|
|
11313
|
-
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
11314
|
-
* and thus in the stack trace.
|
|
11315
|
-
*
|
|
11316
|
-
* @codeGenApi
|
|
11317
|
-
*/
|
|
11318
|
-
function ɵɵinvalidFactory() {
|
|
11319
|
-
const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
|
|
11320
|
-
throw new Error(msg);
|
|
11321
|
-
}
|
|
11322
|
-
|
|
11323
|
-
/**
|
|
11324
|
-
* @license
|
|
11325
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11326
|
-
*
|
|
11327
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11328
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11329
|
-
*/
|
|
11330
|
-
/**
|
|
11331
|
-
* THIS FILE CONTAINS CODE WHICH SHOULD BE TREE SHAKEN AND NEVER CALLED FROM PRODUCTION CODE!!!
|
|
11332
|
-
*/
|
|
11333
|
-
/**
|
|
11334
|
-
* Creates an `Array` construction with a given name. This is useful when
|
|
11335
|
-
* looking for memory consumption to see what time of array it is.
|
|
11336
|
-
*
|
|
11337
|
-
*
|
|
11338
|
-
* @param name Name to give to the constructor
|
|
11339
|
-
* @returns A subclass of `Array` if possible. This can only be done in
|
|
11340
|
-
* environments which support `class` construct.
|
|
11341
|
-
*/
|
|
11342
|
-
function createNamedArrayType(name) {
|
|
11343
|
-
// This should never be called in prod mode, so let's verify that is the case.
|
|
11344
|
-
if (ngDevMode) {
|
|
11345
|
-
try {
|
|
11346
|
-
// If this function were compromised the following could lead to arbitrary
|
|
11347
|
-
// script execution. We bless it with Trusted Types anyway since this
|
|
11348
|
-
// function is stripped out of production binaries.
|
|
11349
|
-
return (newTrustedFunctionForDev('Array', `return class ${name} extends Array{}`))(Array);
|
|
11350
|
-
}
|
|
11351
|
-
catch (e) {
|
|
11352
|
-
// If it does not work just give up and fall back to regular Array.
|
|
11353
|
-
return Array;
|
|
11354
|
-
}
|
|
11355
|
-
}
|
|
11356
|
-
else {
|
|
11357
|
-
throw new Error('Looks like we are in \'prod mode\', but we are creating a named Array type, which is wrong! Check your code');
|
|
11358
|
-
}
|
|
11359
|
-
}
|
|
11360
|
-
|
|
11361
|
-
/**
|
|
11362
|
-
* @license
|
|
11363
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11364
|
-
*
|
|
11365
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11366
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11367
|
-
*/
|
|
11368
|
-
function toTStylingRange(prev, next) {
|
|
11369
|
-
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11370
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11371
|
-
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11372
|
-
}
|
|
11373
|
-
function getTStylingRangePrev(tStylingRange) {
|
|
11374
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11375
|
-
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
11376
|
-
}
|
|
11377
|
-
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
11378
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11379
|
-
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
11380
|
-
2 /* StylingRange.PREV_DUPLICATE */;
|
|
11381
|
-
}
|
|
11382
|
-
function setTStylingRangePrev(tStylingRange, previous) {
|
|
11383
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11384
|
-
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11385
|
-
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
11386
|
-
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
11387
|
-
}
|
|
11388
|
-
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
11389
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11390
|
-
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
11391
|
-
}
|
|
11392
|
-
function getTStylingRangeNext(tStylingRange) {
|
|
11393
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11394
|
-
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
11395
|
-
}
|
|
11396
|
-
function setTStylingRangeNext(tStylingRange, next) {
|
|
11397
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11398
|
-
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
11399
|
-
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
11400
|
-
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
11401
|
-
}
|
|
11402
|
-
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
11403
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11404
|
-
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
11405
|
-
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
11406
|
-
}
|
|
11407
|
-
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
11408
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11409
|
-
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
11410
|
-
}
|
|
11411
|
-
function getTStylingRangeTail(tStylingRange) {
|
|
11412
|
-
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
11413
|
-
const next = getTStylingRangeNext(tStylingRange);
|
|
11414
|
-
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
11415
|
-
}
|
|
11416
|
-
|
|
11417
|
-
/**
|
|
11418
|
-
* @license
|
|
11419
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11420
|
-
*
|
|
11421
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11422
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11423
|
-
*/
|
|
11424
|
-
/**
|
|
11425
|
-
* Patch a `debug` property on top of the existing object.
|
|
11426
|
-
*
|
|
11427
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11428
|
-
*
|
|
11429
|
-
* @param obj Object to patch
|
|
11430
|
-
* @param debug Value to patch
|
|
11431
|
-
*/
|
|
11432
|
-
function attachDebugObject(obj, debug) {
|
|
11433
|
-
if (ngDevMode) {
|
|
11434
|
-
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
11435
|
-
}
|
|
11436
|
-
else {
|
|
11437
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11438
|
-
}
|
|
11439
|
-
}
|
|
11440
|
-
/**
|
|
11441
|
-
* Patch a `debug` property getter on top of the existing object.
|
|
11442
|
-
*
|
|
11443
|
-
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
11444
|
-
*
|
|
11445
|
-
* @param obj Object to patch
|
|
11446
|
-
* @param debugGetter Getter returning a value to patch
|
|
11447
|
-
*/
|
|
11448
|
-
function attachDebugGetter(obj, debugGetter) {
|
|
11449
|
-
if (ngDevMode) {
|
|
11450
|
-
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
11451
|
-
}
|
|
11452
|
-
else {
|
|
11453
|
-
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
11454
|
-
}
|
|
11455
|
-
}
|
|
11456
|
-
|
|
11457
|
-
/**
|
|
11458
|
-
* @license
|
|
11459
|
-
* Copyright Google LLC All Rights Reserved.
|
|
11460
|
-
*
|
|
11461
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
11462
|
-
* found in the LICENSE file at https://angular.io/license
|
|
11463
|
-
*/
|
|
11464
|
-
/*
|
|
11465
|
-
* This file contains conditionally attached classes which provide human readable (debug) level
|
|
11466
|
-
* information for `LView`, `LContainer` and other internal data structures. These data structures
|
|
11467
|
-
* are stored internally as array which makes it very difficult during debugging to reason about the
|
|
11468
|
-
* current state of the system.
|
|
11469
|
-
*
|
|
11470
|
-
* Patching the array with extra property does change the array's hidden class' but it does not
|
|
11471
|
-
* change the cost of access, therefore this patching should not have significant if any impact in
|
|
11472
|
-
* `ngDevMode` mode. (see: https://jsperf.com/array-vs-monkey-patch-array)
|
|
11473
|
-
*
|
|
11474
|
-
* So instead of seeing:
|
|
11475
|
-
* ```
|
|
11476
|
-
* Array(30) [Object, 659, null, …]
|
|
11477
|
-
* ```
|
|
11478
|
-
*
|
|
11479
|
-
* You get to see:
|
|
11480
|
-
* ```
|
|
11481
|
-
* LViewDebug {
|
|
11482
|
-
* views: [...],
|
|
11483
|
-
* flags: {attached: true, ...}
|
|
11484
|
-
* nodes: [
|
|
11485
|
-
* {html: '<div id="123">', ..., nodes: [
|
|
11486
|
-
* {html: '<span>', ..., nodes: null}
|
|
11487
|
-
* ]}
|
|
11488
|
-
* ]
|
|
11489
|
-
* }
|
|
11490
|
-
* ```
|
|
11491
|
-
*/
|
|
11492
|
-
let LVIEW_COMPONENT_CACHE;
|
|
11493
|
-
let LVIEW_EMBEDDED_CACHE;
|
|
11494
|
-
let LVIEW_ROOT;
|
|
11495
|
-
let LVIEW_COMPONENT;
|
|
11496
|
-
let LVIEW_EMBEDDED;
|
|
11497
|
-
/**
|
|
11498
|
-
* This function clones a blueprint and creates LView.
|
|
11499
|
-
*
|
|
11500
|
-
* Simple slice will keep the same type, and we need it to be LView
|
|
11501
|
-
*/
|
|
11502
|
-
function cloneToLViewFromTViewBlueprint(tView) {
|
|
11503
|
-
const debugTView = tView;
|
|
11504
|
-
const lView = getLViewToClone(debugTView.type, tView.template && tView.template.name);
|
|
11505
|
-
return lView.concat(tView.blueprint);
|
|
11506
|
-
}
|
|
11507
|
-
class LRootView extends Array {
|
|
11508
|
-
}
|
|
11509
|
-
class LComponentView extends Array {
|
|
11510
|
-
}
|
|
11511
|
-
class LEmbeddedView extends Array {
|
|
11512
|
-
}
|
|
11513
|
-
function getLViewToClone(type, name) {
|
|
11514
|
-
switch (type) {
|
|
11515
|
-
case 0 /* TViewType.Root */:
|
|
11516
|
-
if (LVIEW_ROOT === undefined)
|
|
11517
|
-
LVIEW_ROOT = new LRootView();
|
|
11518
|
-
return LVIEW_ROOT;
|
|
11519
|
-
case 1 /* TViewType.Component */:
|
|
11520
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11521
|
-
if (LVIEW_COMPONENT === undefined)
|
|
11522
|
-
LVIEW_COMPONENT = new LComponentView();
|
|
11523
|
-
return LVIEW_COMPONENT;
|
|
11524
|
-
}
|
|
11525
|
-
if (LVIEW_COMPONENT_CACHE === undefined)
|
|
11526
|
-
LVIEW_COMPONENT_CACHE = new Map();
|
|
11527
|
-
let componentArray = LVIEW_COMPONENT_CACHE.get(name);
|
|
11528
|
-
if (componentArray === undefined) {
|
|
11529
|
-
componentArray = new (createNamedArrayType('LComponentView' + nameSuffix(name)))();
|
|
11530
|
-
LVIEW_COMPONENT_CACHE.set(name, componentArray);
|
|
11531
|
-
}
|
|
11532
|
-
return componentArray;
|
|
11533
|
-
case 2 /* TViewType.Embedded */:
|
|
11534
|
-
if (!ngDevMode || !ngDevMode.namedConstructors) {
|
|
11535
|
-
if (LVIEW_EMBEDDED === undefined)
|
|
11536
|
-
LVIEW_EMBEDDED = new LEmbeddedView();
|
|
11537
|
-
return LVIEW_EMBEDDED;
|
|
11538
|
-
}
|
|
11539
|
-
if (LVIEW_EMBEDDED_CACHE === undefined)
|
|
11540
|
-
LVIEW_EMBEDDED_CACHE = new Map();
|
|
11541
|
-
let embeddedArray = LVIEW_EMBEDDED_CACHE.get(name);
|
|
11542
|
-
if (embeddedArray === undefined) {
|
|
11543
|
-
embeddedArray = new (createNamedArrayType('LEmbeddedView' + nameSuffix(name)))();
|
|
11544
|
-
LVIEW_EMBEDDED_CACHE.set(name, embeddedArray);
|
|
11545
|
-
}
|
|
11546
|
-
return embeddedArray;
|
|
11547
|
-
}
|
|
11548
|
-
}
|
|
11549
|
-
function nameSuffix(text) {
|
|
11550
|
-
if (text == null)
|
|
11551
|
-
return '';
|
|
11552
|
-
const index = text.lastIndexOf('_Template');
|
|
11553
|
-
return '_' + (index === -1 ? text : text.slice(0, index));
|
|
11554
|
-
}
|
|
11555
|
-
/**
|
|
11556
|
-
* This class is a debug version of Object literal so that we can have constructor name show up
|
|
11557
|
-
* in
|
|
11558
|
-
* debug tools in ngDevMode.
|
|
11559
|
-
*/
|
|
11560
|
-
const TViewConstructor = class TView {
|
|
11561
|
-
constructor(type, blueprint, template, queries, viewQuery, declTNode, data, bindingStartIndex, expandoStartIndex, hostBindingOpCodes, firstCreatePass, firstUpdatePass, staticViewQueries, staticContentQueries, preOrderHooks, preOrderCheckHooks, contentHooks, contentCheckHooks, viewHooks, viewCheckHooks, destroyHooks, cleanup, contentQueries, components, directiveRegistry, pipeRegistry, firstChild, schemas, consts, incompleteFirstPass, _decls, _vars) {
|
|
11562
|
-
this.type = type;
|
|
11563
|
-
this.blueprint = blueprint;
|
|
11564
|
-
this.template = template;
|
|
11565
|
-
this.queries = queries;
|
|
11566
|
-
this.viewQuery = viewQuery;
|
|
11567
|
-
this.declTNode = declTNode;
|
|
11568
|
-
this.data = data;
|
|
11569
|
-
this.bindingStartIndex = bindingStartIndex;
|
|
11570
|
-
this.expandoStartIndex = expandoStartIndex;
|
|
11571
|
-
this.hostBindingOpCodes = hostBindingOpCodes;
|
|
11572
|
-
this.firstCreatePass = firstCreatePass;
|
|
11573
|
-
this.firstUpdatePass = firstUpdatePass;
|
|
11574
|
-
this.staticViewQueries = staticViewQueries;
|
|
11575
|
-
this.staticContentQueries = staticContentQueries;
|
|
11576
|
-
this.preOrderHooks = preOrderHooks;
|
|
11577
|
-
this.preOrderCheckHooks = preOrderCheckHooks;
|
|
11578
|
-
this.contentHooks = contentHooks;
|
|
11579
|
-
this.contentCheckHooks = contentCheckHooks;
|
|
11580
|
-
this.viewHooks = viewHooks;
|
|
11581
|
-
this.viewCheckHooks = viewCheckHooks;
|
|
11582
|
-
this.destroyHooks = destroyHooks;
|
|
11583
|
-
this.cleanup = cleanup;
|
|
11584
|
-
this.contentQueries = contentQueries;
|
|
11585
|
-
this.components = components;
|
|
11586
|
-
this.directiveRegistry = directiveRegistry;
|
|
11587
|
-
this.pipeRegistry = pipeRegistry;
|
|
11588
|
-
this.firstChild = firstChild;
|
|
11589
|
-
this.schemas = schemas;
|
|
11590
|
-
this.consts = consts;
|
|
11591
|
-
this.incompleteFirstPass = incompleteFirstPass;
|
|
11592
|
-
this._decls = _decls;
|
|
11593
|
-
this._vars = _vars;
|
|
11594
|
-
}
|
|
11595
|
-
get template_() {
|
|
11596
|
-
const buf = [];
|
|
11597
|
-
processTNodeChildren(this.firstChild, buf);
|
|
11598
|
-
return buf.join('');
|
|
11599
|
-
}
|
|
11600
|
-
get type_() {
|
|
11601
|
-
return TViewTypeAsString[this.type] || `TViewType.?${this.type}?`;
|
|
11602
|
-
}
|
|
11603
|
-
};
|
|
11604
|
-
class TNode {
|
|
11605
|
-
constructor(tView_, //
|
|
11606
|
-
type, //
|
|
11607
|
-
index, //
|
|
11608
|
-
insertBeforeIndex, //
|
|
11609
|
-
injectorIndex, //
|
|
11610
|
-
componentOffset, //
|
|
11611
|
-
directiveStart, //
|
|
11612
|
-
directiveEnd, //
|
|
11613
|
-
directiveStylingLast, //
|
|
11614
|
-
propertyBindings, //
|
|
11615
|
-
flags, //
|
|
11616
|
-
providerIndexes, //
|
|
11617
|
-
value, //
|
|
11618
|
-
attrs, //
|
|
11619
|
-
mergedAttrs, //
|
|
11620
|
-
localNames, //
|
|
11621
|
-
initialInputs, //
|
|
11622
|
-
inputs, //
|
|
11623
|
-
outputs, //
|
|
11624
|
-
tViews, //
|
|
11625
|
-
next, //
|
|
11626
|
-
projectionNext, //
|
|
11627
|
-
child, //
|
|
11628
|
-
parent, //
|
|
11629
|
-
projection, //
|
|
11630
|
-
styles, //
|
|
11631
|
-
stylesWithoutHost, //
|
|
11632
|
-
residualStyles, //
|
|
11633
|
-
classes, //
|
|
11634
|
-
classesWithoutHost, //
|
|
11635
|
-
residualClasses, //
|
|
11636
|
-
classBindings, //
|
|
11637
|
-
styleBindings) {
|
|
11638
|
-
this.tView_ = tView_;
|
|
11639
|
-
this.type = type;
|
|
11640
|
-
this.index = index;
|
|
11641
|
-
this.insertBeforeIndex = insertBeforeIndex;
|
|
11642
|
-
this.injectorIndex = injectorIndex;
|
|
11643
|
-
this.componentOffset = componentOffset;
|
|
11644
|
-
this.directiveStart = directiveStart;
|
|
11645
|
-
this.directiveEnd = directiveEnd;
|
|
11646
|
-
this.directiveStylingLast = directiveStylingLast;
|
|
11647
|
-
this.propertyBindings = propertyBindings;
|
|
11648
|
-
this.flags = flags;
|
|
11649
|
-
this.providerIndexes = providerIndexes;
|
|
11650
|
-
this.value = value;
|
|
11651
|
-
this.attrs = attrs;
|
|
11652
|
-
this.mergedAttrs = mergedAttrs;
|
|
11653
|
-
this.localNames = localNames;
|
|
11654
|
-
this.initialInputs = initialInputs;
|
|
11655
|
-
this.inputs = inputs;
|
|
11656
|
-
this.outputs = outputs;
|
|
11657
|
-
this.tViews = tViews;
|
|
11658
|
-
this.next = next;
|
|
11659
|
-
this.projectionNext = projectionNext;
|
|
11660
|
-
this.child = child;
|
|
11661
|
-
this.parent = parent;
|
|
11662
|
-
this.projection = projection;
|
|
11663
|
-
this.styles = styles;
|
|
11664
|
-
this.stylesWithoutHost = stylesWithoutHost;
|
|
11665
|
-
this.residualStyles = residualStyles;
|
|
11666
|
-
this.classes = classes;
|
|
11667
|
-
this.classesWithoutHost = classesWithoutHost;
|
|
11668
|
-
this.residualClasses = residualClasses;
|
|
11669
|
-
this.classBindings = classBindings;
|
|
11670
|
-
this.styleBindings = styleBindings;
|
|
11671
|
-
}
|
|
11672
|
-
/**
|
|
11673
|
-
* Return a human debug version of the set of `NodeInjector`s which will be consulted when
|
|
11674
|
-
* resolving tokens from this `TNode`.
|
|
11675
|
-
*
|
|
11676
|
-
* When debugging applications, it is often difficult to determine which `NodeInjector`s will be
|
|
11677
|
-
* consulted. This method shows a list of `DebugNode`s representing the `TNode`s which will be
|
|
11678
|
-
* consulted in order when resolving a token starting at this `TNode`.
|
|
11679
|
-
*
|
|
11680
|
-
* The original data is stored in `LView` and `TView` with a lot of offset indexes, and so it is
|
|
11681
|
-
* difficult to reason about.
|
|
11682
|
-
*
|
|
11683
|
-
* @param lView The `LView` instance for this `TNode`.
|
|
11684
|
-
*/
|
|
11685
|
-
debugNodeInjectorPath(lView) {
|
|
11686
|
-
const path = [];
|
|
11687
|
-
let injectorIndex = getInjectorIndex(this, lView);
|
|
11688
|
-
if (injectorIndex === -1) {
|
|
11689
|
-
// Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
|
|
11690
|
-
// parent NodeInjector.
|
|
11691
|
-
const parentLocation = getParentInjectorLocation(this, lView);
|
|
11692
|
-
if (parentLocation !== NO_PARENT_INJECTOR) {
|
|
11693
|
-
// We found a parent, so start searching from the parent location.
|
|
11694
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11695
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11696
|
-
}
|
|
11697
|
-
else {
|
|
11698
|
-
// No parents have been found, so there are no `NodeInjector`s to consult.
|
|
11699
|
-
}
|
|
11700
|
-
}
|
|
11701
|
-
while (injectorIndex !== -1) {
|
|
11702
|
-
ngDevMode && assertNodeInjector(lView, injectorIndex);
|
|
11703
|
-
const tNode = lView[TVIEW].data[injectorIndex + 8 /* NodeInjectorOffset.TNODE */];
|
|
11704
|
-
path.push(buildDebugNode(tNode, lView));
|
|
11705
|
-
const parentLocation = lView[injectorIndex + 8 /* NodeInjectorOffset.PARENT */];
|
|
11706
|
-
if (parentLocation === NO_PARENT_INJECTOR) {
|
|
11707
|
-
injectorIndex = -1;
|
|
11708
|
-
}
|
|
11709
|
-
else {
|
|
11710
|
-
injectorIndex = getParentInjectorIndex(parentLocation);
|
|
11711
|
-
lView = getParentInjectorView(parentLocation, lView);
|
|
11712
|
-
}
|
|
11713
|
-
}
|
|
11714
|
-
return path;
|
|
11715
|
-
}
|
|
11716
|
-
get type_() {
|
|
11717
|
-
return toTNodeTypeAsString(this.type) || `TNodeType.?${this.type}?`;
|
|
11718
|
-
}
|
|
11719
|
-
get flags_() {
|
|
11720
|
-
const flags = [];
|
|
11721
|
-
if (this.flags & 8 /* TNodeFlags.hasClassInput */)
|
|
11722
|
-
flags.push('TNodeFlags.hasClassInput');
|
|
11723
|
-
if (this.flags & 4 /* TNodeFlags.hasContentQuery */)
|
|
11724
|
-
flags.push('TNodeFlags.hasContentQuery');
|
|
11725
|
-
if (this.flags & 16 /* TNodeFlags.hasStyleInput */)
|
|
11726
|
-
flags.push('TNodeFlags.hasStyleInput');
|
|
11727
|
-
if (this.flags & 64 /* TNodeFlags.hasHostBindings */)
|
|
11728
|
-
flags.push('TNodeFlags.hasHostBindings');
|
|
11729
|
-
if (this.flags & 1 /* TNodeFlags.isDirectiveHost */)
|
|
11730
|
-
flags.push('TNodeFlags.isDirectiveHost');
|
|
11731
|
-
if (this.flags & 32 /* TNodeFlags.isDetached */)
|
|
11732
|
-
flags.push('TNodeFlags.isDetached');
|
|
11733
|
-
if (this.flags & 2 /* TNodeFlags.isProjected */)
|
|
11734
|
-
flags.push('TNodeFlags.isProjected');
|
|
11735
|
-
return flags.join('|');
|
|
11736
|
-
}
|
|
11737
|
-
get template_() {
|
|
11738
|
-
if (this.type & 1 /* TNodeType.Text */)
|
|
11739
|
-
return this.value;
|
|
11740
|
-
const buf = [];
|
|
11741
|
-
const tagName = typeof this.value === 'string' && this.value || this.type_;
|
|
11742
|
-
buf.push('<', tagName);
|
|
11743
|
-
if (this.flags) {
|
|
11744
|
-
buf.push(' ', this.flags_);
|
|
11745
|
-
}
|
|
11746
|
-
if (this.attrs) {
|
|
11747
|
-
for (let i = 0; i < this.attrs.length;) {
|
|
11748
|
-
const attrName = this.attrs[i++];
|
|
11749
|
-
if (typeof attrName == 'number') {
|
|
11750
|
-
break;
|
|
11751
|
-
}
|
|
11752
|
-
const attrValue = this.attrs[i++];
|
|
11753
|
-
buf.push(' ', attrName, '="', attrValue, '"');
|
|
11754
|
-
}
|
|
11755
|
-
}
|
|
11756
|
-
buf.push('>');
|
|
11757
|
-
processTNodeChildren(this.child, buf);
|
|
11758
|
-
buf.push('</', tagName, '>');
|
|
11759
|
-
return buf.join('');
|
|
11760
|
-
}
|
|
11761
|
-
get styleBindings_() {
|
|
11762
|
-
return toDebugStyleBinding(this, false);
|
|
11763
|
-
}
|
|
11764
|
-
get classBindings_() {
|
|
11765
|
-
return toDebugStyleBinding(this, true);
|
|
11766
|
-
}
|
|
11767
|
-
get providerIndexStart_() {
|
|
11768
|
-
return this.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
|
|
11769
|
-
}
|
|
11770
|
-
get providerIndexEnd_() {
|
|
11771
|
-
return this.providerIndexStart_ +
|
|
11772
|
-
(this.providerIndexes >>> 20 /* TNodeProviderIndexes.CptViewProvidersCountShift */);
|
|
11773
|
-
}
|
|
11774
|
-
}
|
|
11775
|
-
const TNodeDebug = TNode;
|
|
11776
|
-
function toDebugStyleBinding(tNode, isClassBased) {
|
|
11777
|
-
const tData = tNode.tView_.data;
|
|
11778
|
-
const bindings = [];
|
|
11779
|
-
const range = isClassBased ? tNode.classBindings : tNode.styleBindings;
|
|
11780
|
-
const prev = getTStylingRangePrev(range);
|
|
11781
|
-
const next = getTStylingRangeNext(range);
|
|
11782
|
-
let isTemplate = next !== 0;
|
|
11783
|
-
let cursor = isTemplate ? next : prev;
|
|
11784
|
-
while (cursor !== 0) {
|
|
11785
|
-
const itemKey = tData[cursor];
|
|
11786
|
-
const itemRange = tData[cursor + 1];
|
|
11787
|
-
bindings.unshift({
|
|
11788
|
-
key: itemKey,
|
|
11789
|
-
index: cursor,
|
|
11790
|
-
isTemplate: isTemplate,
|
|
11791
|
-
prevDuplicate: getTStylingRangePrevDuplicate(itemRange),
|
|
11792
|
-
nextDuplicate: getTStylingRangeNextDuplicate(itemRange),
|
|
11793
|
-
nextIndex: getTStylingRangeNext(itemRange),
|
|
11794
|
-
prevIndex: getTStylingRangePrev(itemRange),
|
|
11795
|
-
});
|
|
11796
|
-
if (cursor === prev)
|
|
11797
|
-
isTemplate = false;
|
|
11798
|
-
cursor = getTStylingRangePrev(itemRange);
|
|
11799
|
-
}
|
|
11800
|
-
bindings.push((isClassBased ? tNode.residualClasses : tNode.residualStyles) || null);
|
|
11801
|
-
return bindings;
|
|
11802
|
-
}
|
|
11803
|
-
function processTNodeChildren(tNode, buf) {
|
|
11804
|
-
while (tNode) {
|
|
11805
|
-
buf.push(tNode.template_);
|
|
11806
|
-
tNode = tNode.next;
|
|
11807
|
-
}
|
|
11808
|
-
}
|
|
11809
|
-
class TViewData extends Array {
|
|
11810
|
-
}
|
|
11811
|
-
let TVIEWDATA_EMPTY; // can't initialize here or it will not be tree shaken, because
|
|
11812
|
-
// `LView` constructor could have side-effects.
|
|
11813
|
-
/**
|
|
11814
|
-
* This function clones a blueprint and creates TData.
|
|
11815
|
-
*
|
|
11816
|
-
* Simple slice will keep the same type, and we need it to be TData
|
|
11817
|
-
*/
|
|
11818
|
-
function cloneToTViewData(list) {
|
|
11819
|
-
if (TVIEWDATA_EMPTY === undefined)
|
|
11820
|
-
TVIEWDATA_EMPTY = new TViewData();
|
|
11821
|
-
return TVIEWDATA_EMPTY.concat(list);
|
|
11822
|
-
}
|
|
11823
|
-
class LViewBlueprint extends Array {
|
|
11824
|
-
}
|
|
11825
|
-
class MatchesArray extends Array {
|
|
11826
|
-
}
|
|
11827
|
-
class TViewComponents extends Array {
|
|
11828
|
-
}
|
|
11829
|
-
class TNodeLocalNames extends Array {
|
|
11830
|
-
}
|
|
11831
|
-
class TNodeInitialInputs extends Array {
|
|
11832
|
-
}
|
|
11833
|
-
class LCleanup extends Array {
|
|
11834
|
-
}
|
|
11835
|
-
class TCleanup extends Array {
|
|
11836
|
-
}
|
|
11837
|
-
function attachLViewDebug(lView) {
|
|
11838
|
-
attachDebugObject(lView, new LViewDebug(lView));
|
|
11839
|
-
}
|
|
11840
|
-
function attachLContainerDebug(lContainer) {
|
|
11841
|
-
attachDebugObject(lContainer, new LContainerDebug(lContainer));
|
|
11842
|
-
}
|
|
11843
|
-
function toDebug(obj) {
|
|
11844
|
-
if (obj) {
|
|
11845
|
-
const debug = obj.debug;
|
|
11846
|
-
assertDefined(debug, 'Object does not have a debug representation.');
|
|
11847
|
-
return debug;
|
|
11848
|
-
}
|
|
11849
|
-
else {
|
|
11850
|
-
return obj;
|
|
11851
|
-
}
|
|
11852
|
-
}
|
|
11853
|
-
/**
|
|
11854
|
-
* Use this method to unwrap a native element in `LView` and convert it into HTML for easier
|
|
11855
|
-
* reading.
|
|
11856
|
-
*
|
|
11857
|
-
* @param value possibly wrapped native DOM node.
|
|
11858
|
-
* @param includeChildren If `true` then the serialized HTML form will include child elements
|
|
11859
|
-
* (same
|
|
11860
|
-
* as `outerHTML`). If `false` then the serialized HTML form will only contain the element
|
|
11861
|
-
* itself
|
|
11862
|
-
* (will not serialize child elements).
|
|
11863
|
-
*/
|
|
11864
|
-
function toHtml(value, includeChildren = false) {
|
|
11865
|
-
const node = unwrapRNode(value);
|
|
11866
|
-
if (node) {
|
|
11867
|
-
switch (node.nodeType) {
|
|
11868
|
-
case Node.TEXT_NODE:
|
|
11869
|
-
return node.textContent;
|
|
11870
|
-
case Node.COMMENT_NODE:
|
|
11871
|
-
return `<!--${node.textContent}-->`;
|
|
11872
|
-
case Node.ELEMENT_NODE:
|
|
11873
|
-
const outerHTML = node.outerHTML;
|
|
11874
|
-
if (includeChildren) {
|
|
11875
|
-
return outerHTML;
|
|
11876
|
-
}
|
|
11877
|
-
else {
|
|
11878
|
-
const innerHTML = '>' + node.innerHTML + '<';
|
|
11879
|
-
return (outerHTML.split(innerHTML)[0]) + '>';
|
|
11880
|
-
}
|
|
11881
|
-
}
|
|
11882
|
-
}
|
|
11883
|
-
return null;
|
|
11884
|
-
}
|
|
11885
|
-
class LViewDebug {
|
|
11886
|
-
constructor(_raw_lView) {
|
|
11887
|
-
this._raw_lView = _raw_lView;
|
|
11888
|
-
}
|
|
11889
|
-
/**
|
|
11890
|
-
* Flags associated with the `LView` unpacked into a more readable state.
|
|
11891
|
-
*/
|
|
11892
|
-
get flags() {
|
|
11893
|
-
const flags = this._raw_lView[FLAGS];
|
|
11894
|
-
return {
|
|
11895
|
-
__raw__flags__: flags,
|
|
11896
|
-
initPhaseState: flags & 3 /* LViewFlags.InitPhaseStateMask */,
|
|
11897
|
-
creationMode: !!(flags & 4 /* LViewFlags.CreationMode */),
|
|
11898
|
-
firstViewPass: !!(flags & 8 /* LViewFlags.FirstLViewPass */),
|
|
11899
|
-
checkAlways: !!(flags & 16 /* LViewFlags.CheckAlways */),
|
|
11900
|
-
dirty: !!(flags & 32 /* LViewFlags.Dirty */),
|
|
11901
|
-
attached: !!(flags & 64 /* LViewFlags.Attached */),
|
|
11902
|
-
destroyed: !!(flags & 128 /* LViewFlags.Destroyed */),
|
|
11903
|
-
isRoot: !!(flags & 256 /* LViewFlags.IsRoot */),
|
|
11904
|
-
indexWithinInitPhase: flags >> 11 /* LViewFlags.IndexWithinInitPhaseShift */,
|
|
11905
|
-
};
|
|
11906
|
-
}
|
|
11907
|
-
get parent() {
|
|
11908
|
-
return toDebug(this._raw_lView[PARENT]);
|
|
11909
|
-
}
|
|
11910
|
-
get hostHTML() {
|
|
11911
|
-
return toHtml(this._raw_lView[HOST], true);
|
|
11912
|
-
}
|
|
11913
|
-
get html() {
|
|
11914
|
-
return (this.nodes || []).map(mapToHTML).join('');
|
|
11915
|
-
}
|
|
11916
|
-
get context() {
|
|
11917
|
-
return this._raw_lView[CONTEXT];
|
|
11918
|
-
}
|
|
11919
|
-
/**
|
|
11920
|
-
* The tree of nodes associated with the current `LView`. The nodes have been normalized into
|
|
11921
|
-
* a tree structure with relevant details pulled out for readability.
|
|
11922
|
-
*/
|
|
11923
|
-
get nodes() {
|
|
11924
|
-
const lView = this._raw_lView;
|
|
11925
|
-
const tNode = lView[TVIEW].firstChild;
|
|
11926
|
-
return toDebugNodes(tNode, lView);
|
|
11927
|
-
}
|
|
11928
|
-
get template() {
|
|
11929
|
-
return this.tView.template_;
|
|
11930
|
-
}
|
|
11931
|
-
get tView() {
|
|
11932
|
-
return this._raw_lView[TVIEW];
|
|
11933
|
-
}
|
|
11934
|
-
get cleanup() {
|
|
11935
|
-
return this._raw_lView[CLEANUP];
|
|
11936
|
-
}
|
|
11937
|
-
get injector() {
|
|
11938
|
-
return this._raw_lView[INJECTOR$1];
|
|
11939
|
-
}
|
|
11940
|
-
get rendererFactory() {
|
|
11941
|
-
return this._raw_lView[RENDERER_FACTORY];
|
|
11942
|
-
}
|
|
11943
|
-
get renderer() {
|
|
11944
|
-
return this._raw_lView[RENDERER];
|
|
11945
|
-
}
|
|
11946
|
-
get sanitizer() {
|
|
11947
|
-
return this._raw_lView[SANITIZER];
|
|
11948
|
-
}
|
|
11949
|
-
get childHead() {
|
|
11950
|
-
return toDebug(this._raw_lView[CHILD_HEAD]);
|
|
11951
|
-
}
|
|
11952
|
-
get next() {
|
|
11953
|
-
return toDebug(this._raw_lView[NEXT]);
|
|
11954
|
-
}
|
|
11955
|
-
get childTail() {
|
|
11956
|
-
return toDebug(this._raw_lView[CHILD_TAIL]);
|
|
11957
|
-
}
|
|
11958
|
-
get declarationView() {
|
|
11959
|
-
return toDebug(this._raw_lView[DECLARATION_VIEW]);
|
|
11960
|
-
}
|
|
11961
|
-
get queries() {
|
|
11962
|
-
return this._raw_lView[QUERIES];
|
|
11963
|
-
}
|
|
11964
|
-
get tHost() {
|
|
11965
|
-
return this._raw_lView[T_HOST];
|
|
11966
|
-
}
|
|
11967
|
-
get id() {
|
|
11968
|
-
return this._raw_lView[ID];
|
|
11969
|
-
}
|
|
11970
|
-
get decls() {
|
|
11971
|
-
return toLViewRange(this.tView, this._raw_lView, HEADER_OFFSET, this.tView.bindingStartIndex);
|
|
11972
|
-
}
|
|
11973
|
-
get vars() {
|
|
11974
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.bindingStartIndex, this.tView.expandoStartIndex);
|
|
11975
|
-
}
|
|
11976
|
-
get expando() {
|
|
11977
|
-
return toLViewRange(this.tView, this._raw_lView, this.tView.expandoStartIndex, this._raw_lView.length);
|
|
11978
|
-
}
|
|
11979
|
-
/**
|
|
11980
|
-
* Normalized view of child views (and containers) attached at this location.
|
|
11981
|
-
*/
|
|
11982
|
-
get childViews() {
|
|
11983
|
-
const childViews = [];
|
|
11984
|
-
let child = this.childHead;
|
|
11985
|
-
while (child) {
|
|
11986
|
-
childViews.push(child);
|
|
11987
|
-
child = child.next;
|
|
11096
|
+
_getByKeyDefault(key, notFoundValue, visibility) {
|
|
11097
|
+
let inj;
|
|
11098
|
+
if (visibility instanceof SkipSelf) {
|
|
11099
|
+
inj = this.parent;
|
|
11100
|
+
}
|
|
11101
|
+
else {
|
|
11102
|
+
inj = this;
|
|
11103
|
+
}
|
|
11104
|
+
while (inj instanceof ReflectiveInjector_) {
|
|
11105
|
+
const inj_ = inj;
|
|
11106
|
+
const obj = inj_._getObjByKeyId(key.id);
|
|
11107
|
+
if (obj !== UNDEFINED)
|
|
11108
|
+
return obj;
|
|
11109
|
+
inj = inj_.parent;
|
|
11110
|
+
}
|
|
11111
|
+
if (inj !== null) {
|
|
11112
|
+
return inj.get(key.token, notFoundValue);
|
|
11113
|
+
}
|
|
11114
|
+
else {
|
|
11115
|
+
return this._throwOrNull(key, notFoundValue);
|
|
11988
11116
|
}
|
|
11989
|
-
return childViews;
|
|
11990
|
-
}
|
|
11991
|
-
}
|
|
11992
|
-
function mapToHTML(node) {
|
|
11993
|
-
if (node.type === 'ElementContainer') {
|
|
11994
|
-
return (node.children || []).map(mapToHTML).join('');
|
|
11995
11117
|
}
|
|
11996
|
-
|
|
11997
|
-
|
|
11118
|
+
get displayName() {
|
|
11119
|
+
const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ')
|
|
11120
|
+
.join(', ');
|
|
11121
|
+
return `ReflectiveInjector(providers: [${providers}])`;
|
|
11998
11122
|
}
|
|
11999
|
-
|
|
12000
|
-
return
|
|
11123
|
+
toString() {
|
|
11124
|
+
return this.displayName;
|
|
12001
11125
|
}
|
|
12002
11126
|
}
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
11127
|
+
ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
|
|
11128
|
+
function _mapProviders(injector, fn) {
|
|
11129
|
+
const res = [];
|
|
11130
|
+
for (let i = 0; i < injector._providers.length; ++i) {
|
|
11131
|
+
res[i] = fn(injector.getProviderAtIndex(i));
|
|
12007
11132
|
}
|
|
12008
|
-
return
|
|
11133
|
+
return res;
|
|
12009
11134
|
}
|
|
11135
|
+
|
|
12010
11136
|
/**
|
|
12011
|
-
*
|
|
11137
|
+
* @license
|
|
11138
|
+
* Copyright Google LLC All Rights Reserved.
|
|
12012
11139
|
*
|
|
12013
|
-
*
|
|
12014
|
-
*
|
|
11140
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11141
|
+
* found in the LICENSE file at https://angular.io/license
|
|
12015
11142
|
*/
|
|
12016
|
-
|
|
12017
|
-
if (tNode) {
|
|
12018
|
-
const debugNodes = [];
|
|
12019
|
-
let tNodeCursor = tNode;
|
|
12020
|
-
while (tNodeCursor) {
|
|
12021
|
-
debugNodes.push(buildDebugNode(tNodeCursor, lView));
|
|
12022
|
-
tNodeCursor = tNodeCursor.next;
|
|
12023
|
-
}
|
|
12024
|
-
return debugNodes;
|
|
12025
|
-
}
|
|
12026
|
-
else {
|
|
12027
|
-
return [];
|
|
12028
|
-
}
|
|
12029
|
-
}
|
|
12030
|
-
function buildDebugNode(tNode, lView) {
|
|
12031
|
-
const rawValue = lView[tNode.index];
|
|
12032
|
-
const native = unwrapRNode(rawValue);
|
|
12033
|
-
const factories = [];
|
|
12034
|
-
const instances = [];
|
|
12035
|
-
const tView = lView[TVIEW];
|
|
12036
|
-
for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {
|
|
12037
|
-
const def = tView.data[i];
|
|
12038
|
-
factories.push(def.type);
|
|
12039
|
-
instances.push(lView[i]);
|
|
12040
|
-
}
|
|
12041
|
-
return {
|
|
12042
|
-
html: toHtml(native),
|
|
12043
|
-
type: toTNodeTypeAsString(tNode.type),
|
|
12044
|
-
tNode,
|
|
12045
|
-
native: native,
|
|
12046
|
-
children: toDebugNodes(tNode.child, lView),
|
|
12047
|
-
factories,
|
|
12048
|
-
instances,
|
|
12049
|
-
injector: buildNodeInjectorDebug(tNode, tView, lView),
|
|
12050
|
-
get injectorResolutionPath() {
|
|
12051
|
-
return tNode.debugNodeInjectorPath(lView);
|
|
12052
|
-
},
|
|
12053
|
-
};
|
|
12054
|
-
}
|
|
12055
|
-
function buildNodeInjectorDebug(tNode, tView, lView) {
|
|
12056
|
-
const viewProviders = [];
|
|
12057
|
-
for (let i = tNode.providerIndexStart_; i < tNode.providerIndexEnd_; i++) {
|
|
12058
|
-
viewProviders.push(tView.data[i]);
|
|
12059
|
-
}
|
|
12060
|
-
const providers = [];
|
|
12061
|
-
for (let i = tNode.providerIndexEnd_; i < tNode.directiveEnd; i++) {
|
|
12062
|
-
providers.push(tView.data[i]);
|
|
12063
|
-
}
|
|
12064
|
-
const nodeInjectorDebug = {
|
|
12065
|
-
bloom: toBloom(lView, tNode.injectorIndex),
|
|
12066
|
-
cumulativeBloom: toBloom(tView.data, tNode.injectorIndex),
|
|
12067
|
-
providers,
|
|
12068
|
-
viewProviders,
|
|
12069
|
-
parentInjectorIndex: lView[tNode.providerIndexStart_ - 1],
|
|
12070
|
-
};
|
|
12071
|
-
return nodeInjectorDebug;
|
|
12072
|
-
}
|
|
11143
|
+
|
|
12073
11144
|
/**
|
|
12074
|
-
*
|
|
11145
|
+
* @license
|
|
11146
|
+
* Copyright Google LLC All Rights Reserved.
|
|
12075
11147
|
*
|
|
12076
|
-
*
|
|
12077
|
-
*
|
|
11148
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11149
|
+
* found in the LICENSE file at https://angular.io/license
|
|
12078
11150
|
*/
|
|
12079
|
-
|
|
12080
|
-
const value = array[idx];
|
|
12081
|
-
// If not a number we print 8 `?` to retain alignment but let user know that it was called on
|
|
12082
|
-
// wrong type.
|
|
12083
|
-
if (typeof value !== 'number')
|
|
12084
|
-
return '????????';
|
|
12085
|
-
// We prefix 0s so that we have constant length number
|
|
12086
|
-
const text = '00000000' + value.toString(2);
|
|
12087
|
-
return text.substring(text.length - 8);
|
|
12088
|
-
}
|
|
11151
|
+
|
|
12089
11152
|
/**
|
|
12090
|
-
*
|
|
11153
|
+
* @license
|
|
11154
|
+
* Copyright Google LLC All Rights Reserved.
|
|
12091
11155
|
*
|
|
12092
|
-
*
|
|
12093
|
-
*
|
|
11156
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11157
|
+
* found in the LICENSE file at https://angular.io/license
|
|
12094
11158
|
*/
|
|
12095
|
-
function
|
|
12096
|
-
|
|
12097
|
-
|
|
11159
|
+
function ɵɵdirectiveInject(token, flags = InjectFlags.Default) {
|
|
11160
|
+
const lView = getLView();
|
|
11161
|
+
// Fall back to inject() if view hasn't been created. This situation can happen in tests
|
|
11162
|
+
// if inject utilities are used before bootstrapping.
|
|
11163
|
+
if (lView === null) {
|
|
11164
|
+
// Verify that we will not get into infinite loop.
|
|
11165
|
+
ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
|
|
11166
|
+
return ɵɵinject(token, flags);
|
|
12098
11167
|
}
|
|
12099
|
-
|
|
11168
|
+
const tNode = getCurrentTNode();
|
|
11169
|
+
return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
|
|
12100
11170
|
}
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
return this._raw_lContainer[MOVED_VIEWS];
|
|
12117
|
-
}
|
|
12118
|
-
get host() {
|
|
12119
|
-
return this._raw_lContainer[HOST];
|
|
12120
|
-
}
|
|
12121
|
-
get native() {
|
|
12122
|
-
return this._raw_lContainer[NATIVE];
|
|
12123
|
-
}
|
|
12124
|
-
get next() {
|
|
12125
|
-
return toDebug(this._raw_lContainer[NEXT]);
|
|
12126
|
-
}
|
|
11171
|
+
/**
|
|
11172
|
+
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
11173
|
+
* particular class.
|
|
11174
|
+
*
|
|
11175
|
+
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
11176
|
+
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
11177
|
+
*
|
|
11178
|
+
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
11179
|
+
* and thus in the stack trace.
|
|
11180
|
+
*
|
|
11181
|
+
* @codeGenApi
|
|
11182
|
+
*/
|
|
11183
|
+
function ɵɵinvalidFactory() {
|
|
11184
|
+
const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
|
|
11185
|
+
throw new Error(msg);
|
|
12127
11186
|
}
|
|
12128
11187
|
|
|
12129
11188
|
/**
|
|
@@ -12199,7 +11258,7 @@ function renderChildComponents(hostLView, components) {
|
|
|
12199
11258
|
}
|
|
12200
11259
|
}
|
|
12201
11260
|
function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
|
|
12202
|
-
const lView =
|
|
11261
|
+
const lView = tView.blueprint.slice();
|
|
12203
11262
|
lView[HOST] = host;
|
|
12204
11263
|
lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 64 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
|
|
12205
11264
|
if (embeddedViewInjector !== null ||
|
|
@@ -12223,7 +11282,6 @@ function createLView(parentLView, tView, context, flags, host, tHostNode, render
|
|
|
12223
11282
|
assertEqual(tView.type == 2 /* TViewType.Embedded */ ? parentLView !== null : true, true, 'Embedded views must have parentLView');
|
|
12224
11283
|
lView[DECLARATION_COMPONENT_VIEW] =
|
|
12225
11284
|
tView.type == 2 /* TViewType.Embedded */ ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;
|
|
12226
|
-
ngDevMode && attachLViewDebug(lView);
|
|
12227
11285
|
return lView;
|
|
12228
11286
|
}
|
|
12229
11287
|
function getOrCreateTNode(tView, index, type, name, attrs) {
|
|
@@ -12606,73 +11664,38 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12606
11664
|
const initialViewLength = bindingStartIndex + vars;
|
|
12607
11665
|
const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);
|
|
12608
11666
|
const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;
|
|
12609
|
-
const tView = blueprint[TVIEW] =
|
|
12610
|
-
|
|
12611
|
-
blueprint
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
viewQuery
|
|
12615
|
-
declTNode
|
|
12616
|
-
|
|
12617
|
-
bindingStartIndex
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
typeof directives === 'function' ?
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
false, // incompleteFirstPass: boolean
|
|
12642
|
-
decls, // ngDevMode only: decls
|
|
12643
|
-
vars) :
|
|
12644
|
-
{
|
|
12645
|
-
type: type,
|
|
12646
|
-
blueprint: blueprint,
|
|
12647
|
-
template: templateFn,
|
|
12648
|
-
queries: null,
|
|
12649
|
-
viewQuery: viewQuery,
|
|
12650
|
-
declTNode: declTNode,
|
|
12651
|
-
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
12652
|
-
bindingStartIndex: bindingStartIndex,
|
|
12653
|
-
expandoStartIndex: initialViewLength,
|
|
12654
|
-
hostBindingOpCodes: null,
|
|
12655
|
-
firstCreatePass: true,
|
|
12656
|
-
firstUpdatePass: true,
|
|
12657
|
-
staticViewQueries: false,
|
|
12658
|
-
staticContentQueries: false,
|
|
12659
|
-
preOrderHooks: null,
|
|
12660
|
-
preOrderCheckHooks: null,
|
|
12661
|
-
contentHooks: null,
|
|
12662
|
-
contentCheckHooks: null,
|
|
12663
|
-
viewHooks: null,
|
|
12664
|
-
viewCheckHooks: null,
|
|
12665
|
-
destroyHooks: null,
|
|
12666
|
-
cleanup: null,
|
|
12667
|
-
contentQueries: null,
|
|
12668
|
-
components: null,
|
|
12669
|
-
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
12670
|
-
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
12671
|
-
firstChild: null,
|
|
12672
|
-
schemas: schemas,
|
|
12673
|
-
consts: consts,
|
|
12674
|
-
incompleteFirstPass: false
|
|
12675
|
-
};
|
|
11667
|
+
const tView = blueprint[TVIEW] = {
|
|
11668
|
+
type: type,
|
|
11669
|
+
blueprint: blueprint,
|
|
11670
|
+
template: templateFn,
|
|
11671
|
+
queries: null,
|
|
11672
|
+
viewQuery: viewQuery,
|
|
11673
|
+
declTNode: declTNode,
|
|
11674
|
+
data: blueprint.slice().fill(null, bindingStartIndex),
|
|
11675
|
+
bindingStartIndex: bindingStartIndex,
|
|
11676
|
+
expandoStartIndex: initialViewLength,
|
|
11677
|
+
hostBindingOpCodes: null,
|
|
11678
|
+
firstCreatePass: true,
|
|
11679
|
+
firstUpdatePass: true,
|
|
11680
|
+
staticViewQueries: false,
|
|
11681
|
+
staticContentQueries: false,
|
|
11682
|
+
preOrderHooks: null,
|
|
11683
|
+
preOrderCheckHooks: null,
|
|
11684
|
+
contentHooks: null,
|
|
11685
|
+
contentCheckHooks: null,
|
|
11686
|
+
viewHooks: null,
|
|
11687
|
+
viewCheckHooks: null,
|
|
11688
|
+
destroyHooks: null,
|
|
11689
|
+
cleanup: null,
|
|
11690
|
+
contentQueries: null,
|
|
11691
|
+
components: null,
|
|
11692
|
+
directiveRegistry: typeof directives === 'function' ? directives() : directives,
|
|
11693
|
+
pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,
|
|
11694
|
+
firstChild: null,
|
|
11695
|
+
schemas: schemas,
|
|
11696
|
+
consts: consts,
|
|
11697
|
+
incompleteFirstPass: false
|
|
11698
|
+
};
|
|
12676
11699
|
if (ngDevMode) {
|
|
12677
11700
|
// For performance reasons it is important that the tView retains the same shape during runtime.
|
|
12678
11701
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12682,7 +11705,7 @@ function createTView(type, declTNode, templateFn, decls, vars, directives, pipes
|
|
|
12682
11705
|
return tView;
|
|
12683
11706
|
}
|
|
12684
11707
|
function createViewBlueprint(bindingStartIndex, initialViewLength) {
|
|
12685
|
-
const blueprint =
|
|
11708
|
+
const blueprint = [];
|
|
12686
11709
|
for (let i = 0; i < initialViewLength; i++) {
|
|
12687
11710
|
blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);
|
|
12688
11711
|
}
|
|
@@ -12735,74 +11758,40 @@ function createTNode(tView, tParent, type, index, value, attrs) {
|
|
|
12735
11758
|
ngDevMode && ngDevMode.tNode++;
|
|
12736
11759
|
ngDevMode && tParent && assertTNodeForTView(tParent, tView);
|
|
12737
11760
|
let injectorIndex = tParent ? tParent.injectorIndex : -1;
|
|
12738
|
-
const tNode =
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
-1,
|
|
12745
|
-
-1,
|
|
12746
|
-
-1,
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
0,
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
null,
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
0,
|
|
12771
|
-
|
|
12772
|
-
{
|
|
12773
|
-
type,
|
|
12774
|
-
index,
|
|
12775
|
-
insertBeforeIndex: null,
|
|
12776
|
-
injectorIndex,
|
|
12777
|
-
directiveStart: -1,
|
|
12778
|
-
directiveEnd: -1,
|
|
12779
|
-
directiveStylingLast: -1,
|
|
12780
|
-
componentOffset: -1,
|
|
12781
|
-
propertyBindings: null,
|
|
12782
|
-
flags: 0,
|
|
12783
|
-
providerIndexes: 0,
|
|
12784
|
-
value: value,
|
|
12785
|
-
attrs: attrs,
|
|
12786
|
-
mergedAttrs: null,
|
|
12787
|
-
localNames: null,
|
|
12788
|
-
initialInputs: undefined,
|
|
12789
|
-
inputs: null,
|
|
12790
|
-
outputs: null,
|
|
12791
|
-
tViews: null,
|
|
12792
|
-
next: null,
|
|
12793
|
-
projectionNext: null,
|
|
12794
|
-
child: null,
|
|
12795
|
-
parent: tParent,
|
|
12796
|
-
projection: null,
|
|
12797
|
-
styles: null,
|
|
12798
|
-
stylesWithoutHost: null,
|
|
12799
|
-
residualStyles: undefined,
|
|
12800
|
-
classes: null,
|
|
12801
|
-
classesWithoutHost: null,
|
|
12802
|
-
residualClasses: undefined,
|
|
12803
|
-
classBindings: 0,
|
|
12804
|
-
styleBindings: 0,
|
|
12805
|
-
};
|
|
11761
|
+
const tNode = {
|
|
11762
|
+
type,
|
|
11763
|
+
index,
|
|
11764
|
+
insertBeforeIndex: null,
|
|
11765
|
+
injectorIndex,
|
|
11766
|
+
directiveStart: -1,
|
|
11767
|
+
directiveEnd: -1,
|
|
11768
|
+
directiveStylingLast: -1,
|
|
11769
|
+
componentOffset: -1,
|
|
11770
|
+
propertyBindings: null,
|
|
11771
|
+
flags: 0,
|
|
11772
|
+
providerIndexes: 0,
|
|
11773
|
+
value: value,
|
|
11774
|
+
attrs: attrs,
|
|
11775
|
+
mergedAttrs: null,
|
|
11776
|
+
localNames: null,
|
|
11777
|
+
initialInputs: undefined,
|
|
11778
|
+
inputs: null,
|
|
11779
|
+
outputs: null,
|
|
11780
|
+
tViews: null,
|
|
11781
|
+
next: null,
|
|
11782
|
+
projectionNext: null,
|
|
11783
|
+
child: null,
|
|
11784
|
+
parent: tParent,
|
|
11785
|
+
projection: null,
|
|
11786
|
+
styles: null,
|
|
11787
|
+
stylesWithoutHost: null,
|
|
11788
|
+
residualStyles: undefined,
|
|
11789
|
+
classes: null,
|
|
11790
|
+
classesWithoutHost: null,
|
|
11791
|
+
residualClasses: undefined,
|
|
11792
|
+
classBindings: 0,
|
|
11793
|
+
styleBindings: 0,
|
|
11794
|
+
};
|
|
12806
11795
|
if (ngDevMode) {
|
|
12807
11796
|
// For performance reasons it is important that the tNode retains the same shape during runtime.
|
|
12808
11797
|
// (To make sure that all of the code is monomorphic.) For this reason we seal the object to
|
|
@@ -12859,7 +11848,7 @@ function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefinitionMa
|
|
|
12859
11848
|
const end = tNode.directiveEnd;
|
|
12860
11849
|
const tViewData = tView.data;
|
|
12861
11850
|
const tNodeAttrs = tNode.attrs;
|
|
12862
|
-
const inputsFromAttrs =
|
|
11851
|
+
const inputsFromAttrs = [];
|
|
12863
11852
|
let inputsStore = null;
|
|
12864
11853
|
let outputsStore = null;
|
|
12865
11854
|
for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {
|
|
@@ -13128,6 +12117,12 @@ function lastSelectedElementIdx(hostBindingOpCodes) {
|
|
|
13128
12117
|
function instantiateAllDirectives(tView, lView, tNode, native) {
|
|
13129
12118
|
const start = tNode.directiveStart;
|
|
13130
12119
|
const end = tNode.directiveEnd;
|
|
12120
|
+
// The component view needs to be created before creating the node injector
|
|
12121
|
+
// since it is used to inject some special symbols like `ChangeDetectorRef`.
|
|
12122
|
+
if (isComponentHost(tNode)) {
|
|
12123
|
+
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
|
|
12124
|
+
addComponentLogic(lView, tNode, tView.data[start + tNode.componentOffset]);
|
|
12125
|
+
}
|
|
13131
12126
|
if (!tView.firstCreatePass) {
|
|
13132
12127
|
getOrCreateNodeInjectorForNode(tNode, lView);
|
|
13133
12128
|
}
|
|
@@ -13135,19 +12130,14 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
|
|
|
13135
12130
|
const initialInputs = tNode.initialInputs;
|
|
13136
12131
|
for (let i = start; i < end; i++) {
|
|
13137
12132
|
const def = tView.data[i];
|
|
13138
|
-
const isComponent = isComponentDef(def);
|
|
13139
|
-
if (isComponent) {
|
|
13140
|
-
ngDevMode && assertTNodeType(tNode, 3 /* TNodeType.AnyRNode */);
|
|
13141
|
-
addComponentLogic(lView, tNode, def);
|
|
13142
|
-
}
|
|
13143
12133
|
const directive = getNodeInjectable(lView, tView, i, tNode);
|
|
13144
12134
|
attachPatchData(directive, lView);
|
|
13145
12135
|
if (initialInputs !== null) {
|
|
13146
12136
|
setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);
|
|
13147
12137
|
}
|
|
13148
|
-
if (
|
|
12138
|
+
if (isComponentDef(def)) {
|
|
13149
12139
|
const componentView = getComponentLViewByIndex(tNode.index, lView);
|
|
13150
|
-
componentView[CONTEXT] =
|
|
12140
|
+
componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);
|
|
13151
12141
|
}
|
|
13152
12142
|
}
|
|
13153
12143
|
}
|
|
@@ -13198,7 +12188,7 @@ function findDirectiveDefMatches(tView, tNode) {
|
|
|
13198
12188
|
for (let i = 0; i < registry.length; i++) {
|
|
13199
12189
|
const def = registry[i];
|
|
13200
12190
|
if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {
|
|
13201
|
-
matches || (matches =
|
|
12191
|
+
matches || (matches = []);
|
|
13202
12192
|
if (isComponentDef(def)) {
|
|
13203
12193
|
if (ngDevMode) {
|
|
13204
12194
|
assertTNodeType(tNode, 2 /* TNodeType.Element */, `"${tNode.value}" tags cannot be used as component hosts. ` +
|
|
@@ -13256,13 +12246,12 @@ function markAsComponentHost(tView, hostTNode, componentOffset) {
|
|
|
13256
12246
|
ngDevMode && assertFirstCreatePass(tView);
|
|
13257
12247
|
ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');
|
|
13258
12248
|
hostTNode.componentOffset = componentOffset;
|
|
13259
|
-
(tView.components || (tView.components =
|
|
13260
|
-
.push(hostTNode.index);
|
|
12249
|
+
(tView.components || (tView.components = [])).push(hostTNode.index);
|
|
13261
12250
|
}
|
|
13262
12251
|
/** Caches local names and their matching directive indices for query and template lookups. */
|
|
13263
12252
|
function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {
|
|
13264
12253
|
if (localRefs) {
|
|
13265
|
-
const localNames = tNode.localNames =
|
|
12254
|
+
const localNames = tNode.localNames = [];
|
|
13266
12255
|
// Local names must be stored in tNode in the same order that localRefs are defined
|
|
13267
12256
|
// in the template to ensure the data is loaded in the same slots as their refs
|
|
13268
12257
|
// in the template (for template queries).
|
|
@@ -13445,9 +12434,6 @@ function generateInitialInputs(inputs, directiveIndex, attrs) {
|
|
|
13445
12434
|
//////////////////////////
|
|
13446
12435
|
//// ViewContainer & View
|
|
13447
12436
|
//////////////////////////
|
|
13448
|
-
// Not sure why I need to do `any` here but TS complains later.
|
|
13449
|
-
const LContainerArray = class LContainer extends Array {
|
|
13450
|
-
};
|
|
13451
12437
|
/**
|
|
13452
12438
|
* Creates a LContainer, either from a container instruction, or for a ViewContainerRef.
|
|
13453
12439
|
*
|
|
@@ -13460,20 +12446,20 @@ const LContainerArray = class LContainer extends Array {
|
|
|
13460
12446
|
*/
|
|
13461
12447
|
function createLContainer(hostNative, currentView, native, tNode) {
|
|
13462
12448
|
ngDevMode && assertLView(currentView);
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
|
|
13469
|
-
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
12449
|
+
const lContainer = [
|
|
12450
|
+
hostNative,
|
|
12451
|
+
true,
|
|
12452
|
+
false,
|
|
12453
|
+
currentView,
|
|
12454
|
+
null,
|
|
12455
|
+
0,
|
|
12456
|
+
tNode,
|
|
12457
|
+
native,
|
|
12458
|
+
null,
|
|
12459
|
+
null, // moved views
|
|
12460
|
+
];
|
|
13474
12461
|
ngDevMode &&
|
|
13475
12462
|
assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');
|
|
13476
|
-
ngDevMode && attachLContainerDebug(lContainer);
|
|
13477
12463
|
return lContainer;
|
|
13478
12464
|
}
|
|
13479
12465
|
/**
|
|
@@ -13747,10 +12733,10 @@ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex,
|
|
|
13747
12733
|
}
|
|
13748
12734
|
function getOrCreateLViewCleanup(view) {
|
|
13749
12735
|
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
|
13750
|
-
return view[CLEANUP] || (view[CLEANUP] =
|
|
12736
|
+
return view[CLEANUP] || (view[CLEANUP] = []);
|
|
13751
12737
|
}
|
|
13752
12738
|
function getOrCreateTViewCleanup(tView) {
|
|
13753
|
-
return tView.cleanup || (tView.cleanup =
|
|
12739
|
+
return tView.cleanup || (tView.cleanup = []);
|
|
13754
12740
|
}
|
|
13755
12741
|
/**
|
|
13756
12742
|
* There are cases where the sub component's renderer needs to be included
|
|
@@ -14362,17 +13348,6 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
14362
13348
|
return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
|
|
14363
13349
|
}
|
|
14364
13350
|
}
|
|
14365
|
-
const componentFactoryResolver = new ComponentFactoryResolver();
|
|
14366
|
-
/**
|
|
14367
|
-
* Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
|
|
14368
|
-
* ComponentFactoryResolver
|
|
14369
|
-
* already exists, retrieves the existing ComponentFactoryResolver.
|
|
14370
|
-
*
|
|
14371
|
-
* @returns The ComponentFactoryResolver instance to use
|
|
14372
|
-
*/
|
|
14373
|
-
function injectComponentFactoryResolver() {
|
|
14374
|
-
return componentFactoryResolver;
|
|
14375
|
-
}
|
|
14376
13351
|
/**
|
|
14377
13352
|
* Represents an instance of a Component created via a {@link ComponentFactory}.
|
|
14378
13353
|
*
|
|
@@ -16958,6 +15933,62 @@ function ɵɵpropertyInterpolateV(propName, values, sanitizer) {
|
|
|
16958
15933
|
return ɵɵpropertyInterpolateV;
|
|
16959
15934
|
}
|
|
16960
15935
|
|
|
15936
|
+
/**
|
|
15937
|
+
* @license
|
|
15938
|
+
* Copyright Google LLC All Rights Reserved.
|
|
15939
|
+
*
|
|
15940
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
15941
|
+
* found in the LICENSE file at https://angular.io/license
|
|
15942
|
+
*/
|
|
15943
|
+
function toTStylingRange(prev, next) {
|
|
15944
|
+
ngDevMode && assertNumberInRange(prev, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
15945
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
15946
|
+
return (prev << 17 /* StylingRange.PREV_SHIFT */ | next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
15947
|
+
}
|
|
15948
|
+
function getTStylingRangePrev(tStylingRange) {
|
|
15949
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15950
|
+
return (tStylingRange >> 17 /* StylingRange.PREV_SHIFT */) & 32767 /* StylingRange.UNSIGNED_MASK */;
|
|
15951
|
+
}
|
|
15952
|
+
function getTStylingRangePrevDuplicate(tStylingRange) {
|
|
15953
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15954
|
+
return (tStylingRange & 2 /* StylingRange.PREV_DUPLICATE */) ==
|
|
15955
|
+
2 /* StylingRange.PREV_DUPLICATE */;
|
|
15956
|
+
}
|
|
15957
|
+
function setTStylingRangePrev(tStylingRange, previous) {
|
|
15958
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15959
|
+
ngDevMode && assertNumberInRange(previous, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
15960
|
+
return ((tStylingRange & ~4294836224 /* StylingRange.PREV_MASK */) |
|
|
15961
|
+
(previous << 17 /* StylingRange.PREV_SHIFT */));
|
|
15962
|
+
}
|
|
15963
|
+
function setTStylingRangePrevDuplicate(tStylingRange) {
|
|
15964
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15965
|
+
return (tStylingRange | 2 /* StylingRange.PREV_DUPLICATE */);
|
|
15966
|
+
}
|
|
15967
|
+
function getTStylingRangeNext(tStylingRange) {
|
|
15968
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15969
|
+
return (tStylingRange & 131068 /* StylingRange.NEXT_MASK */) >> 2 /* StylingRange.NEXT_SHIFT */;
|
|
15970
|
+
}
|
|
15971
|
+
function setTStylingRangeNext(tStylingRange, next) {
|
|
15972
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15973
|
+
ngDevMode && assertNumberInRange(next, 0, 32767 /* StylingRange.UNSIGNED_MASK */);
|
|
15974
|
+
return ((tStylingRange & ~131068 /* StylingRange.NEXT_MASK */) | //
|
|
15975
|
+
next << 2 /* StylingRange.NEXT_SHIFT */);
|
|
15976
|
+
}
|
|
15977
|
+
function getTStylingRangeNextDuplicate(tStylingRange) {
|
|
15978
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15979
|
+
return (tStylingRange & 1 /* StylingRange.NEXT_DUPLICATE */) ===
|
|
15980
|
+
1 /* StylingRange.NEXT_DUPLICATE */;
|
|
15981
|
+
}
|
|
15982
|
+
function setTStylingRangeNextDuplicate(tStylingRange) {
|
|
15983
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15984
|
+
return (tStylingRange | 1 /* StylingRange.NEXT_DUPLICATE */);
|
|
15985
|
+
}
|
|
15986
|
+
function getTStylingRangeTail(tStylingRange) {
|
|
15987
|
+
ngDevMode && assertNumber(tStylingRange, 'expected number');
|
|
15988
|
+
const next = getTStylingRangeNext(tStylingRange);
|
|
15989
|
+
return next === 0 ? getTStylingRangePrev(tStylingRange) : next;
|
|
15990
|
+
}
|
|
15991
|
+
|
|
16961
15992
|
/**
|
|
16962
15993
|
* @license
|
|
16963
15994
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -20010,7 +19041,7 @@ var I18nCreateOpCode;
|
|
|
20010
19041
|
})(I18nCreateOpCode || (I18nCreateOpCode = {}));
|
|
20011
19042
|
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
20012
19043
|
// failure based on types.
|
|
20013
|
-
const unusedValueExportToPlacateAjd
|
|
19044
|
+
const unusedValueExportToPlacateAjd = 1;
|
|
20014
19045
|
|
|
20015
19046
|
/**
|
|
20016
19047
|
* @license
|
|
@@ -20779,6 +19810,46 @@ function loadIcuContainerVisitor() {
|
|
|
20779
19810
|
return icuContainerIteratorStart;
|
|
20780
19811
|
}
|
|
20781
19812
|
|
|
19813
|
+
/**
|
|
19814
|
+
* @license
|
|
19815
|
+
* Copyright Google LLC All Rights Reserved.
|
|
19816
|
+
*
|
|
19817
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
19818
|
+
* found in the LICENSE file at https://angular.io/license
|
|
19819
|
+
*/
|
|
19820
|
+
/**
|
|
19821
|
+
* Patch a `debug` property on top of the existing object.
|
|
19822
|
+
*
|
|
19823
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19824
|
+
*
|
|
19825
|
+
* @param obj Object to patch
|
|
19826
|
+
* @param debug Value to patch
|
|
19827
|
+
*/
|
|
19828
|
+
function attachDebugObject(obj, debug) {
|
|
19829
|
+
if (ngDevMode) {
|
|
19830
|
+
Object.defineProperty(obj, 'debug', { value: debug, enumerable: false });
|
|
19831
|
+
}
|
|
19832
|
+
else {
|
|
19833
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19834
|
+
}
|
|
19835
|
+
}
|
|
19836
|
+
/**
|
|
19837
|
+
* Patch a `debug` property getter on top of the existing object.
|
|
19838
|
+
*
|
|
19839
|
+
* NOTE: always call this method with `ngDevMode && attachDebugObject(...)`
|
|
19840
|
+
*
|
|
19841
|
+
* @param obj Object to patch
|
|
19842
|
+
* @param debugGetter Getter returning a value to patch
|
|
19843
|
+
*/
|
|
19844
|
+
function attachDebugGetter(obj, debugGetter) {
|
|
19845
|
+
if (ngDevMode) {
|
|
19846
|
+
Object.defineProperty(obj, 'debug', { get: debugGetter, enumerable: false });
|
|
19847
|
+
}
|
|
19848
|
+
else {
|
|
19849
|
+
throw new Error('This method should be guarded with `ngDevMode` so that it can be tree shaken in production!');
|
|
19850
|
+
}
|
|
19851
|
+
}
|
|
19852
|
+
|
|
20782
19853
|
/**
|
|
20783
19854
|
* @license
|
|
20784
19855
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -22748,32 +21819,6 @@ function sortListeners(a, b) {
|
|
|
22748
21819
|
function isDirectiveDefHack(obj) {
|
|
22749
21820
|
return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
|
|
22750
21821
|
}
|
|
22751
|
-
/**
|
|
22752
|
-
* Returns the attached `DebugNode` instance for an element in the DOM.
|
|
22753
|
-
*
|
|
22754
|
-
* @param element DOM element which is owned by an existing component's view.
|
|
22755
|
-
*/
|
|
22756
|
-
function getDebugNode(element) {
|
|
22757
|
-
if (ngDevMode && !(element instanceof Node)) {
|
|
22758
|
-
throw new Error('Expecting instance of DOM Element');
|
|
22759
|
-
}
|
|
22760
|
-
const lContext = getLContext(element);
|
|
22761
|
-
const lView = lContext ? lContext.lView : null;
|
|
22762
|
-
if (lView === null) {
|
|
22763
|
-
return null;
|
|
22764
|
-
}
|
|
22765
|
-
const nodeIndex = lContext.nodeIndex;
|
|
22766
|
-
if (nodeIndex !== -1) {
|
|
22767
|
-
const valueInLView = lView[nodeIndex];
|
|
22768
|
-
// this means that value in the lView is a component with its own
|
|
22769
|
-
// data. In this situation the TNode is not accessed at the same spot.
|
|
22770
|
-
const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
|
|
22771
|
-
ngDevMode &&
|
|
22772
|
-
assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
|
|
22773
|
-
return buildDebugNode(tNode, lView);
|
|
22774
|
-
}
|
|
22775
|
-
return null;
|
|
22776
|
-
}
|
|
22777
21822
|
/**
|
|
22778
21823
|
* Retrieve the component `LView` from component/element.
|
|
22779
21824
|
*
|
|
@@ -23994,29 +23039,6 @@ function createContainerRef(hostTNode, hostLView) {
|
|
|
23994
23039
|
* Use of this source code is governed by an MIT-style license that can be
|
|
23995
23040
|
* found in the LICENSE file at https://angular.io/license
|
|
23996
23041
|
*/
|
|
23997
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
23998
|
-
// failure based on types.
|
|
23999
|
-
const unusedValueExportToPlacateAjd$1 = 1;
|
|
24000
|
-
|
|
24001
|
-
/**
|
|
24002
|
-
* @license
|
|
24003
|
-
* Copyright Google LLC All Rights Reserved.
|
|
24004
|
-
*
|
|
24005
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
24006
|
-
* found in the LICENSE file at https://angular.io/license
|
|
24007
|
-
*/
|
|
24008
|
-
// Note: This hack is necessary so we don't erroneously get a circular dependency
|
|
24009
|
-
// failure based on types.
|
|
24010
|
-
const unusedValueExportToPlacateAjd = 1;
|
|
24011
|
-
|
|
24012
|
-
/**
|
|
24013
|
-
* @license
|
|
24014
|
-
* Copyright Google LLC All Rights Reserved.
|
|
24015
|
-
*
|
|
24016
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
24017
|
-
* found in the LICENSE file at https://angular.io/license
|
|
24018
|
-
*/
|
|
24019
|
-
const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
|
|
24020
23042
|
class LQuery_ {
|
|
24021
23043
|
constructor(queryList) {
|
|
24022
23044
|
this.queryList = queryList;
|