@angular/core 13.2.0-rc.1 → 13.2.0

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.2.0-rc.1
2
+ * @license Angular v13.2.0
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.2.0-rc.1
2
+ * @license Angular v13.2.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -21083,7 +21083,7 @@ class Version {
21083
21083
  /**
21084
21084
  * @publicApi
21085
21085
  */
21086
- const VERSION = new Version('13.2.0-rc.1');
21086
+ const VERSION = new Version('13.2.0');
21087
21087
 
21088
21088
  /**
21089
21089
  * @license
@@ -21111,37 +21111,6 @@ const VERSION = new Version('13.2.0-rc.1');
21111
21111
  // - mod2.injector.get(token, default)
21112
21112
  const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};
21113
21113
 
21114
- /**
21115
- * @license
21116
- * Copyright Google LLC All Rights Reserved.
21117
- *
21118
- * Use of this source code is governed by an MIT-style license that can be
21119
- * found in the LICENSE file at https://angular.io/license
21120
- */
21121
- /**
21122
- * Injector that looks up a value using a specific injector, before falling back to the module
21123
- * injector. Used primarily when creating components or embedded views dynamically.
21124
- */
21125
- class ChainedInjector {
21126
- constructor(injector, parentInjector) {
21127
- this.injector = injector;
21128
- this.parentInjector = parentInjector;
21129
- }
21130
- get(token, notFoundValue, flags) {
21131
- const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
21132
- if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
21133
- notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
21134
- // Return the value from the root element injector when
21135
- // - it provides it
21136
- // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21137
- // - the module injector should not be checked
21138
- // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21139
- return value;
21140
- }
21141
- return this.parentInjector.get(token, notFoundValue, flags);
21142
- }
21143
- }
21144
-
21145
21114
  /**
21146
21115
  * @license
21147
21116
  * Copyright Google LLC All Rights Reserved.
@@ -21527,6 +21496,23 @@ const SCHEDULER = new InjectionToken('SCHEDULER_TOKEN', {
21527
21496
  providedIn: 'root',
21528
21497
  factory: () => defaultScheduler,
21529
21498
  });
21499
+ function createChainedInjector(rootViewInjector, moduleInjector) {
21500
+ return {
21501
+ get: (token, notFoundValue, flags) => {
21502
+ const value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
21503
+ if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
21504
+ notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
21505
+ // Return the value from the root element injector when
21506
+ // - it provides it
21507
+ // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21508
+ // - the module injector should not be checked
21509
+ // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21510
+ return value;
21511
+ }
21512
+ return moduleInjector.get(token, notFoundValue, flags);
21513
+ }
21514
+ };
21515
+ }
21530
21516
  /**
21531
21517
  * Render3 implementation of {@link viewEngine_ComponentFactory}.
21532
21518
  */
@@ -21553,7 +21539,7 @@ class ComponentFactory extends ComponentFactory$1 {
21553
21539
  }
21554
21540
  create(injector, projectableNodes, rootSelectorOrNode, ngModule) {
21555
21541
  ngModule = ngModule || this.ngModule;
21556
- const rootViewInjector = ngModule ? new ChainedInjector(injector, ngModule.injector) : injector;
21542
+ const rootViewInjector = ngModule ? createChainedInjector(injector, ngModule.injector) : injector;
21557
21543
  const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
21558
21544
  const sanitizer = rootViewInjector.get(Sanitizer, null);
21559
21545
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
@@ -22688,9 +22674,9 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
22688
22674
  this._declarationTContainer = _declarationTContainer;
22689
22675
  this.elementRef = elementRef;
22690
22676
  }
22691
- createEmbeddedView(context, injector) {
22677
+ createEmbeddedView(context) {
22692
22678
  const embeddedTView = this._declarationTContainer.tViews;
22693
- const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, createEmbeddedViewInjector(injector, this._declarationLView[INJECTOR$1]));
22679
+ const embeddedLView = createLView(this._declarationLView, embeddedTView, context, 16 /* CheckAlways */, null, embeddedTView.declTNode, null, null, null, null);
22694
22680
  const declarationLContainer = this._declarationLView[this._declarationTContainer.index];
22695
22681
  ngDevMode && assertLContainer(declarationLContainer);
22696
22682
  embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;
@@ -22702,14 +22688,6 @@ const R3TemplateRef = class TemplateRef extends ViewEngineTemplateRef {
22702
22688
  return new ViewRef$1(embeddedLView);
22703
22689
  }
22704
22690
  };
22705
- function createEmbeddedViewInjector(embeddedViewInjector, declarationViewInjector) {
22706
- if (!embeddedViewInjector) {
22707
- return null;
22708
- }
22709
- return declarationViewInjector ?
22710
- new ChainedInjector(embeddedViewInjector, declarationViewInjector) :
22711
- embeddedViewInjector;
22712
- }
22713
22691
  /**
22714
22692
  * Creates a TemplateRef given a node.
22715
22693
  *
@@ -22814,17 +22792,8 @@ const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef {
22814
22792
  get length() {
22815
22793
  return this._lContainer.length - CONTAINER_HEADER_OFFSET;
22816
22794
  }
22817
- createEmbeddedView(templateRef, context, indexOrOptions) {
22818
- let index;
22819
- let injector;
22820
- if (typeof indexOrOptions === 'number') {
22821
- index = indexOrOptions;
22822
- }
22823
- else if (indexOrOptions != null) {
22824
- index = indexOrOptions.index;
22825
- injector = indexOrOptions.injector;
22826
- }
22827
- const viewRef = templateRef.createEmbeddedView(context || {}, injector);
22795
+ createEmbeddedView(templateRef, context, index) {
22796
+ const viewRef = templateRef.createEmbeddedView(context || {});
22828
22797
  this.insert(viewRef, index);
22829
22798
  return viewRef;
22830
22799
  }
@@ -25354,7 +25323,8 @@ class NgZone {
25354
25323
  forkInnerZoneWithAngularBehavior(self);
25355
25324
  }
25356
25325
  static isInAngularZone() {
25357
- return Zone.current.get('isAngularZone') === true;
25326
+ // Zone needs to be checked, because this method might be called even when NoopNgZone is used.
25327
+ return typeof Zone !== 'undefined' && Zone.current.get('isAngularZone') === true;
25358
25328
  }
25359
25329
  static assertInAngularZone() {
25360
25330
  if (!NgZone.isInAngularZone()) {