@angular/core 13.3.2 → 13.3.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.2
2
+ * @license Angular v13.3.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.3.2
2
+ * @license Angular v13.3.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10046,9 +10046,9 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10046
10046
  propName = mapPropName(propName);
10047
10047
  if (ngDevMode) {
10048
10048
  validateAgainstEventProperties(propName);
10049
- if (!validateProperty(tView, element, propName, tNode)) {
10049
+ if (!validateProperty(element, tNode.value, propName, tView.schemas)) {
10050
10050
  // Return here since we only log warnings for unknown properties.
10051
- logUnknownPropertyError(propName, tNode);
10051
+ logUnknownPropertyError(propName, tNode.value);
10052
10052
  return;
10053
10053
  }
10054
10054
  ngDevMode.rendererSetProperty++;
@@ -10068,7 +10068,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10068
10068
  // If the node is a container and the property didn't
10069
10069
  // match any of the inputs or schemas we should throw.
10070
10070
  if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
10071
- logUnknownPropertyError(propName, tNode);
10071
+ logUnknownPropertyError(propName, tNode.value);
10072
10072
  }
10073
10073
  }
10074
10074
  }
@@ -10120,21 +10120,36 @@ function setNgReflectProperties(lView, element, type, dataValue, value) {
10120
10120
  }
10121
10121
  }
10122
10122
  }
