@angular/core 10.0.0 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/core-testing.umd.js +321 -272
- package/bundles/core-testing.umd.js.map +1 -1
- package/bundles/core-testing.umd.min.js +11 -25
- package/bundles/core-testing.umd.min.js.map +1 -1
- package/bundles/core.umd.js +620 -832
- package/bundles/core.umd.js.map +1 -1
- package/bundles/core.umd.min.js +128 -282
- package/bundles/core.umd.min.js.map +1 -1
- package/core.d.ts +69 -65
- package/core.metadata.json +1 -1
- package/esm2015/src/application_init.js +9 -5
- package/esm2015/src/application_tokens.js +16 -12
- package/esm2015/src/change_detection/change_detector_ref.js +6 -3
- package/esm2015/src/change_detection/constants.js +3 -1
- package/esm2015/src/di/injectable.js +1 -1
- package/esm2015/src/di/metadata.js +2 -2
- package/esm2015/src/interface/type.js +2 -2
- package/esm2015/src/linker/ng_module_factory.js +3 -5
- package/esm2015/src/linker/view_ref.js +3 -6
- package/esm2015/src/metadata/directives.js +1 -1
- package/esm2015/src/metadata/ng_module.js +1 -1
- package/esm2015/src/render3/component_ref.js +4 -13
- package/esm2015/src/render3/di.js +12 -4
- package/esm2015/src/render3/i18n.js +3 -3
- package/esm2015/src/render3/instructions/di.js +1 -1
- package/esm2015/src/render3/instructions/listener.js +2 -2
- package/esm2015/src/render3/instructions/shared.js +8 -18
- package/esm2015/src/render3/node_assert.js +3 -3
- package/esm2015/src/render3/node_manipulation.js +11 -7
- package/esm2015/src/render3/query.js +2 -2
- package/esm2015/src/render3/view_engine_compatibility.js +2 -2
- package/esm2015/src/render3/view_ref.js +7 -5
- package/esm2015/src/sanitization/html_sanitizer.js +3 -3
- package/esm2015/src/sanitization/inert_body.js +39 -82
- package/esm2015/src/util/ng_dev_mode.js +2 -2
- package/esm2015/src/version.js +1 -1
- package/esm2015/testing/src/fake_async_fallback.js +5 -1
- package/esm2015/testing/src/r3_test_bed.js +2 -2
- package/fesm2015/core.js +118 -159
- package/fesm2015/core.js.map +1 -1
- package/fesm2015/testing.js +6 -2
- package/fesm2015/testing.js.map +1 -1
- package/package.json +1 -1
- package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.d.ts +7 -0
- package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.js +125 -59
- package/src/r3_symbols.d.ts +15 -17
- package/testing/testing.d.ts +1 -1
- package/testing.d.ts +1 -1
- package/esm2015/src/util/WrappedValue.js +0 -48
package/fesm2015/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v10.0.
|
|
2
|
+
* @license Angular v10.0.4
|
|
3
3
|
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -177,7 +177,7 @@ const Optional = makeParamDecorator('Optional');
|
|
|
177
177
|
*/
|
|
178
178
|
const Self = makeParamDecorator('Self');
|
|
179
179
|
/**
|
|
180
|
-
* SkipSelf decorator and metadata.
|
|
180
|
+
* `SkipSelf` decorator and metadata.
|
|
181
181
|
*
|
|
182
182
|
* @Annotation
|
|
183
183
|
* @publicApi
|
|
@@ -638,7 +638,7 @@ function ngDevModeResetPerfCounters() {
|
|
|
638
638
|
* (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode
|
|
639
639
|
* is defined for the entire instruction set.
|
|
640
640
|
*
|
|
641
|
-
* When
|
|
641
|
+
* When checking `ngDevMode` on toplevel, always init it before referencing it
|
|
642
642
|
* (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can
|
|
643
643
|
* get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.
|
|
644
644
|
*
|
|
@@ -989,10 +989,8 @@ function getFactoryOf(type) {
|
|
|
989
989
|
* found in the LICENSE file at https://angular.io/license
|
|
990
990
|
*/
|
|
991
991
|
/**
|
|
992
|
-
* Represents an instance of an NgModule created
|
|
993
|
-
*
|
|
994
|
-
* `NgModuleRef` provides access to the NgModule Instance as well other objects related to this
|
|
995
|
-
* NgModule Instance.
|
|
992
|
+
* Represents an instance of an `NgModule` created by an `NgModuleFactory`.
|
|
993
|
+
* Provides access to the `NgModule` instance and related objects.
|
|
996
994
|
*
|
|
997
995
|
* @publicApi
|
|
998
996
|
*/
|
|
@@ -1410,6 +1408,8 @@ function _arrayIndexOfSorted(array, value, shift) {
|
|
|
1410
1408
|
* The strategy that the default change detector uses to detect changes.
|
|
1411
1409
|
* When set, takes effect the next time change detection is triggered.
|
|
1412
1410
|
*
|
|
1411
|
+
* @see {@link ChangeDetectorRef#usage-notes Change detection usage}
|
|
1412
|
+
*
|
|
1413
1413
|
* @publicApi
|
|
1414
1414
|
*/
|
|
1415
1415
|
var ChangeDetectionStrategy;
|
|
@@ -3070,10 +3070,10 @@ function assertNodeType(tNode, type) {
|
|
|
3070
3070
|
assertDefined(tNode, 'should be called with a TNode');
|
|
3071
3071
|
assertEqual(tNode.type, type, `should be a ${typeName(type)}`);
|
|
3072
3072
|
}
|
|
3073
|
-
function assertNodeOfPossibleTypes(tNode,
|
|
3073
|
+
function assertNodeOfPossibleTypes(tNode, types, message) {
|
|
3074
3074
|
assertDefined(tNode, 'should be called with a TNode');
|
|
3075
3075
|
const found = types.some(type => tNode.type === type);
|
|
3076
|
-
assertEqual(found, true, `Should be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`);
|
|
3076
|
+
assertEqual(found, true, message !== null && message !== void 0 ? message : `Should be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`);
|
|
3077
3077
|
}
|
|
3078
3078
|
function assertNodeNotOfTypes(tNode, types, message) {
|
|
3079
3079
|
assertDefined(tNode, 'should be called with a TNode');
|
|
@@ -3497,7 +3497,13 @@ let nextNgElementId = 0;
|
|
|
3497
3497
|
*/
|
|
3498
3498
|
function bloomAdd(injectorIndex, tView, type) {
|
|
3499
3499
|
ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');
|
|
3500
|
-
let id
|
|
3500
|
+
let id;
|
|
3501
|
+
if (typeof type === 'string') {
|
|
3502
|
+
id = type.charCodeAt(0) || 0;
|
|
3503
|
+
}
|
|
3504
|
+
else if (type.hasOwnProperty(NG_ELEMENT_ID)) {
|
|
3505
|
+
id = type[NG_ELEMENT_ID];
|
|
3506
|
+
}
|
|
3501
3507
|
// Set a unique ID on the directive type, so if something tries to inject the directive,
|
|
3502
3508
|
// we can easily retrieve the ID and hash it into the bloom bit that should be checked.
|
|
3503
3509
|
if (id == null) {
|
|
@@ -3645,7 +3651,7 @@ function diPublicInInjector(injectorIndex, tView, token) {
|
|
|
3645
3651
|
*/
|
|
3646
3652
|
function injectAttributeImpl(tNode, attrNameToInject) {
|
|
3647
3653
|
ngDevMode &&
|
|
3648
|
-
assertNodeOfPossibleTypes(tNode, 0 /* Container */, 3 /* Element */, 4 /* ElementContainer */);
|
|
3654
|
+
assertNodeOfPossibleTypes(tNode, [0 /* Container */, 3 /* Element */, 4 /* ElementContainer */]);
|
|
3649
3655
|
ngDevMode && assertDefined(tNode, 'expecting tNode');
|
|
3650
3656
|
if (attrNameToInject === 'class') {
|
|
3651
3657
|
return tNode.classes;
|
|
@@ -3943,7 +3949,9 @@ function bloomHashBitOrFactory(token) {
|
|
|
3943
3949
|
if (typeof token === 'string') {
|
|
3944
3950
|
return token.charCodeAt(0) || 0;
|
|
3945
3951
|
}
|
|
3946
|
-
const tokenId =
|
|
3952
|
+
const tokenId =
|
|
3953
|
+
// First check with `hasOwnProperty` so we don't get an inherited ID.
|
|
3954
|
+
token.hasOwnProperty(NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;
|
|
3947
3955
|
// Negative token IDs are used for special objects such as `Injector`
|
|
3948
3956
|
return (typeof tokenId === 'number' && tokenId > 0) ? tokenId & BLOOM_MASK : tokenId;
|
|
3949
3957
|
}
|
|
@@ -4342,77 +4350,21 @@ function enableProdMode() {
|
|
|
4342
4350
|
* found in the LICENSE file at https://angular.io/license
|
|
4343
4351
|
*/
|
|
4344
4352
|
/**
|
|
4345
|
-
* This helper
|
|
4353
|
+
* This helper is used to get hold of an inert tree of DOM elements containing dirty HTML
|
|
4346
4354
|
* that needs sanitizing.
|
|
4347
|
-
* Depending upon browser support we
|
|
4348
|
-
*
|
|
4349
|
-
*
|
|
4350
|
-
* Default: InertDocument strategy
|
|
4355
|
+
* Depending upon browser support we use one of two strategies for doing this.
|
|
4356
|
+
* Default: DOMParser strategy
|
|
4357
|
+
* Fallback: InertDocument strategy
|
|
4351
4358
|
*/
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
this.inertDocument.appendChild(inertHtml);
|
|
4362
|
-
inertBodyElement = this.inertDocument.createElement('body');
|
|
4363
|
-
inertHtml.appendChild(inertBodyElement);
|
|
4364
|
-
}
|
|
4365
|
-
inertBodyElement.innerHTML = '<svg><g onload="this.parentNode.remove()"></g></svg>';
|
|
4366
|
-
if (inertBodyElement.querySelector && !inertBodyElement.querySelector('svg')) {
|
|
4367
|
-
// We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element
|
|
4368
|
-
// so use the XHR strategy.
|
|
4369
|
-
this.getInertBodyElement = this.getInertBodyElement_XHR;
|
|
4370
|
-
return;
|
|
4371
|
-
}
|
|
4372
|
-
inertBodyElement.innerHTML = '<svg><p><style><img src="</style><img src=x onerror=alert(1)//">';
|
|
4373
|
-
if (inertBodyElement.querySelector && inertBodyElement.querySelector('svg img')) {
|
|
4374
|
-
// We just hit the Firefox bug - which prevents the inner img JS from being sanitized
|
|
4375
|
-
// so use the DOMParser strategy, if it is available.
|
|
4376
|
-
// If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we
|
|
4377
|
-
// fall through to the default strategy below.
|
|
4378
|
-
if (isDOMParserAvailable()) {
|
|
4379
|
-
this.getInertBodyElement = this.getInertBodyElement_DOMParser;
|
|
4380
|
-
return;
|
|
4381
|
-
}
|
|
4382
|
-
}
|
|
4383
|
-
// None of the bugs were hit so it is safe for us to use the default InertDocument strategy
|
|
4384
|
-
this.getInertBodyElement = this.getInertBodyElement_InertDocument;
|
|
4385
|
-
}
|
|
4386
|
-
/**
|
|
4387
|
-
* Use XHR to create and fill an inert body element (on Safari 10.1)
|
|
4388
|
-
* See
|
|
4389
|
-
* https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449
|
|
4390
|
-
*/
|
|
4391
|
-
getInertBodyElement_XHR(html) {
|
|
4392
|
-
// We add these extra elements to ensure that the rest of the content is parsed as expected
|
|
4393
|
-
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
|
|
4394
|
-
// `<head>` tag.
|
|
4395
|
-
html = '<body><remove></remove>' + html + '</body>';
|
|
4396
|
-
try {
|
|
4397
|
-
html = encodeURI(html);
|
|
4398
|
-
}
|
|
4399
|
-
catch (_a) {
|
|
4400
|
-
return null;
|
|
4401
|
-
}
|
|
4402
|
-
const xhr = new XMLHttpRequest();
|
|
4403
|
-
xhr.responseType = 'document';
|
|
4404
|
-
xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);
|
|
4405
|
-
xhr.send(undefined);
|
|
4406
|
-
const body = xhr.response.body;
|
|
4407
|
-
body.removeChild(body.firstChild);
|
|
4408
|
-
return body;
|
|
4409
|
-
}
|
|
4410
|
-
/**
|
|
4411
|
-
* Use DOMParser to create and fill an inert body element (on Firefox)
|
|
4412
|
-
* See https://github.com/cure53/DOMPurify/releases/tag/0.6.7
|
|
4413
|
-
*
|
|
4414
|
-
*/
|
|
4415
|
-
getInertBodyElement_DOMParser(html) {
|
|
4359
|
+
function getInertBodyHelper(defaultDoc) {
|
|
4360
|
+
return isDOMParserAvailable() ? new DOMParserHelper() : new InertDocumentHelper(defaultDoc);
|
|
4361
|
+
}
|
|
4362
|
+
/**
|
|
4363
|
+
* Uses DOMParser to create and fill an inert body element.
|
|
4364
|
+
* This is the default strategy used in browsers that support it.
|
|
4365
|
+
*/
|
|
4366
|
+
class DOMParserHelper {
|
|
4367
|
+
getInertBodyElement(html) {
|
|
4416
4368
|
// We add these extra elements to ensure that the rest of the content is parsed as expected
|
|
4417
4369
|
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
|
|
4418
4370
|
// `<head>` tag.
|
|
@@ -4426,13 +4378,26 @@ class InertBodyHelper {
|
|
|
4426
4378
|
return null;
|
|
4427
4379
|
}
|
|
4428
4380
|
}
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4381
|
+
}
|
|
4382
|
+
/**
|
|
4383
|
+
* Use an HTML5 `template` element, if supported, or an inert body element created via
|
|
4384
|
+
* `createHtmlDocument` to create and fill an inert DOM element.
|
|
4385
|
+
* This is the fallback strategy if the browser does not support DOMParser.
|
|
4386
|
+
*/
|
|
4387
|
+
class InertDocumentHelper {
|
|
4388
|
+
constructor(defaultDoc) {
|
|
4389
|
+
this.defaultDoc = defaultDoc;
|
|
4390
|
+
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
|
|
4391
|
+
if (this.inertDocument.body == null) {
|
|
4392
|
+
// usually there should be only one body element in the document, but IE doesn't have any, so
|
|
4393
|
+
// we need to create one.
|
|
4394
|
+
const inertHtml = this.inertDocument.createElement('html');
|
|
4395
|
+
this.inertDocument.appendChild(inertHtml);
|
|
4396
|
+
const inertBodyElement = this.inertDocument.createElement('body');
|
|
4397
|
+
inertHtml.appendChild(inertBodyElement);
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
getInertBodyElement(html) {
|
|
4436
4401
|
// Prefer using <template> element if supported.
|
|
4437
4402
|
const templateEl = this.inertDocument.createElement('template');
|
|
4438
4403
|
if ('content' in templateEl) {
|
|
@@ -4482,15 +4447,15 @@ class InertBodyHelper {
|
|
|
4482
4447
|
}
|
|
4483
4448
|
}
|
|
4484
4449
|
/**
|
|
4485
|
-
* We need to determine whether the DOMParser exists in the global context
|
|
4486
|
-
*
|
|
4487
|
-
*
|
|
4450
|
+
* We need to determine whether the DOMParser exists in the global context and
|
|
4451
|
+
* supports parsing HTML; HTML parsing support is not as wide as other formats, see
|
|
4452
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Browser_compatibility.
|
|
4488
4453
|
*
|
|
4489
4454
|
* @suppress {uselessCode}
|
|
4490
4455
|
*/
|
|
4491
4456
|
function isDOMParserAvailable() {
|
|
4492
4457
|
try {
|
|
4493
|
-
return !!window.DOMParser;
|
|
4458
|
+
return !!new window.DOMParser().parseFromString('', 'text/html');
|
|
4494
4459
|
}
|
|
4495
4460
|
catch (_a) {
|
|
4496
4461
|
return false;
|
|
@@ -4756,7 +4721,7 @@ let inertBodyHelper;
|
|
|
4756
4721
|
function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
|
|
4757
4722
|
let inertBodyElement = null;
|
|
4758
4723
|
try {
|
|
4759
|
-
inertBodyHelper = inertBodyHelper ||
|
|
4724
|
+
inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);
|
|
4760
4725
|
// Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).
|
|
4761
4726
|
let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';
|
|
4762
4727
|
inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
|
|
@@ -7110,7 +7075,7 @@ function assignTViewNodeToLView(tView, tParentNode, index, lView) {
|
|
|
7110
7075
|
let tNode = tView.node;
|
|
7111
7076
|
if (tNode == null) {
|
|
7112
7077
|
ngDevMode && tParentNode &&
|
|
7113
|
-
assertNodeOfPossibleTypes(tParentNode, 3 /* Element */, 0 /* Container */);
|
|
7078
|
+
assertNodeOfPossibleTypes(tParentNode, [3 /* Element */, 0 /* Container */]);
|
|
7114
7079
|
tView.node = tNode = createTNode(tView, tParentNode, //
|
|
7115
7080
|
2 /* View */, index, null, null);
|
|
7116
7081
|
}
|
|
@@ -7572,20 +7537,6 @@ function storeCleanupWithContext(tView, lView, context, cleanupFn) {
|
|
|
7572
7537
|
getTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);
|
|
7573
7538
|
}
|
|
7574
7539
|
}
|
|
7575
|
-
/**
|
|
7576
|
-
* Saves the cleanup function itself in LView.cleanupInstances.
|
|
7577
|
-
*
|
|
7578
|
-
* This is necessary for functions that are wrapped with their contexts, like in renderer2
|
|
7579
|
-
* listeners.
|
|
7580
|
-
*
|
|
7581
|
-
* On the first template pass, the index of the cleanup function is saved in TView.
|
|
7582
|
-
*/
|
|
7583
|
-
function storeCleanupFn(tView, lView, cleanupFn) {
|
|
7584
|
-
getLCleanup(lView).push(cleanupFn);
|
|
7585
|
-
if (tView.firstCreatePass) {
|
|
7586
|
-
getTViewCleanup(tView).push(lView[CLEANUP].length - 1, null);
|
|
7587
|
-
}
|
|
7588
|
-
}
|
|
7589
7540
|
/**
|
|
7590
7541
|
* Constructs a TNode object from the arguments.
|
|
7591
7542
|
*
|
|
@@ -8016,7 +7967,7 @@ function instantiateAllDirectives(tView, lView, tNode, native) {
|
|
|
8016
7967
|
const def = tView.data[i];
|
|
8017
7968
|
const isComponent = isComponentDef(def);
|
|
8018
7969
|
if (isComponent) {
|
|
8019
|
-
ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */);
|
|
7970
|
+
ngDevMode && assertNodeOfPossibleTypes(tNode, [3 /* Element */]);
|
|
8020
7971
|
addComponentLogic(lView, tNode, def);
|
|
8021
7972
|
}
|
|
8022
7973
|
const directive = getNodeInjectable(lView, tView, i, tNode);
|
|
@@ -8092,7 +8043,7 @@ function generateExpandoInstructionBlock(tView, tNode, directiveCount) {
|
|
|
8092
8043
|
function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
8093
8044
|
ngDevMode && assertFirstCreatePass(tView);
|
|
8094
8045
|
ngDevMode &&
|
|
8095
|
-
assertNodeOfPossibleTypes(tNode, 3 /* Element */, 4 /* ElementContainer */, 0 /* Container */);
|
|
8046
|
+
assertNodeOfPossibleTypes(tNode, [3 /* Element */, 4 /* ElementContainer */, 0 /* Container */]);
|
|
8096
8047
|
const registry = tView.directiveRegistry;
|
|
8097
8048
|
let matches = null;
|
|
8098
8049
|
if (registry) {
|
|
@@ -8102,6 +8053,9 @@ function findDirectiveDefMatches(tView, viewData, tNode) {
|
|
|
8102
8053
|
matches || (matches = ngDevMode ? new MatchesArray() : []);
|
|
8103
8054
|
diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);
|
|
8104
8055
|
if (isComponentDef(def)) {
|
|
8056
|
+
ngDevMode &&
|
|
8057
|
+
assertNodeOfPossibleTypes(tNode, [3 /* Element */], `"${tNode.tagName}" tags cannot be used as component hosts. ` +
|
|
8058
|
+
`Please use a different tag to activate the ${stringify(def.type)} component.`);
|
|
8105
8059
|
if (tNode.flags & 2 /* isComponentHost */)
|
|
8106
8060
|
throwMultipleComponentError(tNode);
|
|
8107
8061
|
markAsComponentHost(tView, tNode);
|
|
@@ -9183,7 +9137,7 @@ function getRenderParent(tView, tNode, currentView) {
|
|
|
9183
9137
|
else {
|
|
9184
9138
|
// We are inserting a root element of the component view into the component host element and
|
|
9185
9139
|
// it should always be eager.
|
|
9186
|
-
ngDevMode && assertNodeOfPossibleTypes(hostTNode, 3 /* Element */);
|
|
9140
|
+
ngDevMode && assertNodeOfPossibleTypes(hostTNode, [3 /* Element */]);
|
|
9187
9141
|
return currentView[HOST];
|
|
9188
9142
|
}
|
|
9189
9143
|
}
|
|
@@ -9320,8 +9274,10 @@ function appendChild(tView, lView, childEl, childTNode) {
|
|
|
9320
9274
|
*/
|
|
9321
9275
|
function getFirstNativeNode(lView, tNode) {
|
|
9322
9276
|
if (tNode !== null) {
|
|
9323
|
-
ngDevMode &&
|
|
9324
|
-
|
|
9277
|
+
ngDevMode && assertNodeOfPossibleTypes(tNode, [
|
|
9278
|
+
3 /* Element */, 0 /* Container */, 4 /* ElementContainer */, 5 /* IcuContainer */,
|
|
9279
|
+
1 /* Projection */
|
|
9280
|
+
]);
|
|
9325
9281
|
const tNodeType = tNode.type;
|
|
9326
9282
|
if (tNodeType === 3 /* Element */) {
|
|
9327
9283
|
return getNativeByTNode(tNode, lView);
|
|
@@ -9392,8 +9348,10 @@ function nativeRemoveNode(renderer, rNode, isHostElement) {
|
|
|
9392
9348
|
function applyNodes(renderer, action, tNode, lView, renderParent, beforeNode, isProjection) {
|
|
9393
9349
|
while (tNode != null) {
|
|
9394
9350
|
ngDevMode && assertTNodeForLView(tNode, lView);
|
|
9395
|
-
ngDevMode &&
|
|
9396
|
-
|
|
9351
|
+
ngDevMode && assertNodeOfPossibleTypes(tNode, [
|
|
9352
|
+
0 /* Container */, 3 /* Element */, 4 /* ElementContainer */, 1 /* Projection */,
|
|
9353
|
+
5 /* IcuContainer */
|
|
9354
|
+
]);
|
|
9397
9355
|
const rawSlotValue = lView[tNode.index];
|
|
9398
9356
|
const tNodeType = tNode.type;
|
|
9399
9357
|
if (isProjection) {
|
|
@@ -9411,7 +9369,7 @@ function applyNodes(renderer, action, tNode, lView, renderParent, beforeNode, is
|
|
|
9411
9369
|
applyProjectionRecursive(renderer, action, lView, tNode, renderParent, beforeNode);
|
|
9412
9370
|
}
|
|
9413
9371
|
else {
|
|
9414
|
-
ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */);
|
|
9372
|
+
ngDevMode && assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */]);
|
|
9415
9373
|
applyToElementOrContainer(action, renderer, renderParent, rawSlotValue, beforeNode);
|
|
9416
9374
|
}
|
|
9417
9375
|
}
|
|
@@ -9746,7 +9704,7 @@ class ViewRef {
|
|
|
9746
9704
|
destroyLView(this._lView[TVIEW], this._lView);
|
|
9747
9705
|
}
|
|
9748
9706
|
onDestroy(callback) {
|
|
9749
|
-
|
|
9707
|
+
storeCleanupWithContext(this._lView[TVIEW], this._lView, null, callback);
|
|
9750
9708
|
}
|
|
9751
9709
|
/**
|
|
9752
9710
|
* Marks a view and all of its ancestors dirty.
|
|
@@ -9968,8 +9926,10 @@ class RootViewRef extends ViewRef {
|
|
|
9968
9926
|
}
|
|
9969
9927
|
function collectNativeNodes(tView, lView, tNode, result, isProjection = false) {
|
|
9970
9928
|
while (tNode !== null) {
|
|
9971
|
-
ngDevMode &&
|
|
9972
|
-
|
|
9929
|
+
ngDevMode && assertNodeOfPossibleTypes(tNode, [
|
|
9930
|
+
3 /* Element */, 0 /* Container */, 1 /* Projection */, 4 /* ElementContainer */,
|
|
9931
|
+
5 /* IcuContainer */
|
|
9932
|
+
]);
|
|
9973
9933
|
const lNode = lView[tNode.index];
|
|
9974
9934
|
if (lNode !== null) {
|
|
9975
9935
|
result.push(unwrapRNode(lNode));
|
|
@@ -10245,7 +10205,7 @@ function createContainerRef(ViewContainerRefToken, ElementRefToken, hostTNode, h
|
|
|
10245
10205
|
};
|
|
10246
10206
|
}
|
|
10247
10207
|
ngDevMode &&
|
|
10248
|
-
assertNodeOfPossibleTypes(hostTNode, 0 /* Container */, 3 /* Element */, 4 /* ElementContainer */);
|
|
10208
|
+
assertNodeOfPossibleTypes(hostTNode, [0 /* Container */, 3 /* Element */, 4 /* ElementContainer */]);
|
|
10249
10209
|
let lContainer;
|
|
10250
10210
|
const slotValue = hostView[hostTNode.index];
|
|
10251
10211
|
if (isLContainer(slotValue)) {
|
|
@@ -10344,10 +10304,13 @@ function injectRenderer2() {
|
|
|
10344
10304
|
* found in the LICENSE file at https://angular.io/license
|
|
10345
10305
|
*/
|
|
10346
10306
|
/**
|
|
10347
|
-
* Base class
|
|
10307
|
+
* Base class that provides change detection functionality.
|
|
10348
10308
|
* A change-detection tree collects all views that are to be checked for changes.
|
|
10349
10309
|
* Use the methods to add and remove views from the tree, initiate change-detection,
|
|
10350
|
-
* and explicitly mark views as _dirty_, meaning that they have changed and need to be
|
|
10310
|
+
* and explicitly mark views as _dirty_, meaning that they have changed and need to be re-rendered.
|
|
10311
|
+
*
|
|
10312
|
+
* @see [Using change detection hooks](guide/lifecycle-hooks#using-change-detection-hooks)
|
|
10313
|
+
* @see [Defining custom change detection](guide/lifecycle-hooks#defining-custom-change-detection)
|
|
10351
10314
|
*
|
|
10352
10315
|
* @usageNotes
|
|
10353
10316
|
*
|
|
@@ -10409,7 +10372,7 @@ const SWITCH_CHANGE_DETECTOR_REF_FACTORY = SWITCH_CHANGE_DETECTOR_REF_FACTORY__P
|
|
|
10409
10372
|
*
|
|
10410
10373
|
* Represents a type that a Component or other object is instances of.
|
|
10411
10374
|
*
|
|
10412
|
-
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is
|
|
10375
|
+
* An example of a `Type` is `MyCustomComponent` class, which in JavaScript is represented by
|
|
10413
10376
|
* the `MyCustomComponent` constructor function.
|
|
10414
10377
|
*
|
|
10415
10378
|
* @publicApi
|
|
@@ -14241,7 +14204,7 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
|
|
|
14241
14204
|
// register a listener and store its cleanup function on LView.
|
|
14242
14205
|
const lCleanup = getLCleanup(lView);
|
|
14243
14206
|
ngDevMode &&
|
|
14244
|
-
assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);
|
|
14207
|
+
assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */, 4 /* ElementContainer */]);
|
|
14245
14208
|
let processOutputs = true;
|
|
14246
14209
|
// add native event listener - applicable to elements only
|
|
14247
14210
|
if (tNode.type === 3 /* Element */) {
|
|
@@ -19346,7 +19309,7 @@ class Version {
|
|
|
19346
19309
|
/**
|
|
19347
19310
|
* @publicApi
|
|
19348
19311
|
*/
|
|
19349
|
-
const VERSION = new Version('10.0.
|
|
19312
|
+
const VERSION = new Version('10.0.4');
|
|
19350
19313
|
|
|
19351
19314
|
/**
|
|
19352
19315
|
* @license
|
|
@@ -22277,12 +22240,6 @@ class ComponentFactory$1 extends ComponentFactory {
|
|
|
22277
22240
|
elementCreate(elementName, rendererFactory.createRenderer(null, this.componentDef), getNamespace$1(elementName));
|
|
22278
22241
|
const rootFlags = this.componentDef.onPush ? 64 /* Dirty */ | 512 /* IsRoot */ :
|
|
22279
22242
|
16 /* CheckAlways */ | 512 /* IsRoot */;
|
|
22280
|
-
// Check whether this Component needs to be isolated from other components, i.e. whether it
|
|
22281
|
-
// should be placed into its own (empty) root context or existing root context should be used.
|
|
22282
|
-
// Note: this is internal-only convention and might change in the future, so it should not be
|
|
22283
|
-
// relied upon externally.
|
|
22284
|
-
const isIsolated = typeof rootSelectorOrNode === 'string' &&
|
|
22285
|
-
/^#root-ng-internal-isolated-\d+/.test(rootSelectorOrNode);
|
|
22286
22243
|
const rootContext = createRootContext();
|
|
22287
22244
|
// Create the root view. Uses empty TView and ContentTemplate.
|
|
22288
22245
|
const rootTView = createTView(0 /* Root */, -1, null, 1, 0, null, null, null, null, null);
|
|
@@ -22337,12 +22294,9 @@ class ComponentFactory$1 extends ComponentFactory {
|
|
|
22337
22294
|
leaveView();
|
|
22338
22295
|
}
|
|
22339
22296
|
const componentRef = new ComponentRef$1(this.componentType, component, createElementRef(ElementRef, tElementNode, rootLView), rootLView, tElementNode);
|
|
22340
|
-
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
ngDevMode && assertNodeOfPossibleTypes(rootTView.node, 2 /* View */);
|
|
22344
|
-
rootTView.node.child = tElementNode;
|
|
22345
|
-
}
|
|
22297
|
+
// The host element of the internal root view is attached to the component's host view node.
|
|
22298
|
+
ngDevMode && assertNodeOfPossibleTypes(rootTView.node, [2 /* View */]);
|
|
22299
|
+
rootTView.node.child = tElementNode;
|
|
22346
22300
|
return componentRef;
|
|
22347
22301
|
}
|
|
22348
22302
|
}
|
|
@@ -23670,7 +23624,7 @@ function icuStart(tIcus, icuExpression, startIndex, expandoStartIndex) {
|
|
|
23670
23624
|
* @param expandoStartIndex
|
|
23671
23625
|
*/
|
|
23672
23626
|
function parseIcuCase(unsafeHtml, parentIndex, nestedIcus, tIcus, expandoStartIndex) {
|
|
23673
|
-
const inertBodyHelper =
|
|
23627
|
+
const inertBodyHelper = getInertBodyHelper(getDocument());
|
|
23674
23628
|
const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);
|
|
23675
23629
|
if (!inertBodyElement) {
|
|
23676
23630
|
throw new Error('Unable to generate inert body element');
|
|
@@ -25059,7 +25013,7 @@ function createSpecialToken(lView, tNode, read) {
|
|
|
25059
25013
|
}
|
|
25060
25014
|
else if (read === ViewContainerRef) {
|
|
25061
25015
|
ngDevMode &&
|
|
25062
|
-
assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);
|
|
25016
|
+
assertNodeOfPossibleTypes(tNode, [3 /* Element */, 0 /* Container */, 4 /* ElementContainer */]);
|
|
25063
25017
|
return createContainerRef(ViewContainerRef, ElementRef, tNode, lView);
|
|
25064
25018
|
}
|
|
25065
25019
|
else {
|
|
@@ -26439,21 +26393,25 @@ const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;
|
|
|
26439
26393
|
* found in the LICENSE file at https://angular.io/license
|
|
26440
26394
|
*/
|
|
26441
26395
|
/**
|
|
26442
|
-
*
|
|
26443
|
-
*
|
|
26396
|
+
* A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
|
|
26397
|
+
* one or more initialization functions.
|
|
26398
|
+
*
|
|
26399
|
+
* The provided function are injected at application startup and executed during
|
|
26444
26400
|
* app initialization. If any of these functions returns a Promise, initialization
|
|
26445
26401
|
* does not complete until the Promise is resolved.
|
|
26446
26402
|
*
|
|
26447
26403
|
* You can, for example, create a factory function that loads language data
|
|
26448
26404
|
* or an external configuration, and provide that function to the `APP_INITIALIZER` token.
|
|
26449
|
-
*
|
|
26405
|
+
* The function is executed during the application bootstrap process,
|
|
26450
26406
|
* and the needed data is available on startup.
|
|
26451
26407
|
*
|
|
26408
|
+
* @see `ApplicationInitStatus`
|
|
26409
|
+
*
|
|
26452
26410
|
* @publicApi
|
|
26453
26411
|
*/
|
|
26454
26412
|
const APP_INITIALIZER = new InjectionToken('Application Initializer');
|
|
26455
26413
|
/**
|
|
26456
|
-
* A class that reflects the state of running {@link APP_INITIALIZER}
|
|
26414
|
+
* A class that reflects the state of running {@link APP_INITIALIZER} functions.
|
|
26457
26415
|
*
|
|
26458
26416
|
* @publicApi
|
|
26459
26417
|
*/
|
|
@@ -26513,13 +26471,14 @@ ApplicationInitStatus.ctorParameters = () => [
|
|
|
26513
26471
|
* found in the LICENSE file at https://angular.io/license
|
|
26514
26472
|
*/
|
|
26515
26473
|
/**
|
|
26516
|
-
* A DI
|
|
26474
|
+
* A [DI token](guide/glossary#di-token "DI token definition") representing a unique string ID, used
|
|
26517
26475
|
* primarily for prefixing application attributes and CSS styles when
|
|
26518
26476
|
* {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.
|
|
26519
26477
|
*
|
|
26520
|
-
*
|
|
26521
|
-
* a custom value
|
|
26522
|
-
*
|
|
26478
|
+
* BY default, the value is randomly generated and assigned to the application by Angular.
|
|
26479
|
+
* To provide a custom ID value, use a DI provider <!-- TODO: provider --> to configure
|
|
26480
|
+
* the root {@link Injector} that uses this token.
|
|
26481
|
+
*
|
|
26523
26482
|
* @publicApi
|
|
26524
26483
|
*/
|
|
26525
26484
|
const APP_ID = new InjectionToken('AppId');
|
|
@@ -26527,7 +26486,7 @@ function _appIdRandomProviderFactory() {
|
|
|
26527
26486
|
return `${_randomChar()}${_randomChar()}${_randomChar()}`;
|
|
26528
26487
|
}
|
|
26529
26488
|
/**
|
|
26530
|
-
* Providers that
|
|
26489
|
+
* Providers that generate a random `APP_ID_TOKEN`.
|
|
26531
26490
|
* @publicApi
|
|
26532
26491
|
*/
|
|
26533
26492
|
const APP_ID_RANDOM_PROVIDER = {
|
|
@@ -26539,26 +26498,29 @@ function _randomChar() {
|
|
|
26539
26498
|
return String.fromCharCode(97 + Math.floor(Math.random() * 25));
|
|
26540
26499
|
}
|
|
26541
26500
|
/**
|
|
26542
|
-
* A function that
|
|
26501
|
+
* A function that is executed when a platform is initialized.
|
|
26543
26502
|
* @publicApi
|
|
26544
26503
|
*/
|
|
26545
26504
|
const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
|
|
26546
26505
|
/**
|
|
26547
|
-
* A token that indicates an opaque platform
|
|
26506
|
+
* A token that indicates an opaque platform ID.
|
|
26548
26507
|
* @publicApi
|
|
26549
26508
|
*/
|
|
26550
26509
|
const PLATFORM_ID = new InjectionToken('Platform ID');
|
|
26551
26510
|
/**
|
|
26552
|
-
*
|
|
26553
|
-
*
|
|
26511
|
+
* A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
|
|
26512
|
+
* be called for every component that is bootstrapped.
|
|
26554
26513
|
*
|
|
26555
|
-
* `
|
|
26514
|
+
* Each callback must take a `ComponentRef` instance and return nothing.
|
|
26515
|
+
*
|
|
26516
|
+
* `(componentRef: ComponentRef) => void`
|
|
26556
26517
|
*
|
|
26557
26518
|
* @publicApi
|
|
26558
26519
|
*/
|
|
26559
26520
|
const APP_BOOTSTRAP_LISTENER = new InjectionToken('appBootstrapListener');
|
|
26560
26521
|
/**
|
|
26561
|
-
* A token
|
|
26522
|
+
* A [DI token](guide/glossary#di-token "DI token definition") that indicates the root directory of
|
|
26523
|
+
* the application
|
|
26562
26524
|
* @publicApi
|
|
26563
26525
|
*/
|
|
26564
26526
|
const PACKAGE_ROOT_URL = new InjectionToken('Application Packages Root URL');
|
|
@@ -28307,12 +28269,9 @@ function checkNotEmpty(value, modulePath, exportName) {
|
|
|
28307
28269
|
* found in the LICENSE file at https://angular.io/license
|
|
28308
28270
|
*/
|
|
28309
28271
|
/**
|
|
28310
|
-
* Represents an Angular [view](guide/glossary#view)
|
|
28311
|
-
* specifically the [host view](guide/glossary#view-tree) that is defined by a component.
|
|
28312
|
-
* Also serves as the base class
|
|
28313
|
-
* that adds destroy methods for [embedded views](guide/glossary#view-tree).
|
|
28272
|
+
* Represents an Angular [view](guide/glossary#view "Definition").
|
|
28314
28273
|
*
|
|
28315
|
-
* @see
|
|
28274
|
+
* @see {@link ChangeDetectorRef#usage-notes Change detection usage}
|
|
28316
28275
|
*
|
|
28317
28276
|
* @publicApi
|
|
28318
28277
|
*/
|