@angular/core 14.0.0-rc.3 → 14.0.2

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.
Files changed (33) hide show
  1. package/esm2020/src/di/interface/provider.mjs +1 -1
  2. package/esm2020/src/di/provider_collection.mjs +32 -2
  3. package/esm2020/src/di/r3_injector.mjs +3 -1
  4. package/esm2020/src/error_handler.mjs +4 -7
  5. package/esm2020/src/errors.mjs +6 -3
  6. package/esm2020/src/metadata/directives.mjs +1 -1
  7. package/esm2020/src/render3/component.mjs +9 -9
  8. package/esm2020/src/render3/definition.mjs +4 -4
  9. package/esm2020/src/render3/features/standalone_feature.mjs +4 -4
  10. package/esm2020/src/render3/instructions/all.mjs +2 -2
  11. package/esm2020/src/render3/instructions/element.mjs +3 -79
  12. package/esm2020/src/render3/instructions/element_validation.mjs +264 -0
  13. package/esm2020/src/render3/instructions/shared.mjs +7 -184
  14. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  15. package/esm2020/src/render3/jit/module.mjs +3 -2
  16. package/esm2020/src/render3/ng_module_ref.mjs +2 -1
  17. package/esm2020/src/render3/pipe.mjs +20 -6
  18. package/esm2020/src/render3/state.mjs +1 -3
  19. package/esm2020/src/util/errors.mjs +1 -8
  20. package/esm2020/src/version.mjs +1 -1
  21. package/esm2020/testing/src/logger.mjs +3 -3
  22. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  23. package/fesm2015/core.mjs +631 -586
  24. package/fesm2015/core.mjs.map +1 -1
  25. package/fesm2015/testing.mjs +632 -587
  26. package/fesm2015/testing.mjs.map +1 -1
  27. package/fesm2020/core.mjs +632 -587
  28. package/fesm2020/core.mjs.map +1 -1
  29. package/fesm2020/testing.mjs +633 -588
  30. package/fesm2020/testing.mjs.map +1 -1
  31. package/index.d.ts +48 -7
  32. package/package.json +1 -1
  33. package/testing/index.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-rc.3
2
+ * @license Angular v14.0.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1842,9 +1842,12 @@ function formatRuntimeError(code, message) {
1842
1842
  // Error code might be a negative number, which is a special marker that instructs the logic to
1843
1843
  // generate a link to the error details page on angular.io.
1844
1844
  const fullCode = `NG0${Math.abs(code)}`;
1845
- let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;
1845
+ let errorMessage = `${fullCode}${message ? ': ' + message.trim() : ''}`;
1846
1846
  if (ngDevMode && code < 0) {
1847
- errorMessage = `${errorMessage}. Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
1847
+ const addPeriodSeparator = !errorMessage.match(/[.,;!?]$/);
1848
+ const separator = addPeriodSeparator ? '.' : '';
1849
+ errorMessage =
1850
+ `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
1848
1851
  }
1849
1852
  return errorMessage;
1850
1853
  }