10123
- function validateProperty(tView, element, propName, tNode) {
10123
+ /**
10124
+ * Validates that the property of the element is known at runtime and returns
10125
+ * false if it's not the case.
10126
+ * This check is relevant for JIT-compiled components (for AOT-compiled
10127
+ * ones this check happens at build time).
10128
+ *
10129
+ * The property is considered known if either:
10130
+ * - it's a known property of the element
10131
+ * - the element is allowed by one of the schemas
10132
+ * - the property is used for animations
10133
+ *
10134
+ * @param element Element to validate
10135
+ * @param tagName Name of the tag to check
10136
+ * @param propName Name of the property to check
10137
+ * @param schemas Array of schemas
10138
+ */
10139
+ function validateProperty(element, tagName, propName, schemas) {
10124
10140
  // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
10125
10141
  // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
10126
10142
  // defined as an array (as an empty array in case `schemas` field is not defined) and we should
10127
10143
  // execute the check below.
10128
- if (tView.schemas === null)
10144
+ if (schemas === null)
10129
10145
  return true;
10130
- // The property is considered valid if the element matches the schema, it exists on the element
10146
+ // The property is considered valid if the element matches the schema, it exists on the element,
10131
10147
  // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
10132
- if (matchingSchemas(tView.schemas, tNode.value) || propName in element ||
10133
- isAnimationProp(propName)) {
10148
+ if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
10134
10149
  return true;
10135
10150
  }
10136
10151
  // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
10137
- // need to account for both here, while being careful for `typeof null` also returning 'object'.
10152
+ // need to account for both here, while being careful with `typeof null` also returning 'object'.
10138
10153
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
10139
10154
  }
10140
10155
  /**
@@ -10157,10 +10172,10 @@ function matchingSchemas(schemas, tagName) {
10157
10172
  /**
10158
10173
  * Logs an error that a property is not supported on an element.
10159
10174
  * @param propName Name of the invalid property.
10160
- * @param tNode Node on which we encountered the property.
10175
+ * @param tagName Name of the node on which we encountered the property.
10161
10176
  */
10162
- function logUnknownPropertyError(propName, tNode) {
10163
- let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
10177
+ function logUnknownPropertyError(propName, tagName) {
10178
+ const message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'.`;
10164
10179
  console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
10165
10180
  }
10166
10181
  /**
@@ -21122,7 +21137,7 @@ class Version {
21122
21137
  /**
21123
21138
  * @publicApi
21124
21139
  */
21125
- const VERSION = new Version('13.3.2');
21140
+ const VERSION = new Version('13.3.3');
21126
21141
 
21127
21142
  /**
21128
21143
  * @license
@@ -24907,7 +24922,10 @@ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
24907
24922
  * A token that indicates an opaque platform ID.
24908
24923
  * @publicApi
24909
24924
  */
24910
- const PLATFORM_ID = new InjectionToken('Platform ID');
24925
+ const PLATFORM_ID = new InjectionToken('Platform ID', {
24926
+ providedIn: 'platform',
24927
+ factory: () => 'unknown', // set a default platform name, when none set explicitly
24928
+ });
24911
24929
  /**
24912
24930
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
24913
24931
  * be called for every component that is bootstrapped.
@@ -24945,9 +24963,10 @@ class Console {
24945
24963
  }
24946
24964
  }
24947
24965
  Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
24948
- Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac });
24966
+ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });
24949
24967
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
24950
- type: Injectable
24968
+ type: Injectable,
24969
+ args: [{ providedIn: 'platform' }]
24951
24970
  }], null, null); })();
24952
24971
 
24953
24972
  /**
@@ -25905,9 +25924,10 @@ class TestabilityRegistry {
25905
25924
  }
25906
25925
  }
25907
25926
  TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
25908
- TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac });
25927
+ TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });
25909
25928
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
25910
- type: Injectable
25929
+ type: Injectable,
25930
+ args: [{ providedIn: 'platform' }]
25911
25931
  }], function () { return []; }, null); })();
25912
25932
  class _NoopGetTestability {
25913
25933
  addToWindow(registry) { }
@@ -26219,9 +26239,10 @@ class PlatformRef {
26219
26239
  }
26220
26240
  }
26221
26241
  PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
26222
- PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac });
26242
+ PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' });
26223
26243
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
26224
- type: Injectable
26244
+ type: Injectable,
26245
+ args: [{ providedIn: 'platform' }]
26225
26246
  }], function () { return [{ type: Injector }]; }, null); })();
26226
26247
  function getNgZone(ngZoneOption, extra) {
26227
26248
  let ngZone;
@@ -26359,11 +26380,10 @@ function optionsReducer(dst, objs) {
26359
26380
  */
26360
26381
  class ApplicationRef {
26361
26382
  /** @internal */
26362
- constructor(_zone, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
26383
+ constructor(_zone, _injector, _exceptionHandler, _initStatus) {
26363
26384
  this._zone = _zone;
26364
26385
  this._injector = _injector;
26365
26386
  this._exceptionHandler = _exceptionHandler;
26366
- this._componentFactoryResolver = _componentFactoryResolver;
26367
26387
  this._initStatus = _initStatus;
26368
26388
  /** @internal */
26369
26389
  this._bootstrapListeners = [];
@@ -26479,8 +26499,8 @@ class ApplicationRef {
26479
26499
  componentFactory = componentOrFactory;
26480
26500
  }
26481
26501
  else {
26482
- componentFactory =
26483
- this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
26502
+ const resolver = this._injector.get(ComponentFactoryResolver$1);
26503
+ componentFactory = resolver.resolveComponentFactory(componentOrFactory);
26484
26504
  }
26485
26505
  this.componentTypes.push(componentFactory.componentType);
26486
26506
  // Create a factory associated with the current module if it's not bound to some other
@@ -26581,12 +26601,12 @@ class ApplicationRef {
26581
26601
  return this._views.length;
26582
26602
  }
26583
26603
  }
26584
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver$1), ɵɵinject(ApplicationInitStatus)); };
26604
+ ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
26585
26605
  ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
26586
26606
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
26587
26607
  type: Injectable,
26588
26608
  args: [{ providedIn: 'root' }]
26589
- }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver$1 }, { type: ApplicationInitStatus }]; }, null); })();
26609
+ }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null); })();
26590
26610
  function remove(list, el) {
26591
26611
  const index = list.indexOf(el);
26592
26612
  if (index > -1) {
@@ -28568,19 +28588,12 @@ const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
28568
28588
  * Use of this source code is governed by an MIT-style license that can be
28569
28589
  * found in the LICENSE file at https://angular.io/license
28570
28590
  */
28571
- const _CORE_PLATFORM_PROVIDERS = [
28572
- // Set a default platform name for platforms that don't set it explicitly.
28573
- { provide: PLATFORM_ID, useValue: 'unknown' },
28574
- { provide: PlatformRef, deps: [Injector] },
28575
- { provide: TestabilityRegistry, deps: [] },
28576
- { provide: Console, deps: [] },
28577
- ];
28578
28591
  /**
28579
28592
  * This platform has to be included in any other platform
28580
28593
  *
28581
28594
  * @publicApi
28582
28595
  */
28583
- const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
28596
+ const platformCore = createPlatformFactory(null, 'core', []);
28584
28597
 
28585
28598
  /**
28586
28599
  * @license