@angular/core 14.1.0 → 14.1.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 v14.1.0
2
+ * @license Angular v14.1.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2047,7 +2047,7 @@ function setCurrentInjector(injector) {
2047
2047
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
2048
2048
  if (_currentInjector === undefined) {
2049
2049
  throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
2050
- `inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
2050
+ `inject() must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \`EnvironmentInjector#runInContext\`.`);
2051
2051
  }
2052
2052
  else if (_currentInjector === null) {
2053
2053
  return injectRootLimpMode(token, undefined, flags);
@@ -2573,7 +2573,6 @@ function extractDirectiveDef(type) {
2573
2573
  function nonNull(value) {
2574
2574
  return value !== null;
2575
2575
  }
2576
- const autoRegisterModuleById = {};
2577
2576
  /**
2578
2577
  * @codeGenApi
2579
2578
  */
@@ -2589,9 +2588,6 @@ function ɵɵdefineNgModule(def) {
2589
2588
  schemas: def.schemas || null,
2590
2589
  id: def.id || null,
2591
2590
  };
2592
- if (def.id != null) {
2593
- autoRegisterModuleById[def.id] = def.type;
2594
- }
2595
2591
  return res;
2596
2592
  });
2597
2593
  }
@@ -7618,7 +7614,7 @@ class Version {
7618
7614
  /**
7619
7615
  * @publicApi
7620
7616
  */
7621
- const VERSION = new Version('14.1.0');
7617
+ const VERSION = new Version('14.1.3');
7622
7618
 
7623
7619
  /**
7624
7620
  * @license
@@ -7834,9 +7830,10 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
7834
7830
  'a part of an @NgModule where this component is declared';
7835
7831
  if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
7836
7832
  // Most likely this is a control flow directive (such as `*ngIf`) used in
7837
- // a template, but the `CommonModule` is not imported.
7833
+ // a template, but the directive or the `CommonModule` is not imported.
7834
+ const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
7838
7835
  message += `\nIf the '${propName}' is an Angular control flow directive, ` +
7839
- `please make sure that the 'CommonModule' is ${importLocation}.`;
7836
+ `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
7840
7837
  }
7841
7838
  else {
7842
7839
  // May be an Angular component, which is not imported/declared?
@@ -7915,11 +7912,14 @@ function getTemplateLocationDetails(lView) {
7915
7912
  return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
7916
7913
  }
7917
7914
  /**
7918
- * The set of known control flow directives.
7915
+ * The set of known control flow directives and their corresponding imports.
7919
7916
  * We use this set to produce a more precises error message with a note
7920
7917
  * that the `CommonModule` should also be included.
7921
7918
  */
7922
- const KNOWN_CONTROL_FLOW_DIRECTIVES = new Set(['ngIf', 'ngFor', 'ngSwitch', 'ngSwitchCase', 'ngSwitchDefault']);
7919
+ const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([
7920
+ ['ngIf', 'NgIf'], ['ngFor', 'NgForOf'], ['ngSwitchCase', 'NgSwitchCase'],
7921
+ ['ngSwitchDefault', 'NgSwitchDefault']
7922
+ ]);
7923
7923
  /**
7924
7924
  * Returns true if the tag name is allowed by specified schemas.
7925
7925
  * @param schemas Array of schemas
@@ -13395,13 +13395,15 @@ function refreshContainsDirtyView(lView) {
13395
13395
  for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
13396
13396
  for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
13397
13397
  const embeddedLView = lContainer[i];
13398
- if (embeddedLView[FLAGS] & 512 /* LViewFlags.RefreshTransplantedView */) {
13399
- const embeddedTView = embeddedLView[TVIEW];
13400
- ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
13401
- refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
13402
- }
13403
- else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
13404
- refreshContainsDirtyView(embeddedLView);
13398
+ if (viewAttachedToChangeDetector(embeddedLView)) {
13399
+ if (embeddedLView[FLAGS] & 512 /* LViewFlags.RefreshTransplantedView */) {
13400
+ const embeddedTView = embeddedLView[TVIEW];
13401
+ ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
13402
+ refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
13403
+ }
13404
+ else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
13405
+ refreshContainsDirtyView(embeddedLView);
13406
+ }
13405
13407
  }
13406
13408
  }
13407
13409
  }