@@ -2470,7 +2473,8 @@ const NG_ELEMENT_ID = getClosureSafeProperty({ __NG_ELEMENT_ID__: getClosureSafe
2470
2473
  * Use of this source code is governed by an MIT-style license that can be
2471
2474
  * found in the LICENSE file at https://angular.io/license
2472
2475
  */
2473
- let _renderCompCount = 0;
2476
+ /** Counter used to generate unique IDs for component definitions. */
2477
+ let componentDefCount = 0;
2474
2478
  /**
2475
2479
  * Create a component definition object.
2476
2480
  *
@@ -2523,7 +2527,7 @@ function ɵɵdefineComponent(componentDefinition) {
2523
2527
  features: componentDefinition.features || null,
2524
2528
  data: componentDefinition.data || {},
2525
2529
  encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,
2526
- id: 'c',
2530
+ id: `c${componentDefCount++}`,
2527
2531
  styles: componentDefinition.styles || EMPTY_ARRAY,
2528
2532
  _: null,
2529
2533
  setInput: null,
@@ -2532,7 +2536,6 @@ function ɵɵdefineComponent(componentDefinition) {
2532
2536
  };
2533
2537
  const dependencies = componentDefinition.dependencies;
2534
2538
  const feature = componentDefinition.features;
2535
- def.id += _renderCompCount++;
2536
2539
  def.inputs = invertObject(componentDefinition.inputs, declaredInputs),
2537
2540
  def.outputs = invertObject(componentDefinition.outputs),
2538
2541
  feature && feature.forEach((fn) => fn(def));
@@ -3546,7 +3549,6 @@ function getLView() {
3546
3549
  function getTView() {
3547
3550
  return instructionState.lFrame.tView;
3548
3551
  }
3549
- // TODO(crisbeto): revert the @noinline once Closure issue is resolved.
3550
3552
  /**
3551
3553
  * Restores `contextViewData` to the given OpaqueViewState instance.
3552
3554
  *
@@ -3558,7 +3560,6 @@ function getTView() {
3558
3560
  * @returns Context of the restored OpaqueViewState instance.
3559
3561
  *
3560
3562
  * @codeGenApi
3561
- * @noinline Disable inlining due to issue with Closure in listeners inside embedded views.
3562
3563
  */
3563
3564
  function ɵɵrestoreView(viewToRestore) {
3564
3565
  instructionState.lFrame.contextLView = viewToRestore;
@@ -6623,6 +6624,155 @@ function getSanitizer() {
6623
6624
  return lView && lView[SANITIZER];
6624
6625
  }
6625
6626
 
6627
+ /**
6628
+ * @license
6629
+ * Copyright Google LLC All Rights Reserved.
6630
+ *
6631
+ * Use of this source code is governed by an MIT-style license that can be
6632
+ * found in the LICENSE file at https://angular.io/license
6633
+ */
6634
+ const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
6635
+ function wrappedError(message, originalError) {
6636
+ const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
6637
+ const error = Error(msg);
6638
+ error[ERROR_ORIGINAL_ERROR] = originalError;
6639
+ return error;
6640
+ }
6641
+ function getOriginalError(error) {
6642
+ return error[ERROR_ORIGINAL_ERROR];
6643
+ }
6644
+
6645
+ /**
6646
+ * @license
6647
+ * Copyright Google LLC All Rights Reserved.
6648
+ *
6649
+ * Use of this source code is governed by an MIT-style license that can be
6650
+ * found in the LICENSE file at https://angular.io/license
6651
+ */
6652
+ /**
6653
+ * Provides a hook for centralized exception handling.
6654
+ *
6655
+ * The default implementation of `ErrorHandler` prints error messages to the `console`. To
6656
+ * intercept error handling, write a custom exception handler that replaces this default as
6657
+ * appropriate for your app.
6658
+ *
6659
+ * @usageNotes
6660
+ * ### Example
6661
+ *
6662
+ * ```
6663
+ * class MyErrorHandler implements ErrorHandler {
6664
+ * handleError(error) {
6665
+ * // do something with the exception
6666
+ * }
6667
+ * }
6668
+ *
6669
+ * @NgModule({
6670
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
6671
+ * })
6672
+ * class MyModule {}
6673
+ * ```
6674
+ *
6675
+ * @publicApi
6676
+ */
6677
+ class ErrorHandler {
6678
+ constructor() {
6679
+ /**
6680
+ * @internal
6681
+ */
6682
+ this._console = console;
6683
+ }
6684
+ handleError(error) {
6685
+ const originalError = this._findOriginalError(error);
6686
+ this._console.error('ERROR', error);
6687
+ if (originalError) {
6688
+ this._console.error('ORIGINAL ERROR', originalError);
6689
+ }
6690
+ }
6691
+ /** @internal */
6692
+ _findOriginalError(error) {
6693
+ let e = error && getOriginalError(error);
6694
+ while (e && getOriginalError(e)) {
6695
+ e = getOriginalError(e);
6696
+ }
6697
+ return e || null;
6698
+ }
6699
+ }
6700
+
6701
+ /**
6702
+ * @license
6703
+ * Copyright Google LLC All Rights Reserved.
6704
+ *
6705
+ * Use of this source code is governed by an MIT-style license that can be
6706
+ * found in the LICENSE file at https://angular.io/license
6707
+ */
6708
+ /**
6709
+ * Disallowed strings in the comment.
6710
+ *
6711
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
6712
+ */
6713
+ const COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
6714
+ /**
6715
+ * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
6716
+ */
6717
+ const COMMENT_DELIMITER = /(<|>)/;
6718
+ const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
6719
+ /**
6720
+ * Escape the content of comment strings so that it can be safely inserted into a comment node.
6721
+ *
6722
+ * The issue is that HTML does not specify any way to escape comment end text inside the comment.
6723
+ * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
6724
+ * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
6725
+ * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
6726
+ *
6727
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
6728
+ *
6729
+ * ```
6730
+ * div.innerHTML = div.innerHTML
6731
+ * ```
6732
+ *
6733
+ * One would expect that the above code would be safe to do, but it turns out that because comment
6734
+ * text is not escaped, the comment may contain text which will prematurely close the comment
6735
+ * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
6736
+ * may contain such text and expect them to be safe.)
6737
+ *
6738
+ * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
6739
+ * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
6740
+ * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
6741
+ * text it will render normally but it will not cause the HTML parser to close/open the comment.
6742
+ *
6743
+ * @param value text to make safe for comment node by escaping the comment open/close character
6744
+ * sequence.
6745
+ */
6746
+ function escapeCommentText(value) {
6747
+ return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
6748
+ }
6749
+
6750
+ /**
6751
+ * @license
6752
+ * Copyright Google LLC All Rights Reserved.
6753
+ *
6754
+ * Use of this source code is governed by an MIT-style license that can be
6755
+ * found in the LICENSE file at https://angular.io/license
6756
+ */
6757
+ function normalizeDebugBindingName(name) {
6758
+ // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
6759
+ name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
6760
+ return `ng-reflect-${name}`;
6761
+ }
6762
+ const CAMEL_CASE_REGEXP = /([A-Z])/g;
6763
+ function camelCaseToDashCase(input) {
6764
+ return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
6765
+ }
6766
+ function normalizeDebugBindingValue(value) {
6767
+ try {
6768
+ // Limit the size of the value as otherwise the DOM just gets polluted.
6769
+ return value != null ? value.toString().slice(0, 30) : value;
6770
+ }
6771
+ catch (e) {
6772
+ return '[ERROR] Exception while trying to serialize the value';
6773
+ }
6774
+ }
6775
+
6626
6776
  /**
6627
6777
  * @license
6628
6778
  * Copyright Google LLC All Rights Reserved.
@@ -6978,216 +7128,26 @@ function getDirectivesAtNodeIndex(nodeIndex, lView, includeComponents) {
6978
7128
  return lView.slice(directiveStartIndex, directiveEndIndex);
6979
7129
  }
6980
7130
  function getComponentAtNodeIndex(nodeIndex, lView) {
6981
- const tNode = lView[TVIEW].data[nodeIndex];
6982
- let directiveStartIndex = tNode.directiveStart;
6983
- return tNode.flags & 2 /* TNodeFlags.isComponentHost */ ? lView[directiveStartIndex] : null;
6984
- }
6985
- /**
6986
- * Returns a map of local references (local reference name => element or directive instance) that
6987
- * exist on a given element.
6988
- */
6989
- function discoverLocalRefs(lView, nodeIndex) {
6990
- const tNode = lView[TVIEW].data[nodeIndex];
6991
- if (tNode && tNode.localNames) {
6992
- const result = {};
6993
- let localIndex = tNode.index + 1;
6994
- for (let i = 0; i < tNode.localNames.length; i += 2) {
6995
- result[tNode.localNames[i]] = lView[localIndex];
6996
- localIndex++;
6997
- }
6998
- return result;
6999
- }
7000
- return null;
7001
- }
7002
-
7003
- /**
7004
- * @license
7005
- * Copyright Google LLC All Rights Reserved.
7006
- *
7007
- * Use of this source code is governed by an MIT-style license that can be
7008
- * found in the LICENSE file at https://angular.io/license
7009
- */
7010
- const ERROR_ORIGINAL_ERROR = 'ngOriginalError';
7011
- const ERROR_LOGGER = 'ngErrorLogger';
7012
- function wrappedError(message, originalError) {
7013
- const msg = `${message} caused by: ${originalError instanceof Error ? originalError.message : originalError}`;
7014
- const error = Error(msg);
7015
- error[ERROR_ORIGINAL_ERROR] = originalError;
7016
- return error;
7017
- }
7018
- function getOriginalError(error) {
7019
- return error[ERROR_ORIGINAL_ERROR];
7020
- }
7021
- function getErrorLogger(error) {
7022
- return error && error[ERROR_LOGGER] || defaultErrorLogger;
7023
- }
7024
- function defaultErrorLogger(console, ...values) {
7025
- console.error(...values);
7026
- }
7027
-
7028
- /**
7029
- * @license
7030
- * Copyright Google LLC All Rights Reserved.
7031
- *
7032
- * Use of this source code is governed by an MIT-style license that can be
7033
- * found in the LICENSE file at https://angular.io/license
7034
- */
7035
- /**
7036
- * Provides a hook for centralized exception handling.
7037
- *
7038
- * The default implementation of `ErrorHandler` prints error messages to the `console`. To
7039
- * intercept error handling, write a custom exception handler that replaces this default as
7040
- * appropriate for your app.
7041
- *
7042
- * @usageNotes
7043
- * ### Example
7044
- *
7045
- * ```
7046
- * class MyErrorHandler implements ErrorHandler {
7047
- * handleError(error) {
7048
- * // do something with the exception
7049
- * }
7050
- * }
7051
- *
7052
- * @NgModule({
7053
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
7054
- * })
7055
- * class MyModule {}
7056
- * ```
7057
- *
7058
- * @publicApi
7059
- */
7060
- class ErrorHandler {
7061
- constructor() {
7062
- /**
7063
- * @internal
7064
- */
7065
- this._console = console;
7066
- }
7067
- handleError(error) {
7068
- const originalError = this._findOriginalError(error);
7069
- // Note: Browser consoles show the place from where console.error was called.
7070
- // We can use this to give users additional information about the error.
7071
- const errorLogger = getErrorLogger(error);
7072
- errorLogger(this._console, `ERROR`, error);
7073
- if (originalError) {
7074
- errorLogger(this._console, `ORIGINAL ERROR`, originalError);
7075
- }
7076
- }
7077
- /** @internal */
7078
- _findOriginalError(error) {
7079
- let e = error && getOriginalError(error);
7080
- while (e && getOriginalError(e)) {
7081
- e = getOriginalError(e);
7082
- }
7083
- return e || null;
7084
- }
7085
- }
7086
-
7087
- /**
7088
- * @license
7089
- * Copyright Google LLC All Rights Reserved.
7090
- *
7091
- * Use of this source code is governed by an MIT-style license that can be
7092
- * found in the LICENSE file at https://angular.io/license
7093
- */
7094
- /**
7095
- * Defines a schema that allows an NgModule to contain the following:
7096
- * - Non-Angular elements named with dash case (`-`).
7097
- * - Element properties named with dash case (`-`).
7098
- * Dash case is the naming convention for custom elements.
7099
- *
7100
- * @publicApi
7101
- */
7102
- const CUSTOM_ELEMENTS_SCHEMA = {
7103
- name: 'custom-elements'
7104
- };
7105
- /**
7106
- * Defines a schema that allows any property on any element.
7107
- *
7108
- * This schema allows you to ignore the errors related to any unknown elements or properties in a
7109
- * template. The usage of this schema is generally discouraged because it prevents useful validation
7110
- * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
7111
- *
7112
- * @publicApi
7113
- */
7114
- const NO_ERRORS_SCHEMA = {
7115
- name: 'no-errors-schema'
7116
- };
7117
-
7118
- /**
7119
- * @license
7120
- * Copyright Google LLC All Rights Reserved.
7121
- *
7122
- * Use of this source code is governed by an MIT-style license that can be
7123
- * found in the LICENSE file at https://angular.io/license
7124
- */
7125
- /**
7126
- * Disallowed strings in the comment.
7127
- *
7128
- * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
7129
- */
7130
- const COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
7131
- /**
7132
- * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
7133
- */
7134
- const COMMENT_DELIMITER = /(<|>)/;
7135
- const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
7136
- /**
7137
- * Escape the content of comment strings so that it can be safely inserted into a comment node.
7138
- *
7139
- * The issue is that HTML does not specify any way to escape comment end text inside the comment.
7140
- * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
7141
- * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
7142
- * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
7143
- *
7144
- * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
7145
- *
7146
- * ```
7147
- * div.innerHTML = div.innerHTML
7148
- * ```
7149
- *
7150
- * One would expect that the above code would be safe to do, but it turns out that because comment
7151
- * text is not escaped, the comment may contain text which will prematurely close the comment
7152
- * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
7153
- * may contain such text and expect them to be safe.)
7154
- *
7155
- * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
7156
- * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
7157
- * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
7158
- * text it will render normally but it will not cause the HTML parser to close/open the comment.
7159
- *
7160
- * @param value text to make safe for comment node by escaping the comment open/close character
7161
- * sequence.
7162
- */
7163
- function escapeCommentText(value) {
7164
- return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
7165
- }
7166
-
7167
- /**
7168
- * @license
7169
- * Copyright Google LLC All Rights Reserved.
7170
- *
7171
- * Use of this source code is governed by an MIT-style license that can be
7172
- * found in the LICENSE file at https://angular.io/license
7173
- */
7174
- function normalizeDebugBindingName(name) {
7175
- // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
7176
- name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
7177
- return `ng-reflect-${name}`;
7178
- }
7179
- const CAMEL_CASE_REGEXP = /([A-Z])/g;
7180
- function camelCaseToDashCase(input) {
7181
- return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
7182
- }
7183
- function normalizeDebugBindingValue(value) {
7184
- try {
7185
- // Limit the size of the value as otherwise the DOM just gets polluted.
7186
- return value != null ? value.toString().slice(0, 30) : value;
7187
- }
7188
- catch (e) {
7189
- return '[ERROR] Exception while trying to serialize the value';
7131
+ const tNode = lView[TVIEW].data[nodeIndex];
7132
+ let directiveStartIndex = tNode.directiveStart;
7133
+ return tNode.flags & 2 /* TNodeFlags.isComponentHost */ ? lView[directiveStartIndex] : null;
7134
+ }
7135
+ /**
7136
+ * Returns a map of local references (local reference name => element or directive instance) that
7137
+ * exist on a given element.
7138
+ */
7139
+ function discoverLocalRefs(lView, nodeIndex) {
7140
+ const tNode = lView[TVIEW].data[nodeIndex];
7141
+ if (tNode && tNode.localNames) {
7142
+ const result = {};
7143
+ let localIndex = tNode.index + 1;
7144
+ for (let i = 0; i < tNode.localNames.length; i += 2) {
7145
+ result[tNode.localNames[i]] = lView[localIndex];
7146
+ localIndex++;
7147
+ }
7148
+ return result;
7190
7149
  }
7150
+ return null;
7191
7151
  }
7192
7152
 
7193
7153
  /**
@@ -9173,8 +9133,38 @@ const INJECTOR_DEF_TYPES = new InjectionToken('INJECTOR_DEF_TYPES');
9173
9133
  * another environment injector (such as a route injector). They should not be used in component
9174
9134
  * providers.
9175
9135
  *
9176
- * @returns The collected providers from the specified list of types.
9136
+ * More information about standalone components can be found in [this
9137
+ * guide](guide/standalone-components).
9138
+ *
9139
+ * @usageNotes
9140
+ * The results of the `importProvidersFrom` call can be used in the `bootstrapApplication` call:
9141
+ *
9142
+ * ```typescript
9143
+ * await bootstrapApplication(RootComponent, {
9144
+ * providers: [
9145
+ * importProvidersFrom(NgModuleOne, NgModuleTwo)
9146
+ * ]
9147
+ * });
9148
+ * ```
9149
+ *
9150
+ * You can also use the `importProvidersFrom` results in the `providers` field of a route, when a
9151
+ * standalone component is used:
9152
+ *
9153
+ * ```typescript
9154
+ * export const ROUTES: Route[] = [
9155
+ * {
9156
+ * path: 'foo',
9157
+ * providers: [
9158
+ * importProvidersFrom(NgModuleOne, NgModuleTwo)
9159
+ * ],
9160
+ * component: YourStandaloneComponent
9161
+ * }
9162
+ * ];
9163
+ * ```
9164
+ *
9165
+ * @returns Collected providers from the specified list of types.
9177
9166
  * @publicApi
9167
+ * @developerPreview
9178
9168
  */
9179
9169
  function importProvidersFrom(...sources) {
9180
9170
  return { ɵproviders: internalImportProvidersFrom(true, sources) };
@@ -9452,6 +9442,8 @@ function getNullInjector() {
9452
9442
  /**
9453
9443
  * An `Injector` that's part of the environment injector hierarchy, which exists outside of the
9454
9444
  * component tree.
9445
+ *
9446
+ * @developerPreview
9455
9447
  */
9456
9448
  class EnvironmentInjector {
9457
9449
  }
@@ -10622,113 +10614,402 @@ class ReflectiveInjector_ {
10622
10614
  return this.objs[i];
10623
10615
  }
10624
10616
  }
10625
- return UNDEFINED;
10617
+ return UNDEFINED;
10618
+ }
10619
+ /** @internal */
10620
+ _throwOrNull(key, notFoundValue) {
10621
+ if (notFoundValue !== THROW_IF_NOT_FOUND) {
10622
+ return notFoundValue;
10623
+ }
10624
+ else {
10625
+ throw noProviderError(this, key);
10626
+ }
10627
+ }
10628
+ /** @internal */
10629
+ _getByKeySelf(key, notFoundValue) {
10630
+ const obj = this._getObjByKeyId(key.id);
10631
+ return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
10632
+ }
10633
+ /** @internal */
10634
+ _getByKeyDefault(key, notFoundValue, visibility) {
10635
+ let inj;
10636
+ if (visibility instanceof SkipSelf) {
10637
+ inj = this.parent;
10638
+ }
10639
+ else {
10640
+ inj = this;
10641
+ }
10642
+ while (inj instanceof ReflectiveInjector_) {
10643
+ const inj_ = inj;
10644
+ const obj = inj_._getObjByKeyId(key.id);
10645
+ if (obj !== UNDEFINED)
10646
+ return obj;
10647
+ inj = inj_.parent;
10648
+ }
10649
+ if (inj !== null) {
10650
+ return inj.get(key.token, notFoundValue);
10651
+ }
10652
+ else {
10653
+ return this._throwOrNull(key, notFoundValue);
10654
+ }
10655
+ }
10656
+ get displayName() {
10657
+ const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ')
10658
+ .join(', ');
10659
+ return `ReflectiveInjector(providers: [${providers}])`;
10660
+ }
10661
+ toString() {
10662
+ return this.displayName;
10663
+ }
10664
+ }
10665
+ ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
10666
+ function _mapProviders(injector, fn) {
10667
+ const res = [];
10668
+ for (let i = 0; i < injector._providers.length; ++i) {
10669
+ res[i] = fn(injector.getProviderAtIndex(i));
10670
+ }
10671
+ return res;
10672
+ }
10673
+
10674
+ /**
10675
+ * @license
10676
+ * Copyright Google LLC All Rights Reserved.
10677
+ *
10678
+ * Use of this source code is governed by an MIT-style license that can be
10679
+ * found in the LICENSE file at https://angular.io/license
10680
+ */
10681
+
10682
+ /**
10683
+ * @license
10684
+ * Copyright Google LLC All Rights Reserved.
10685
+ *
10686
+ * Use of this source code is governed by an MIT-style license that can be
10687
+ * found in the LICENSE file at https://angular.io/license
10688
+ */
10689
+
10690
+ /**
10691
+ * @license
10692
+ * Copyright Google LLC All Rights Reserved.
10693
+ *
10694
+ * Use of this source code is governed by an MIT-style license that can be
10695
+ * found in the LICENSE file at https://angular.io/license
10696
+ */
10697
+ function ɵɵdirectiveInject(token, flags = InjectFlags.Default) {
10698
+ const lView = getLView();
10699
+ // Fall back to inject() if view hasn't been created. This situation can happen in tests
10700
+ // if inject utilities are used before bootstrapping.
10701
+ if (lView === null) {
10702
+ // Verify that we will not get into infinite loop.
10703
+ ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
10704
+ return ɵɵinject(token, flags);
10705
+ }
10706
+ const tNode = getCurrentTNode();
10707
+ return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
10708
+ }
10709
+ /**
10710
+ * Throws an error indicating that a factory function could not be generated by the compiler for a
10711
+ * particular class.
10712
+ *
10713
+ * This instruction allows the actual error message to be optimized away when ngDevMode is turned
10714
+ * off, saving bytes of generated code while still providing a good experience in dev mode.
10715
+ *
10716
+ * The name of the class is not mentioned here, but will be in the generated factory function name
10717
+ * and thus in the stack trace.
10718
+ *
10719
+ * @codeGenApi
10720
+ */
10721
+ function ɵɵinvalidFactory() {
10722
+ const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
10723
+ throw new Error(msg);
10724
+ }
10725
+
10726
+ /**
10727
+ * @license
10728
+ * Copyright Google LLC All Rights Reserved.
10729
+ *
10730
+ * Use of this source code is governed by an MIT-style license that can be
10731
+ * found in the LICENSE file at https://angular.io/license
10732
+ */
10733
+ /**
10734
+ * Defines a schema that allows an NgModule to contain the following:
10735
+ * - Non-Angular elements named with dash case (`-`).
10736
+ * - Element properties named with dash case (`-`).
10737
+ * Dash case is the naming convention for custom elements.
10738
+ *
10739
+ * @publicApi
10740
+ */
10741
+ const CUSTOM_ELEMENTS_SCHEMA = {
10742
+ name: 'custom-elements'
10743
+ };
10744
+ /**
10745
+ * Defines a schema that allows any property on any element.
10746
+ *
10747
+ * This schema allows you to ignore the errors related to any unknown elements or properties in a
10748
+ * template. The usage of this schema is generally discouraged because it prevents useful validation
10749
+ * and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
10750
+ *
10751
+ * @publicApi
10752
+ */
10753
+ const NO_ERRORS_SCHEMA = {
10754
+ name: 'no-errors-schema'
10755
+ };
10756
+
10757
+ /**
10758
+ * @license
10759
+ * Copyright Google LLC All Rights Reserved.
10760
+ *
10761
+ * Use of this source code is governed by an MIT-style license that can be
10762
+ * found in the LICENSE file at https://angular.io/license
10763
+ */
10764
+ let shouldThrowErrorOnUnknownElement = false;
10765
+ /**
10766
+ * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
10767
+ * instead of just logging the error.
10768
+ * (for AOT-compiled ones this check happens at build time).
10769
+ */
10770
+ function ɵsetUnknownElementStrictMode(shouldThrow) {
10771
+ shouldThrowErrorOnUnknownElement = shouldThrow;
10772
+ }
10773
+ /**
10774
+ * Gets the current value of the strict mode.
10775
+ */
10776
+ function ɵgetUnknownElementStrictMode() {
10777
+ return shouldThrowErrorOnUnknownElement;
10778
+ }
10779
+ let shouldThrowErrorOnUnknownProperty = false;
10780
+ /**
10781
+ * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
10782
+ * instead of just logging the error.
10783
+ * (for AOT-compiled ones this check happens at build time).
10784
+ */
10785
+ function ɵsetUnknownPropertyStrictMode(shouldThrow) {
10786
+ shouldThrowErrorOnUnknownProperty = shouldThrow;
10787
+ }
10788
+ /**
10789
+ * Gets the current value of the strict mode.
10790
+ */
10791
+ function ɵgetUnknownPropertyStrictMode() {
10792
+ return shouldThrowErrorOnUnknownProperty;
10793
+ }
10794
+ /**
10795
+ * Validates that the element is known at runtime and produces
10796
+ * an error if it's not the case.
10797
+ * This check is relevant for JIT-compiled components (for AOT-compiled
10798
+ * ones this check happens at build time).
10799
+ *
10800
+ * The element is considered known if either:
10801
+ * - it's a known HTML element
10802
+ * - it's a known custom element
10803
+ * - the element matches any directive
10804
+ * - the element is allowed by one of the schemas
10805
+ *
10806
+ * @param element Element to validate
10807
+ * @param lView An `LView` that represents a current component that is being rendered
10808
+ * @param tagName Name of the tag to check
10809
+ * @param schemas Array of schemas
10810
+ * @param hasDirectives Boolean indicating that the element matches any directive
10811
+ */
10812
+ function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
10813
+ // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
10814
+ // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
10815
+ // defined as an array (as an empty array in case `schemas` field is not defined) and we should
10816
+ // execute the check below.
10817
+ if (schemas === null)
10818
+ return;
10819
+ // If the element matches any directive, it's considered as valid.
10820
+ if (!hasDirectives && tagName !== null) {
10821
+ // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
10822
+ // as a custom element. Note that unknown elements with a dash in their name won't be instances
10823
+ // of HTMLUnknownElement in browsers that support web components.
10824
+ const isUnknown =
10825
+ // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
10826
+ // because while most browsers return 'function', IE returns 'object'.
10827
+ (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
10828
+ element instanceof HTMLUnknownElement) ||
10829
+ (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
10830
+ !customElements.get(tagName));
10831
+ if (isUnknown && !matchingSchemas(schemas, tagName)) {
10832
+ const isHostStandalone = isHostComponentStandalone(lView);
10833
+ const templateLocation = getTemplateLocationDetails(lView);
10834
+ const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
10835
+ let message = `'${tagName}' is not a known element${templateLocation}:\n`;
10836
+ message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' :
10837
+ 'a part of an @NgModule where this component is declared'}.\n`;
10838
+ if (tagName && tagName.indexOf('-') > -1) {
10839
+ message +=
10840
+ `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
10841
+ }
10842
+ else {
10843
+ message +=
10844
+ `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
10845
+ }
10846
+ if (shouldThrowErrorOnUnknownElement) {
10847
+ throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
10848
+ }
10849
+ else {
10850
+ console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
10851
+ }
10852
+ }
10626
10853
  }
10627
- /** @internal */
10628
- _throwOrNull(key, notFoundValue) {
10629
- if (notFoundValue !== THROW_IF_NOT_FOUND) {
10630
- return notFoundValue;
10631
- }
10632
- else {
10633
- throw noProviderError(this, key);
10634
- }
10854
+ }
10855
+ /**
10856
+ * Validates that the property of the element is known at runtime and returns
10857
+ * false if it's not the case.
10858
+ * This check is relevant for JIT-compiled components (for AOT-compiled
10859
+ * ones this check happens at build time).
10860
+ *
10861
+ * The property is considered known if either:
10862
+ * - it's a known property of the element
10863
+ * - the element is allowed by one of the schemas
10864
+ * - the property is used for animations
10865
+ *
10866
+ * @param element Element to validate
10867
+ * @param propName Name of the property to check
10868
+ * @param tagName Name of the tag hosting the property
10869
+ * @param schemas Array of schemas
10870
+ */
10871
+ function isPropertyValid(element, propName, tagName, schemas) {
10872
+ // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
10873
+ // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
10874
+ // defined as an array (as an empty array in case `schemas` field is not defined) and we should
10875
+ // execute the check below.
10876
+ if (schemas === null)
10877
+ return true;
10878
+ // The property is considered valid if the element matches the schema, it exists on the element,
10879
+ // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
10880
+ if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
10881
+ return true;
10635
10882
  }
10636
- /** @internal */
10637
- _getByKeySelf(key, notFoundValue) {
10638
- const obj = this._getObjByKeyId(key.id);
10639
- return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);
10883
+ // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
10884
+ // need to account for both here, while being careful with `typeof null` also returning 'object'.
10885
+ return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
10886
+ }
10887
+ /**
10888
+ * Logs or throws an error that a property is not supported on an element.
10889
+ *
10890
+ * @param propName Name of the invalid property
10891
+ * @param tagName Name of the tag hosting the property
10892
+ * @param nodeType Type of the node hosting the property
10893
+ * @param lView An `LView` that represents a current component
10894
+ */
10895
+ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
10896
+ // Special-case a situation when a structural directive is applied to
10897
+ // an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
10898
+ // In this case the compiler generates the `ɵɵtemplate` instruction with
10899
+ // the `null` as the tagName. The directive matching logic at runtime relies
10900
+ // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
10901
+ // a default value of the `tNode.value` is not feasible at this moment.
10902
+ if (!tagName && nodeType === 4 /* TNodeType.Container */) {
10903
+ tagName = 'ng-template';
10640
10904
  }
10641
- /** @internal */
10642
- _getByKeyDefault(key, notFoundValue, visibility) {
10643
- let inj;
10644
- if (visibility instanceof SkipSelf) {
10645
- inj = this.parent;
10646
- }
10647
- else {
10648
- inj = this;
10649
- }
10650
- while (inj instanceof ReflectiveInjector_) {
10651
- const inj_ = inj;
10652
- const obj = inj_._getObjByKeyId(key.id);
10653
- if (obj !== UNDEFINED)
10654
- return obj;
10655
- inj = inj_.parent;
10656
- }
10657
- if (inj !== null) {
10658
- return inj.get(key.token, notFoundValue);
10905
+ const isHostStandalone = isHostComponentStandalone(lView);
10906
+ const templateLocation = getTemplateLocationDetails(lView);
10907
+ let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
10908
+ const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
10909
+ const importLocation = isHostStandalone ?
10910
+ 'included in the \'@Component.imports\' of this component' :
10911
+ 'a part of an @NgModule where this component is declared';
10912
+ if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
10913
+ // Most likely this is a control flow directive (such as `*ngIf`) used in
10914
+ // a template, but the `CommonModule` is not imported.
10915
+ message += `\nIf the '${propName}' is an Angular control flow directive, ` +
10916
+ `please make sure that the 'CommonModule' is ${importLocation}.`;
10917
+ }
10918
+ else {
10919
+ // May be an Angular component, which is not imported/declared?
10920
+ message += `\n1. If '${tagName}' is an Angular component and it has the ` +
10921
+ `'${propName}' input, then verify that it is ${importLocation}.`;
10922
+ // May be a Web Component?
10923
+ if (tagName && tagName.indexOf('-') > -1) {
10924
+ message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
10925
+ `to the ${schemas} of this component to suppress this message.`;
10926
+ message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
10927
+ `the ${schemas} of this component.`;
10659
10928
  }
10660
10929
  else {
10661
- return this._throwOrNull(key, notFoundValue);
10930
+ // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
10931
+ message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
10932
+ `the ${schemas} of this component.`;
10662
10933
  }
10663
10934
  }
10664
- get displayName() {
10665
- const providers = _mapProviders(this, (b) => ' "' + b.key.displayName + '" ')
10666
- .join(', ');
10667
- return `ReflectiveInjector(providers: [${providers}])`;
10668
- }
10669
- toString() {
10670
- return this.displayName;
10935
+ if (shouldThrowErrorOnUnknownProperty) {
10936
+ throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
10671
10937
  }
10672
- }
10673
- ReflectiveInjector_.INJECTOR_KEY = ( /* @__PURE__ */ReflectiveKey.get(Injector));
10674
- function _mapProviders(injector, fn) {
10675
- const res = [];
10676
- for (let i = 0; i < injector._providers.length; ++i) {
10677
- res[i] = fn(injector.getProviderAtIndex(i));
10938
+ else {
10939
+ console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
10678
10940
  }
10679
- return res;
10680
10941
  }
10681
-
10682
10942
  /**
10683
- * @license
10684
- * Copyright Google LLC All Rights Reserved.
10943
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
10944
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
10945
+ * be too slow for production mode and also it relies on the constructor function being available.
10685
10946
  *
10686
- * Use of this source code is governed by an MIT-style license that can be
10687
- * found in the LICENSE file at https://angular.io/license
10688
- */
10689
-
10690
- /**
10691
- * @license
10692
- * Copyright Google LLC All Rights Reserved.
10947
+ * Gets a reference to the host component def (where a current component is declared).
10693
10948
  *
10694
- * Use of this source code is governed by an MIT-style license that can be
10695
- * found in the LICENSE file at https://angular.io/license
10949
+ * @param lView An `LView` that represents a current component that is being rendered.
10696
10950
  */
10697
-
10951
+ function getDeclarationComponentDef(lView) {
10952
+ !ngDevMode && throwError('Must never be called in production mode');
10953
+ const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
10954
+ const context = declarationLView[CONTEXT];
10955
+ // Unable to obtain a context.
10956
+ if (!context)
10957
+ return null;
10958
+ return context.constructor ? getComponentDef$1(context.constructor) : null;
10959
+ }
10698
10960
  /**
10699
- * @license
10700
- * Copyright Google LLC All Rights Reserved.
10961
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
10962
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
10963
+ * be too slow for production mode.
10701
10964
  *
10702
- * Use of this source code is governed by an MIT-style license that can be
10703
- * found in the LICENSE file at https://angular.io/license
10965
+ * Checks if the current component is declared inside of a standalone component template.
10966
+ *
10967
+ * @param lView An `LView` that represents a current component that is being rendered.
10704
10968
  */
10705
- function ɵɵdirectiveInject(token, flags = InjectFlags.Default) {
10706
- const lView = getLView();
10707
- // Fall back to inject() if view hasn't been created. This situation can happen in tests
10708
- // if inject utilities are used before bootstrapping.
10709
- if (lView === null) {
10710
- // Verify that we will not get into infinite loop.
10711
- ngDevMode && assertInjectImplementationNotEqual(ɵɵdirectiveInject);
10712
- return ɵɵinject(token, flags);
10713
- }
10714
- const tNode = getCurrentTNode();
10715
- return getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);
10969
+ function isHostComponentStandalone(lView) {
10970
+ !ngDevMode && throwError('Must never be called in production mode');
10971
+ const componentDef = getDeclarationComponentDef(lView);
10972
+ // Treat host component as non-standalone if we can't obtain the def.
10973
+ return !!componentDef?.standalone;
10716
10974
  }
10717
10975
  /**
10718
- * Throws an error indicating that a factory function could not be generated by the compiler for a
10719
- * particular class.
10720
- *
10721
- * This instruction allows the actual error message to be optimized away when ngDevMode is turned
10722
- * off, saving bytes of generated code while still providing a good experience in dev mode.
10976
+ * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
10977
+ * and must **not** be used in production bundles. The function makes megamorphic reads, which might
10978
+ * be too slow for production mode.
10723
10979
  *
10724
- * The name of the class is not mentioned here, but will be in the generated factory function name
10725
- * and thus in the stack trace.
10980
+ * Constructs a string describing the location of the host component template. The function is used
10981
+ * in dev mode to produce error messages.
10726
10982
  *
10727
- * @codeGenApi
10983
+ * @param lView An `LView` that represents a current component that is being rendered.
10728
10984
  */
10729
- function ɵɵinvalidFactory() {
10730
- const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';
10731
- throw new Error(msg);
10985
+ function getTemplateLocationDetails(lView) {
10986
+ !ngDevMode && throwError('Must never be called in production mode');
10987
+ const hostComponentDef = getDeclarationComponentDef(lView);
10988
+ const componentClassName = hostComponentDef?.type?.name;
10989
+ return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
10990
+ }
10991
+ /**
10992
+ * The set of known control flow directives.
10993
+ * We use this set to produce a more precises error message with a note
10994
+ * that the `CommonModule` should also be included.
10995
+ */
10996
+ const KNOWN_CONTROL_FLOW_DIRECTIVES = new Set(['ngIf', 'ngFor', 'ngSwitch', 'ngSwitchCase', 'ngSwitchDefault']);
10997
+ /**
10998
+ * Returns true if the tag name is allowed by specified schemas.
10999
+ * @param schemas Array of schemas
11000
+ * @param tagName Name of the tag
11001
+ */
11002
+ function matchingSchemas(schemas, tagName) {
11003
+ if (schemas !== null) {
11004
+ for (let i = 0; i < schemas.length; i++) {
11005
+ const schema = schemas[i];
11006
+ if (schema === NO_ERRORS_SCHEMA ||
11007
+ schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {
11008
+ return true;
11009
+ }
11010
+ }
11011
+ }
11012
+ return false;
10732
11013
  }
10733
11014
 
10734
11015
  /**
@@ -11522,36 +11803,21 @@ class LContainerDebug {
11522
11803
  }
11523
11804
  get parent() {
11524
11805
  return toDebug(this._raw_lContainer[PARENT]);
11525
- }
11526
- get movedViews() {
11527
- return this._raw_lContainer[MOVED_VIEWS];
11528
- }
11529
- get host() {
11530
- return this._raw_lContainer[HOST];
11531
- }
11532
- get native() {
11533
- return this._raw_lContainer[NATIVE];
11534
- }
11535
- get next() {
11536
- return toDebug(this._raw_lContainer[NEXT]);
11537
- }
11538
- }
11539
-
11540
- let shouldThrowErrorOnUnknownProperty = false;
11541
- /**
11542
- * Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
11543
- * instead of just logging the error.
11544
- * (for AOT-compiled ones this check happens at build time).
11545
- */
11546
- function ɵsetUnknownPropertyStrictMode(shouldThrow) {
11547
- shouldThrowErrorOnUnknownProperty = shouldThrow;
11548
- }
11549
- /**
11550
- * Gets the current value of the strict mode.
11551
- */
11552
- function ɵgetUnknownPropertyStrictMode() {
11553
- return shouldThrowErrorOnUnknownProperty;
11806
+ }
11807
+ get movedViews() {
11808
+ return this._raw_lContainer[MOVED_VIEWS];
11809
+ }
11810
+ get host() {
11811
+ return this._raw_lContainer[HOST];
11812
+ }
11813
+ get native() {
11814
+ return this._raw_lContainer[NATIVE];
11815
+ }
11816
+ get next() {
11817
+ return toDebug(this._raw_lContainer[NEXT]);
11818
+ }
11554
11819
  }
11820
+
11555
11821
  /**
11556
11822
  * A permanent marker promise which signifies that the current CD tree is
11557
11823
  * clean.
@@ -11710,55 +11976,6 @@ function createTNodeAtIndex(tView, index, type, name, attrs) {
11710
11976
  }
11711
11977
  return tNode;
11712
11978
  }
11713
- /**
11714
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
11715
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
11716
- * be too slow for production mode and also it relies on the constructor function being available.
11717
- *
11718
- * Gets a reference to the host component def (where a current component is declared).
11719
- *
11720
- * @param lView An `LView` that represents a current component that is being rendered.
11721
- */
11722
- function getDeclarationComponentDef(lView) {
11723
- !ngDevMode && throwError('Must never be called in production mode');
11724
- const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
11725
- const context = declarationLView[CONTEXT];
11726
- // Unable to obtain a context.
11727
- if (!context)
11728
- return null;
11729
- return context.constructor ? getComponentDef$1(context.constructor) : null;
11730
- }
11731
- /**
11732
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
11733
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
11734
- * be too slow for production mode.
11735
- *
11736
- * Checks if the current component is declared inside of a standalone component template.
11737
- *
11738
- * @param lView An `LView` that represents a current component that is being rendered.
11739
- */
11740
- function isHostComponentStandalone(lView) {
11741
- !ngDevMode && throwError('Must never be called in production mode');
11742
- const componentDef = getDeclarationComponentDef(lView);
11743
- // Treat host component as non-standalone if we can't obtain the def.
11744
- return !!(componentDef?.standalone);
11745
- }
11746
- /**
11747
- * WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
11748
- * and must **not** be used in production bundles. The function makes megamorphic reads, which might
11749
- * be too slow for production mode.
11750
- *
11751
- * Constructs a string describing the location of the host component template. The function is used
11752
- * in dev mode to produce error messages.
11753
- *
11754
- * @param lView An `LView` that represents a current component that is being rendered.
11755
- */
11756
- function getTemplateLocationDetails(lView) {
11757
- !ngDevMode && throwError('Must never be called in production mode');
11758
- const hostComponentDef = getDeclarationComponentDef(lView);
11759
- const componentClassName = hostComponentDef?.type?.name;
11760
- return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
11761
- }
11762
11979
  /**
11763
11980
  * When elements are created dynamically after a view blueprint is created (e.g. through
11764
11981
  * i18nApply()), we need to adjust the blueprint for future
@@ -12425,10 +12642,8 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
12425
12642
  propName = mapPropName(propName);
12426
12643
  if (ngDevMode) {
12427
12644
  validateAgainstEventProperties(propName);
12428
- if (!validateProperty(element, tNode.value, propName, tView.schemas)) {
12429
- // Return here since we only log warnings for unknown properties.
12430
- handleUnknownPropertyError(propName, tNode, lView);
12431
- return;
12645
+ if (!isPropertyValid(element, propName, tNode.value, tView.schemas)) {
12646
+ handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
12432
12647
  }
12433
12648
  ngDevMode.rendererSetProperty++;
12434
12649
  }
@@ -12447,7 +12662,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
12447
12662
  // If the node is a container and the property didn't
12448
12663
  // match any of the inputs or schemas we should throw.
12449
12664
  if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
12450
- handleUnknownPropertyError(propName, tNode, lView);
12665
+ handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);
12451
12666
  }
12452
12667
  }
12453
12668
  }
@@ -12499,116 +12714,6 @@ function setNgReflectProperties(lView, element, type, dataValue, value) {
12499
12714
  }
12500
12715
  }
12501
12716
  }
12502
- /**
12503
- * Validates that the property of the element is known at runtime and returns
12504
- * false if it's not the case.
12505
- * This check is relevant for JIT-compiled components (for AOT-compiled
12506
- * ones this check happens at build time).
12507
- *
12508
- * The property is considered known if either:
12509
- * - it's a known property of the element
12510
- * - the element is allowed by one of the schemas
12511
- * - the property is used for animations
12512
- *
12513
- * @param element Element to validate
12514
- * @param tagName Name of the tag to check
12515
- * @param propName Name of the property to check
12516
- * @param schemas Array of schemas
12517
- */
12518
- function validateProperty(element, tagName, propName, schemas) {
12519
- // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
12520
- // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
12521
- // defined as an array (as an empty array in case `schemas` field is not defined) and we should
12522
- // execute the check below.
12523
- if (schemas === null)
12524
- return true;
12525
- // The property is considered valid if the element matches the schema, it exists on the element,
12526
- // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
12527
- if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
12528
- return true;
12529
- }
12530
- // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
12531
- // need to account for both here, while being careful with `typeof null` also returning 'object'.
12532
- return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
12533
- }
12534
- /**
12535
- * Returns true if the tag name is allowed by specified schemas.
12536
- * @param schemas Array of schemas
12537
- * @param tagName Name of the tag
12538
- */
12539
- function matchingSchemas(schemas, tagName) {
12540
- if (schemas !== null) {
12541
- for (let i = 0; i < schemas.length; i++) {
12542
- const schema = schemas[i];
12543
- if (schema === NO_ERRORS_SCHEMA ||
12544
- schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {
12545
- return true;
12546
- }
12547
- }
12548
- }
12549
- return false;
12550
- }
12551
- /**
12552
- * The set of known control flow directives.
12553
- * We use this set to produce a more precises error message with a note
12554
- * that the `CommonModule` should also be included.
12555
- */
12556
- const KNOWN_CONTROL_FLOW_DIRECTIVES = new Set(['ngIf', 'ngFor', 'ngSwitch', 'ngSwitchCase', 'ngSwitchDefault']);
12557
- /**
12558
- * Logs or throws an error that a property is not supported on an element.
12559
- *
12560
- * @param propName Name of the invalid property.
12561
- * @param tNode A `TNode` that represents a current component that is being rendered.
12562
- * @param lView An `LView` that represents a current component that is being rendered.
12563
- */
12564
- function handleUnknownPropertyError(propName, tNode, lView) {
12565
- let tagName = tNode.value;
12566
- // Special-case a situation when a structural directive is applied to
12567
- // an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
12568
- // In this case the compiler generates the `ɵɵtemplate` instruction with
12569
- // the `null` as the tagName. The directive matching logic at runtime relies
12570
- // on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
12571
- // a default value of the `tNode.value` is not feasible at this moment.
12572
- if (!tagName && tNode.type === 4 /* TNodeType.Container */) {
12573
- tagName = 'ng-template';
12574
- }
12575
- const isHostStandalone = isHostComponentStandalone(lView);
12576
- const templateLocation = getTemplateLocationDetails(lView);
12577
- let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
12578
- const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
12579
- const importLocation = isHostStandalone ?
12580
- 'included in the \'@Component.imports\' of this component' :
12581
- 'a part of an @NgModule where this component is declared';
12582
- if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
12583
- // Most likely this is a control flow directive (such as `*ngIf`) used in
12584
- // a template, but the `CommonModule` is not imported.
12585
- message += `\nIf the '${propName}' is an Angular control flow directive, ` +
12586
- `please make sure that the 'CommonModule' is ${importLocation}.`;
12587
- }
12588
- else {
12589
- // May be an Angular component, which is not imported/declared?
12590
- message += `\n1. If '${tagName}' is an Angular component and it has the ` +
12591
- `'${propName}' input, then verify that it is ${importLocation}.`;
12592
- // May be a Web Component?
12593
- if (tagName && tagName.indexOf('-') > -1) {
12594
- message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
12595
- `to the ${schemas} of this component to suppress this message.`;
12596
- message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
12597
- `the ${schemas} of this component.`;
12598
- }
12599
- else {
12600
- // If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
12601
- message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
12602
- `the ${schemas} of this component.`;
12603
- }
12604
- }
12605
- if (shouldThrowErrorOnUnknownProperty) {
12606
- throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
12607
- }
12608
- else {
12609
- console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
12610
- }
12611
- }
12612
12717
  /**
12613
12718
  * Instantiate a root component.
12614
12719
  */
@@ -14182,7 +14287,11 @@ function createRootComponent(componentView, componentDef, rootLView, rootContext
14182
14287
  const component = instantiateRootComponent(tView, rootLView, componentDef);
14183
14288
  rootContext.components.push(component);
14184
14289
  componentView[CONTEXT] = component;
14185
- hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef));
14290
+ if (hostFeatures !== null) {
14291
+ for (const feature of hostFeatures) {
14292
+ feature(component, componentDef);
14293
+ }
14294
+ }
14186
14295
  // We want to generate an empty QueryList for root content queries for backwards
14187
14296
  // compatibility with ViewEngine.
14188
14297
  if (componentDef.contentQueries) {
@@ -14223,13 +14332,10 @@ function createRootContext(scheduler, playerHandler) {
14223
14332
  * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
14224
14333
  * ```
14225
14334
  */
14226
- function LifecycleHooksFeature(component, def) {
14227
- const lView = readPatchedLView(component);
14228
- ngDevMode && assertDefined(lView, 'LView is required');
14229
- const tView = lView[TVIEW];
14335
+ function LifecycleHooksFeature() {
14230
14336
  const tNode = getCurrentTNode();
14231
14337
  ngDevMode && assertDefined(tNode, 'TNode is required');
14232
- registerPostOrderHooks(tView, tNode);
14338
+ registerPostOrderHooks(getLView()[TVIEW], tNode);
14233
14339
  }
14234
14340
  /**
14235
14341
  * Wait on component until it is rendered.
@@ -15364,21 +15470,6 @@ function setDirectiveInputsWhichShadowsStyling(tView, tNode, lView, value, isCla
15364
15470
  * Use of this source code is governed by an MIT-style license that can be
15365
15471
  * found in the LICENSE file at https://angular.io/license
15366
15472
  */
15367
- let shouldThrowErrorOnUnknownElement = false;
15368
- /**
15369
- * Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
15370
- * instead of just logging the error.
15371
- * (for AOT-compiled ones this check happens at build time).
15372
- */
15373
- function ɵsetUnknownElementStrictMode(shouldThrow) {
15374
- shouldThrowErrorOnUnknownElement = shouldThrow;
15375
- }
15376
- /**
15377
- * Gets the current value of the strict mode.
15378
- */
15379
- function ɵgetUnknownElementStrictMode() {
15380
- return shouldThrowErrorOnUnknownElement;
15381
- }
15382
15473
  function elementStartFirstCreatePass(index, tView, lView, native, name, attrsIndex, localRefsIndex) {
15383
15474
  ngDevMode && assertFirstCreatePass(tView);
15384
15475
  ngDevMode && ngDevMode.firstCreatePass++;
@@ -15512,67 +15603,6 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
15512
15603
  ɵɵelementEnd();
15513
15604
  return ɵɵelement;
15514
15605
  }
15515
- /**
15516
- * Validates that the element is known at runtime and produces
15517
- * an error if it's not the case.
15518
- * This check is relevant for JIT-compiled components (for AOT-compiled
15519
- * ones this check happens at build time).
15520
- *
15521
- * The element is considered known if either:
15522
- * - it's a known HTML element
15523
- * - it's a known custom element
15524
- * - the element matches any directive
15525
- * - the element is allowed by one of the schemas
15526
- *
15527
- * @param element Element to validate
15528
- * @param lView An `LView` that represents a current component that is being rendered.
15529
- * @param tagName Name of the tag to check
15530
- * @param schemas Array of schemas
15531
- * @param hasDirectives Boolean indicating that the element matches any directive
15532
- */
15533
- function validateElementIsKnown(element, lView, tagName, schemas, hasDirectives) {
15534
- // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
15535
- // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
15536
- // defined as an array (as an empty array in case `schemas` field is not defined) and we should
15537
- // execute the check below.
15538
- if (schemas === null)
15539
- return;
15540
- // If the element matches any directive, it's considered as valid.
15541
- if (!hasDirectives && tagName !== null) {
15542
- // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
15543
- // as a custom element. Note that unknown elements with a dash in their name won't be instances
15544
- // of HTMLUnknownElement in browsers that support web components.
15545
- const isUnknown =
15546
- // Note that we can't check for `typeof HTMLUnknownElement === 'function'`,
15547
- // because while most browsers return 'function', IE returns 'object'.
15548
- (typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement &&
15549
- element instanceof HTMLUnknownElement) ||
15550
- (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
15551
- !customElements.get(tagName));
15552
- if (isUnknown && !matchingSchemas(schemas, tagName)) {
15553
- const isHostStandalone = isHostComponentStandalone(lView);
15554
- const templateLocation = getTemplateLocationDetails(lView);
15555
- const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
15556
- let message = `'${tagName}' is not a known element${templateLocation}:\n`;
15557
- message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? 'included in the \'@Component.imports\' of this component' :
15558
- 'a part of an @NgModule where this component is declared'}.\n`;
15559
- if (tagName && tagName.indexOf('-') > -1) {
15560
- message +=
15561
- `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
15562
- }
15563
- else {
15564
- message +=
15565
- `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
15566
- }
15567
- if (shouldThrowErrorOnUnknownElement) {
15568
- throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
15569
- }
15570
- else {
15571
- console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
15572
- }
15573
- }
15574
- }
15575
- }
15576
15606
 
15577
15607
  /**
15578
15608
  * @license
@@ -22055,7 +22085,7 @@ class Version {
22055
22085
  /**
22056
22086
  * @publicApi
22057
22087
  */
22058
- const VERSION = new Version('14.0.0-rc.3');
22088
+ const VERSION = new Version('14.0.2');
22059
22089
 
22060
22090
  /**
22061
22091
  * @license
@@ -22727,6 +22757,7 @@ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
22727
22757
  * Create a new environment injector.
22728
22758
  *
22729
22759
  * @publicApi
22760
+ * @developerPreview
22730
22761
  */
22731
22762
  function createEnvironmentInjector(providers, parent = null, debugName = null) {
22732
22763
  const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
@@ -22754,14 +22785,14 @@ class StandaloneService {
22754
22785
  if (!componentDef.standalone) {
22755
22786
  return null;
22756
22787
  }
22757
- if (!this.cachedInjectors.has(componentDef)) {
22788
+ if (!this.cachedInjectors.has(componentDef.id)) {
22758
22789
  const providers = internalImportProvidersFrom(false, componentDef.type);
22759
22790
  const standaloneInjector = providers.length > 0 ?
22760
22791
  createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
22761
22792
  null;
22762
- this.cachedInjectors.set(componentDef, standaloneInjector);
22793
+ this.cachedInjectors.set(componentDef.id, standaloneInjector);
22763
22794
  }
22764
- return this.cachedInjectors.get(componentDef);
22795
+ return this.cachedInjectors.get(componentDef.id);
22765
22796
  }
22766
22797
  ngOnDestroy() {
22767
22798
  try {
@@ -23261,13 +23292,26 @@ function getPipeDef(name, registry) {
23261
23292
  }
23262
23293
  }
23263
23294
  if (ngDevMode) {
23264
- const lView = getLView();
23265
- const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
23266
- const context = declarationLView[CONTEXT];
23267
- const component = context ? ` in the '${context.constructor.name}' component` : '';
23268
- throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, `The pipe '${name}' could not be found${component}!`);
23295
+ throw new RuntimeError(-302 /* RuntimeErrorCode.PIPE_NOT_FOUND */, getPipeNotFoundErrorMessage(name));
23269
23296
  }
23270
23297
  }
23298
+ /**
23299
+ * Generates a helpful error message for the user when a pipe is not found.
23300
+ *
23301
+ * @param name Name of the missing pipe
23302
+ * @returns The error message
23303
+ */
23304
+ function getPipeNotFoundErrorMessage(name) {
23305
+ const lView = getLView();
23306
+ const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
23307
+ const context = declarationLView[CONTEXT];
23308
+ const hostIsStandalone = isHostComponentStandalone(lView);
23309
+ const componentInfoMessage = context ? ` in the '${context.constructor.name}' component` : '';
23310
+ const verifyMessage = `Verify that it is ${hostIsStandalone ? 'included in the \'@Component.imports\' of this component' :
23311
+ 'declared or imported in this module'}`;
23312
+ const errorMessage = `The pipe '${name}' could not be found${componentInfoMessage}. ${verifyMessage}`;
23313
+ return errorMessage;
23314
+ }
23271
23315
  /**
23272
23316
  * Invokes a pipe with 1 arguments.
23273
23317
  *
@@ -25058,6 +25102,7 @@ function setScopeOnDeclaredComponents(moduleType, ngModule) {
25058
25102
  const declarations = flatten$1(ngModule.declarations || EMPTY_ARRAY);
25059
25103
  const transitiveScopes = transitiveScopesFor(moduleType);
25060
25104
  declarations.forEach(declaration => {
25105
+ declaration = resolveForwardRef(declaration);
25061
25106
  if (declaration.hasOwnProperty(NG_COMP_DEF)) {
25062
25107
  // A `ɵcmp` field exists - go ahead and patch the component directly.
25063
25108
  const component = declaration;
@@ -25088,7 +25133,7 @@ function patchComponentDefWithScope(componentDef, transitiveScopes) {
25088
25133
  }
25089
25134
  /**
25090
25135
  * Compute the pair of transitive scopes (compilation scope and exported scope) for a given type
25091
- * (eaither a NgModule or a standalone component / directive / pipe).
25136
+ * (either a NgModule or a standalone component / directive / pipe).
25092
25137
  */
25093
25138
  function transitiveScopesFor(type) {
25094
25139
  if (isNgModule(type)) {