@angular/core 14.1.0-next.3 → 14.1.0-next.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.
Files changed (41) hide show
  1. package/esm2020/src/application_ref.mjs +1 -1
  2. package/esm2020/src/core.mjs +1 -1
  3. package/esm2020/src/core_render3_private_export.mjs +2 -2
  4. package/esm2020/src/debug/debug_node.mjs +2 -3
  5. package/esm2020/src/di/index.mjs +1 -1
  6. package/esm2020/src/di/injector_compatibility.mjs +11 -1
  7. package/esm2020/src/di/interface/injector.mjs +2 -1
  8. package/esm2020/src/di/r3_injector.mjs +13 -1
  9. package/esm2020/src/errors.mjs +1 -1
  10. package/esm2020/src/linker/component_factory.mjs +1 -1
  11. package/esm2020/src/metadata/di.mjs +1 -1
  12. package/esm2020/src/render/api.mjs +2 -11
  13. package/esm2020/src/render3/component.mjs +3 -58
  14. package/esm2020/src/render3/component_ref.mjs +30 -5
  15. package/esm2020/src/render3/index.mjs +3 -3
  16. package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
  17. package/esm2020/src/render3/instructions/listener.mjs +34 -44
  18. package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
  19. package/esm2020/src/render3/instructions/shared.mjs +22 -59
  20. package/esm2020/src/render3/instructions/styling.mjs +2 -2
  21. package/esm2020/src/render3/interfaces/renderer.mjs +1 -26
  22. package/esm2020/src/render3/interfaces/view.mjs +1 -1
  23. package/esm2020/src/render3/ng_module_ref.mjs +4 -1
  24. package/esm2020/src/render3/node_manipulation.mjs +24 -87
  25. package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
  26. package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
  27. package/esm2020/src/render3/util/view_utils.mjs +3 -6
  28. package/esm2020/src/version.mjs +1 -1
  29. package/esm2020/testing/src/logger.mjs +3 -3
  30. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  31. package/fesm2015/core.mjs +1798 -1946
  32. package/fesm2015/core.mjs.map +1 -1
  33. package/fesm2015/testing.mjs +1429 -1669
  34. package/fesm2015/testing.mjs.map +1 -1
  35. package/fesm2020/core.mjs +1798 -1946
  36. package/fesm2020/core.mjs.map +1 -1
  37. package/fesm2020/testing.mjs +1429 -1669
  38. package/fesm2020/testing.mjs.map +1 -1
  39. package/index.d.ts +138 -128
  40. package/package.json +1 -1
  41. package/testing/index.d.ts +1 -1
package/fesm2015/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.3
2
+ * @license Angular v14.1.0-next.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -499,6 +499,7 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
499
499
  * Injection flags for DI.
500
500
  *
501
501
  * @publicApi
502
+ * @deprecated use an options object for `inject` instead.
502
503
  */
503
504
  var InjectFlags;
504
505
  (function (InjectFlags) {
@@ -1586,96 +1587,6 @@ function getNamespaceUri(namespace) {
1586
1587
  (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
1587
1588
  }
1588
1589
 
1589
- /**
1590
- * @license
1591
- * Copyright Google LLC All Rights Reserved.
1592
- *
1593
- * Use of this source code is governed by an MIT-style license that can be
1594
- * found in the LICENSE file at https://angular.io/license
1595
- */
1596
- /**
1597
- * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
1598
- * inject the `DOCUMENT` token and are done.
1599
- *
1600
- * Ivy is special because it does not rely upon the DI and must get hold of the document some other
1601
- * way.
1602
- *
1603
- * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
1604
- * Wherever ivy needs the global document, it calls `getDocument()` instead.
1605
- *
1606
- * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
1607
- * tell ivy what the global `document` is.
1608
- *
1609
- * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
1610
- * by calling `setDocument()` when providing the `DOCUMENT` token.
1611
- */
1612
- let DOCUMENT = undefined;
1613
- /**
1614
- * Tell ivy what the `document` is for this platform.
1615
- *
1616
- * It is only necessary to call this if the current platform is not a browser.
1617
- *
1618
- * @param document The object representing the global `document` in this environment.
1619
- */
1620
- function setDocument(document) {
1621
- DOCUMENT = document;
1622
- }
1623
- /**
1624
- * Access the object that represents the `document` for this platform.
1625
- *
1626
- * Ivy calls this whenever it needs to access the `document` object.
1627
- * For example to create the renderer or to do sanitization.
1628
- */
1629
- function getDocument() {
1630
- if (DOCUMENT !== undefined) {
1631
- return DOCUMENT;
1632
- }
1633
- else if (typeof document !== 'undefined') {
1634
- return document;
1635
- }
1636
- // No "document" can be found. This should only happen if we are running ivy outside Angular and
1637
- // the current platform is not a browser. Since this is not a supported scenario at the moment
1638
- // this should not happen in Angular apps.
1639
- // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
1640
- // public API. Meanwhile we just return `undefined` and let the application fail.
1641
- return undefined;
1642
- }
1643
-
1644
- /**
1645
- * @license
1646
- * Copyright Google LLC All Rights Reserved.
1647
- *
1648
- * Use of this source code is governed by an MIT-style license that can be
1649
- * found in the LICENSE file at https://angular.io/license
1650
- */
1651
- // TODO: cleanup once the code is merged in angular/angular
1652
- var RendererStyleFlags3;
1653
- (function (RendererStyleFlags3) {
1654
- RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
1655
- RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
1656
- })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
1657
- /** Returns whether the `renderer` is a `ProceduralRenderer3` */
1658
- function isProceduralRenderer(renderer) {
1659
- return !!(renderer.listen);
1660
- }
1661
- let renderer3Enabled = false;
1662
- function enableRenderer3() {
1663
- renderer3Enabled = true;
1664
- }
1665
- const domRendererFactory3 = {
1666
- createRenderer: (hostElement, rendererType) => {
1667
- if (!renderer3Enabled) {
1668
- throw new Error(ngDevMode ?
1669
- `Renderer3 is not supported. This problem is likely caused by some component in the hierarchy was constructed without a correct parent injector.` :
1670
- 'Renderer3 disabled');
1671
- }
1672
- return getDocument();
1673
- }
1674
- };
1675
- // Note: This hack is necessary so we don't erroneously get a circular dependency
1676
- // failure based on types.
1677
- const unusedValueExportToPlacateAjd$6 = 1;
1678
-
1679
1590
  /**
1680
1591
  * @license
1681
1592
  * Copyright Google LLC All Rights Reserved.
@@ -1758,7 +1669,6 @@ function getNativeByTNode(tNode, lView) {
1758
1669
  ngDevMode && assertTNodeForLView(tNode, lView);
1759
1670
  ngDevMode && assertIndexInRange(lView, tNode.index);
1760
1671
  const node = unwrapRNode(lView[tNode.index]);
1761
- ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1762
1672
  return node;
1763
1673
  }
1764
1674
  /**
@@ -1774,7 +1684,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
1774
1684
  if (index !== -1) {
1775
1685
  ngDevMode && assertTNodeForLView(tNode, lView);
1776
1686
  const node = unwrapRNode(lView[index]);
1777
- ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1778
1687
  return node;
1779
1688
  }
1780
1689
  return null;
@@ -2723,7 +2632,7 @@ function isFactory(obj) {
2723
2632
  }
2724
2633
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2725
2634
  // failure based on types.
2726
- const unusedValueExportToPlacateAjd$5 = 1;
2635
+ const unusedValueExportToPlacateAjd$6 = 1;
2727
2636
 
2728
2637
  /**
2729
2638
  * Converts `TNodeType` into human readable text.
@@ -2742,7 +2651,7 @@ function toTNodeTypeAsString(tNodeType) {
2742
2651
  }
2743
2652
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2744
2653
  // failure based on types.
2745
- const unusedValueExportToPlacateAjd$4 = 1;
2654
+ const unusedValueExportToPlacateAjd$5 = 1;
2746
2655
  /**
2747
2656
  * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
2748
2657
  *
@@ -2846,7 +2755,6 @@ function assertPureTNodeType(type) {
2846
2755
  * @returns the index value that was last accessed in the attributes array
2847
2756
  */
2848
2757
  function setUpAttributes(renderer, native, attrs) {
2849
- const isProc = isProceduralRenderer(renderer);
2850
2758
  let i = 0;
2851
2759
  while (i < attrs.length) {
2852
2760
  const value = attrs[i];
@@ -2863,9 +2771,7 @@ function setUpAttributes(renderer, native, attrs) {
2863
2771
  const attrName = attrs[i++];
2864
2772
  const attrVal = attrs[i++];
2865
2773
  ngDevMode && ngDevMode.rendererSetAttribute++;
2866
- isProc ?
2867
- renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
2868
- native.setAttributeNS(namespaceURI, attrName, attrVal);
2774
+ renderer.setAttribute(native, attrName, attrVal, namespaceURI);
2869
2775
  }
2870
2776
  else {
2871
2777
  // attrName is string;
@@ -2874,14 +2780,10 @@ function setUpAttributes(renderer, native, attrs) {
2874
2780
  // Standard attributes
2875
2781
  ngDevMode && ngDevMode.rendererSetAttribute++;
2876
2782
  if (isAnimationProp(attrName)) {
2877
- if (isProc) {
2878
- renderer.setProperty(native, attrName, attrVal);
2879
- }
2783
+ renderer.setProperty(native, attrName, attrVal);
2880
2784
  }
2881
2785
  else {
2882
- isProc ?
2883
- renderer.setAttribute(native, attrName, attrVal) :
2884
- native.setAttribute(attrName, attrVal);
2786
+ renderer.setAttribute(native, attrName, attrVal);
2885
2787
  }
2886
2788
  i++;
2887
2789
  }
@@ -4940,6 +4842,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
4940
4842
  * @publicApi
4941
4843
  */
4942
4844
  function inject(token, flags = InjectFlags.Default) {
4845
+ if (typeof flags !== 'number') {
4846
+ // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
4847
+ // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
4848
+ // `InjectOptions` to `InjectFlags`.
4849
+ flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
4850
+ (flags.optional && 8 /* InternalInjectFlags.Optional */) |
4851
+ (flags.host && 1 /* InternalInjectFlags.Host */) |
4852
+ (flags.self && 2 /* InternalInjectFlags.Self */) |
4853
+ (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
4854
+ }
4943
4855
  return ɵɵinject(token, flags);
4944
4856
  }
4945
4857
  function injectArgs(types) {
@@ -5323,6 +5235,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
5323
5235
  checkForDuplicateNgModules = !allowDuplicates;
5324
5236
  }
5325
5237
 
5238
+ /**
5239
+ * @license
5240
+ * Copyright Google LLC All Rights Reserved.
5241
+ *
5242
+ * Use of this source code is governed by an MIT-style license that can be
5243
+ * found in the LICENSE file at https://angular.io/license
5244
+ */
5245
+ /**
5246
+ * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
5247
+ * inject the `DOCUMENT` token and are done.
5248
+ *
5249
+ * Ivy is special because it does not rely upon the DI and must get hold of the document some other
5250
+ * way.
5251
+ *
5252
+ * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
5253
+ * Wherever ivy needs the global document, it calls `getDocument()` instead.
5254
+ *
5255
+ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
5256
+ * tell ivy what the global `document` is.
5257
+ *
5258
+ * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
5259
+ * by calling `setDocument()` when providing the `DOCUMENT` token.
5260
+ */
5261
+ let DOCUMENT = undefined;
5262
+ /**
5263
+ * Tell ivy what the `document` is for this platform.
5264
+ *
5265
+ * It is only necessary to call this if the current platform is not a browser.
5266
+ *
5267
+ * @param document The object representing the global `document` in this environment.
5268
+ */
5269
+ function setDocument(document) {
5270
+ DOCUMENT = document;
5271
+ }
5272
+ /**
5273
+ * Access the object that represents the `document` for this platform.
5274
+ *
5275
+ * Ivy calls this whenever it needs to access the `document` object.
5276
+ * For example to create the renderer or to do sanitization.
5277
+ */
5278
+ function getDocument() {
5279
+ if (DOCUMENT !== undefined) {
5280
+ return DOCUMENT;
5281
+ }
5282
+ else if (typeof document !== 'undefined') {
5283
+ return document;
5284
+ }
5285
+ // No "document" can be found. This should only happen if we are running ivy outside Angular and
5286
+ // the current platform is not a browser. Since this is not a supported scenario at the moment
5287
+ // this should not happen in Angular apps.
5288
+ // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
5289
+ // public API. Meanwhile we just return `undefined` and let the application fail.
5290
+ return undefined;
5291
+ }
5292
+
5326
5293
  /**
5327
5294
  * @license
5328
5295
  * Copyright Google LLC All Rights Reserved.
@@ -7058,6 +7025,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
7058
7025
  }
7059
7026
  }
7060
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
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
7036
+ // failure based on types.
7037
+ const unusedValueExportToPlacateAjd$4 = 1;
7038
+
7061
7039
  /**
7062
7040
  * @license
7063
7041
  * Copyright Google LLC All Rights Reserved.
@@ -7140,7 +7118,7 @@ function getNearestLContainer(viewOrContainer) {
7140
7118
  * Use of this source code is governed by an MIT-style license that can be
7141
7119
  * found in the LICENSE file at https://angular.io/license
7142
7120
  */
7143
- const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$7;
7121
+ const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$8 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$7;
7144
7122
  /**
7145
7123
  * NOTE: for performance reasons, the possible actions are inlined within the function instead of
7146
7124
  * being passed as an argument.
@@ -7165,7 +7143,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7165
7143
  lNodeToHandle = lNodeToHandle[HOST];
7166
7144
  }
7167
7145
  const rNode = unwrapRNode(lNodeToHandle);
7168
- ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
7169
7146
  if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
7170
7147
  if (beforeNode == null) {
7171
7148
  nativeAppendChild(renderer, parent, rNode);
@@ -7192,17 +7169,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7192
7169
  function createTextNode(renderer, value) {
7193
7170
  ngDevMode && ngDevMode.rendererCreateTextNode++;
7194
7171
  ngDevMode && ngDevMode.rendererSetText++;
7195
- return isProceduralRenderer(renderer) ? renderer.createText(value) :
7196
- renderer.createTextNode(value);
7172
+ return renderer.createText(value);
7197
7173
  }
7198
7174
  function updateTextNode(renderer, rNode, value) {
7199
7175
  ngDevMode && ngDevMode.rendererSetText++;
7200
- isProceduralRenderer(renderer) ? renderer.setValue(rNode, value) : rNode.textContent = value;
7176
+ renderer.setValue(rNode, value);
7201
7177
  }
7202
7178
  function createCommentNode(renderer, value) {
7203
7179
  ngDevMode && ngDevMode.rendererCreateComment++;
7204
- // isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
7205
- // method name.
7206
7180
  return renderer.createComment(escapeCommentText(value));
7207
7181
  }
7208
7182
  /**
@@ -7214,14 +7188,7 @@ function createCommentNode(renderer, value) {
7214
7188
  */
7215
7189
  function createElementNode(renderer, name, namespace) {
7216
7190
  ngDevMode && ngDevMode.rendererCreateElement++;
7217
- if (isProceduralRenderer(renderer)) {
7218
- return renderer.createElement(name, namespace);
7219
- }
7220
- else {
7221
- const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
7222
- return namespaceUri === null ? renderer.createElement(name) :
7223
- renderer.createElementNS(namespaceUri, name);
7224
- }
7191
+ return renderer.createElement(name, namespace);
7225
7192
  }
7226
7193
  /**
7227
7194
  * Removes all DOM elements associated with a view.
@@ -7453,7 +7420,7 @@ function detachView(lContainer, removeIndex) {
7453
7420
  function destroyLView(tView, lView) {
7454
7421
  if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
7455
7422
  const renderer = lView[RENDERER];
7456
- if (isProceduralRenderer(renderer) && renderer.destroyNode) {
7423
+ if (renderer.destroyNode) {
7457
7424
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
7458
7425
  }
7459
7426
  destroyViewTree(lView);
@@ -7481,7 +7448,7 @@ function cleanUpView(tView, lView) {
7481
7448
  executeOnDestroys(tView, lView);
7482
7449
  processCleanups(tView, lView);
7483
7450
  // For component views only, the local renderer is destroyed at clean up time.
7484
- if (lView[TVIEW].type === 1 /* TViewType.Component */ && isProceduralRenderer(lView[RENDERER])) {
7451
+ if (lView[TVIEW].type === 1 /* TViewType.Component */) {
7485
7452
  ngDevMode && ngDevMode.rendererDestroy++;
7486
7453
  lView[RENDERER].destroy();
7487
7454
  }
@@ -7657,30 +7624,17 @@ function getClosestRElement(tView, tNode, lView) {
7657
7624
  }
7658
7625
  }
7659
7626
  /**
7660
- * Inserts a native node before another native node for a given parent using {@link Renderer3}.
7661
- * This is a utility function that can be used when native nodes were determined - it abstracts an
7662
- * actual renderer being used.
7627
+ * Inserts a native node before another native node for a given parent.
7628
+ * This is a utility function that can be used when native nodes were determined.
7663
7629
  */
7664
7630
  function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
7665
7631
  ngDevMode && ngDevMode.rendererInsertBefore++;
7666
- if (isProceduralRenderer(renderer)) {
7667
- renderer.insertBefore(parent, child, beforeNode, isMove);
7668
- }
7669
- else {
7670
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7671
- targetParent.insertBefore(child, beforeNode, isMove);
7672
- }
7632
+ renderer.insertBefore(parent, child, beforeNode, isMove);
7673
7633
  }
7674
7634
  function nativeAppendChild(renderer, parent, child) {
7675
7635
  ngDevMode && ngDevMode.rendererAppendChild++;
7676
7636
  ngDevMode && assertDefined(parent, 'parent node must be defined');
7677
- if (isProceduralRenderer(renderer)) {
7678
- renderer.appendChild(parent, child);
7679
- }
7680
- else {
7681
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7682
- targetParent.appendChild(child);
7683
- }
7637
+ renderer.appendChild(parent, child);
7684
7638
  }
7685
7639
  function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
7686
7640
  if (beforeNode !== null) {
@@ -7692,12 +7646,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
7692
7646
  }
7693
7647
  /** Removes a node from the DOM given its native parent. */
7694
7648
  function nativeRemoveChild(renderer, parent, child, isHostElement) {
7695
- if (isProceduralRenderer(renderer)) {
7696
- renderer.removeChild(parent, child, isHostElement);
7697
- }
7698
- else {
7699
- parent.removeChild(child);
7700
- }
7649
+ renderer.removeChild(parent, child, isHostElement);
7701
7650
  }
7702
7651
  /** Checks if an element is a `<template>` node. */
7703
7652
  function isTemplateNode(node) {
@@ -7707,13 +7656,13 @@ function isTemplateNode(node) {
7707
7656
  * Returns a native parent of a given native node.
7708
7657
  */
7709
7658
  function nativeParentNode(renderer, node) {
7710
- return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode);
7659
+ return renderer.parentNode(node);
7711
7660
  }
7712
7661
  /**
7713
7662
  * Returns a native sibling of a given native node.
7714
7663
  */
7715
7664
  function nativeNextSibling(renderer, node) {
7716
- return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;
7665
+ return renderer.nextSibling(node);
7717
7666
  }
7718
7667
  /**
7719
7668
  * Find a node in front of which `currentTNode` should be inserted.
@@ -8022,39 +7971,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
8022
7971
  * otherwise).
8023
7972
  */
8024
7973
  function applyStyling(renderer, isClassBased, rNode, prop, value) {
8025
- const isProcedural = isProceduralRenderer(renderer);
8026
7974
  if (isClassBased) {
8027
7975
  // We actually want JS true/false here because any truthy value should add the class
8028
7976
  if (!value) {
8029
7977
  ngDevMode && ngDevMode.rendererRemoveClass++;
8030
- if (isProcedural) {
8031
- renderer.removeClass(rNode, prop);
8032
- }
8033
- else {
8034
- rNode.classList.remove(prop);
8035
- }
7978
+ renderer.removeClass(rNode, prop);
8036
7979
  }
8037
7980
  else {
8038
7981
  ngDevMode && ngDevMode.rendererAddClass++;
8039
- if (isProcedural) {
8040
- renderer.addClass(rNode, prop);
8041
- }
8042
- else {
8043
- ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
8044
- rNode.classList.add(prop);
8045
- }
7982
+ renderer.addClass(rNode, prop);
8046
7983
  }
8047
7984
  }
8048
7985
  else {
8049
7986
  let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
8050
7987
  if (value == null /** || value === undefined */) {
8051
7988
  ngDevMode && ngDevMode.rendererRemoveStyle++;
8052
- if (isProcedural) {
8053
- renderer.removeStyle(rNode, prop, flags);
8054
- }
8055
- else {
8056
- rNode.style.removeProperty(prop);
8057
- }
7989
+ renderer.removeStyle(rNode, prop, flags);
8058
7990
  }
8059
7991
  else {
8060
7992
  // A value is important if it ends with `!important`. The style
@@ -8066,13 +7998,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8066
7998
  flags |= RendererStyleFlags2.Important;
8067
7999
  }
8068
8000
  ngDevMode && ngDevMode.rendererSetStyle++;
8069
- if (isProcedural) {
8070
- renderer.setStyle(rNode, prop, value, flags);
8071
- }
8072
- else {
8073
- ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
8074
- rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
8075
- }
8001
+ renderer.setStyle(rNode, prop, value, flags);
8076
8002
  }
8077
8003
  }
8078
8004
  }
@@ -8088,12 +8014,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8088
8014
  */
8089
8015
  function writeDirectStyle(renderer, element, newValue) {
8090
8016
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8091
- if (isProceduralRenderer(renderer)) {
8092
- renderer.setAttribute(element, 'style', newValue);
8093
- }
8094
- else {
8095
- element.style.cssText = newValue;
8096
- }
8017
+ renderer.setAttribute(element, 'style', newValue);
8097
8018
  ngDevMode && ngDevMode.rendererSetStyle++;
8098
8019
  }
8099
8020
  /**
@@ -8108,17 +8029,12 @@ function writeDirectStyle(renderer, element, newValue) {
8108
8029
  */
8109
8030
  function writeDirectClass(renderer, element, newValue) {
8110
8031
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8111
- if (isProceduralRenderer(renderer)) {
8112
- if (newValue === '') {
8113
- // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8114
- renderer.removeAttribute(element, 'class');
8115
- }
8116
- else {
8117
- renderer.setAttribute(element, 'class', newValue);
8118
- }
8032
+ if (newValue === '') {
8033
+ // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8034
+ renderer.removeAttribute(element, 'class');
8119
8035
  }
8120
8036
  else {
8121
- element.className = newValue;
8037
+ renderer.setAttribute(element, 'class', newValue);
8122
8038
  }
8123
8039
  ngDevMode && ngDevMode.rendererSetClassName++;
8124
8040
  }
@@ -8168,7 +8084,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
8168
8084
  * Use of this source code is governed by an MIT-style license that can be
8169
8085
  * found in the LICENSE file at https://angular.io/license
8170
8086
  */
8171
- const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3;
8087
+ const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
8172
8088
  const NG_TEMPLATE_SELECTOR = 'ng-template';
8173
8089
  /**
8174
8090
  * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
@@ -9197,6 +9113,18 @@ class R3Injector extends EnvironmentInjector {
9197
9113
  onDestroy(callback) {
9198
9114
  this._onDestroyHooks.push(callback);
9199
9115
  }
9116
+ runInContext(fn) {
9117
+ this.assertNotDestroyed();
9118
+ const previousInjector = setCurrentInjector(this);
9119
+ const previousInjectImplementation = setInjectImplementation(undefined);
9120
+ try {
9121
+ return fn();
9122
+ }
9123
+ finally {
9124
+ setCurrentInjector(previousInjector);
9125
+ setInjectImplementation(previousInjectImplementation);
9126
+ }
9127
+ }
9200
9128
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
9201
9129
  this.assertNotDestroyed();
9202
9130
  // Set the injection context.
@@ -10612,6 +10540,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
10612
10540
  `the ${schemas} of this component.`;
10613
10541
  }
10614
10542
  }
10543
+ reportUnknownPropertyError(message);
10544
+ }
10545
+ function reportUnknownPropertyError(message) {
10615
10546
  if (shouldThrowErrorOnUnknownProperty) {
10616
10547
  throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
10617
10548
  }
@@ -11499,6 +11430,13 @@ class LContainerDebug {
11499
11430
  }
11500
11431
  }
11501
11432
 
11433
+ /**
11434
+ * @license
11435
+ * Copyright Google LLC All Rights Reserved.
11436
+ *
11437
+ * Use of this source code is governed by an MIT-style license that can be
11438
+ * found in the LICENSE file at https://angular.io/license
11439
+ */
11502
11440
  /**
11503
11441
  * A permanent marker promise which signifies that the current CD tree is
11504
11442
  * clean.
@@ -11566,7 +11504,7 @@ function refreshChildComponents(hostLView, components) {
11566
11504
  /** Renders child components in the current view (creation mode). */
11567
11505
  function renderChildComponents(hostLView, components) {
11568
11506
  for (let i = 0; i < components.length; i++) {
11569
- renderComponent$1(hostLView, components[i]);
11507
+ renderComponent(hostLView, components[i]);
11570
11508
  }
11571
11509
  }
11572
11510
  function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
@@ -12084,16 +12022,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
12084
12022
  function createError(text, token) {
12085
12023
  return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
12086
12024
  }
12087
- function assertHostNodeExists(rElement, elementOrSelector) {
12088
- if (!rElement) {
12089
- if (typeof elementOrSelector === 'string') {
12090
- throw createError('Host node with selector not found:', elementOrSelector);
12091
- }
12092
- else {
12093
- throw createError('Host node is required:', elementOrSelector);
12094
- }
12095
- }
12096
- }
12097
12025
  /**
12098
12026
  * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
12099
12027
  *
@@ -12102,21 +12030,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
12102
12030
  * @param encapsulation View Encapsulation defined for component that requests host element.
12103
12031
  */
12104
12032
  function locateHostElement(renderer, elementOrSelector, encapsulation) {
12105
- if (isProceduralRenderer(renderer)) {
12106
- // When using native Shadow DOM, do not clear host element to allow native slot projection
12107
- const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12108
- return renderer.selectRootElement(elementOrSelector, preserveContent);
12109
- }
12110
- let rElement = typeof elementOrSelector === 'string' ?
12111
- renderer.querySelector(elementOrSelector) :
12112
- elementOrSelector;
12113
- ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
12114
- // Always clear host element's content when Renderer3 is in use. For procedural renderer case we
12115
- // make it depend on whether ShadowDom encapsulation is used (in which case the content should be
12116
- // preserved to allow native slot projection). ShadowDom encapsulation requires procedural
12117
- // renderer, and procedural renderer case is handled above.
12118
- rElement.textContent = '';
12119
- return rElement;
12033
+ // When using native Shadow DOM, do not clear host element to allow native slot projection
12034
+ const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12035
+ return renderer.selectRootElement(elementOrSelector, preserveContent);
12120
12036
  }
12121
12037
  /**
12122
12038
  * Saves context for this cleanup function in LView.cleanupInstances.
@@ -12331,13 +12247,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
12331
12247
  // It is assumed that the sanitizer is only added when the compiler determines that the
12332
12248
  // property is risky, so sanitization can be done without further checks.
12333
12249
  value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
12334
- if (isProceduralRenderer(renderer)) {
12335
- renderer.setProperty(element, propName, value);
12336
- }
12337
- else if (!isAnimationProp(propName)) {
12338
- element.setProperty ? element.setProperty(propName, value) :
12339
- element[propName] = value;
12340
- }
12250
+ renderer.setProperty(element, propName, value);
12341
12251
  }
12342
12252
  else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
12343
12253
  // If the node is a container and the property didn't
@@ -12361,23 +12271,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
12361
12271
  const debugValue = normalizeDebugBindingValue(value);
12362
12272
  if (type & 3 /* TNodeType.AnyRNode */) {
12363
12273
  if (value == null) {
12364
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :
12365
- element.removeAttribute(attrName);
12274
+ renderer.removeAttribute(element, attrName);
12366
12275
  }
12367
12276
  else {
12368
- isProceduralRenderer(renderer) ?
12369
- renderer.setAttribute(element, attrName, debugValue) :
12370
- element.setAttribute(attrName, debugValue);
12277
+ renderer.setAttribute(element, attrName, debugValue);
12371
12278
  }
12372
12279
  }
12373
12280
  else {
12374
12281
  const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
12375
- if (isProceduralRenderer(renderer)) {
12376
- renderer.setValue(element, textContent);
12377
- }
12378
- else {
12379
- element.textContent = textContent;
12380
- }
12282
+ renderer.setValue(element, textContent);
12381
12283
  }
12382
12284
  }
12383
12285
  function setNgReflectProperties(lView, element, type, dataValue, value) {
@@ -12407,6 +12309,7 @@ function instantiateRootComponent(tView, lView, def) {
12407
12309
  ngDevMode &&
12408
12310
  assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
12409
12311
  configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
12312
+ initializeInputAndOutputAliases(tView, rootTNode);
12410
12313
  }
12411
12314
  const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
12412
12315
  attachPatchData(directive, lView);
@@ -12731,19 +12634,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
12731
12634
  function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
12732
12635
  if (value == null) {
12733
12636
  ngDevMode && ngDevMode.rendererRemoveAttribute++;
12734
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) :
12735
- element.removeAttribute(name);
12637
+ renderer.removeAttribute(element, name, namespace);
12736
12638
  }
12737
12639
  else {
12738
12640
  ngDevMode && ngDevMode.rendererSetAttribute++;
12739
12641
  const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
12740
- if (isProceduralRenderer(renderer)) {
12741
- renderer.setAttribute(element, name, strValue, namespace);
12742
- }
12743
- else {
12744
- namespace ? element.setAttributeNS(namespace, name, strValue) :
12745
- element.setAttribute(name, strValue);
12746
- }
12642
+ renderer.setAttribute(element, name, strValue, namespace);
12747
12643
  }
12748
12644
  }
12749
12645
  /**
@@ -12835,7 +12731,6 @@ const LContainerArray = class LContainer extends Array {
12835
12731
  */
12836
12732
  function createLContainer(hostNative, currentView, native, tNode) {
12837
12733
  ngDevMode && assertLView(currentView);
12838
- ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
12839
12734
  // https://jsperf.com/array-literal-vs-new-array-really
12840
12735
  const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
12841
12736
  true, // Boolean `true` in this position signifies that this is an `LContainer`
@@ -12951,7 +12846,7 @@ function refreshContainsDirtyView(lView) {
12951
12846
  }
12952
12847
  }
12953
12848
  }
12954
- function renderComponent$1(hostLView, componentHostIdx) {
12849
+ function renderComponent(hostLView, componentHostIdx) {
12955
12850
  ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
12956
12851
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
12957
12852
  const componentTView = componentView[TVIEW];
@@ -13303,48 +13198,135 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
13303
13198
  * Use of this source code is governed by an MIT-style license that can be
13304
13199
  * found in the LICENSE file at https://angular.io/license
13305
13200
  */
13201
+ // TODO: A hack to not pull in the NullInjector from @angular/core.
13202
+ const NULL_INJECTOR = {
13203
+ get: (token, notFoundValue) => {
13204
+ throwProviderNotFoundError(token, 'NullInjector');
13205
+ }
13206
+ };
13306
13207
  /**
13307
- * Synchronously perform change detection on a component (and possibly its sub-components).
13208
+ * Creates the root component view and the root component node.
13308
13209
  *
13309
- * This function triggers change detection in a synchronous way on a component.
13210
+ * @param rNode Render host element.
13211
+ * @param def ComponentDef
13212
+ * @param rootView The parent view where the host node is stored
13213
+ * @param rendererFactory Factory to be used for creating child renderers.
13214
+ * @param hostRenderer The current renderer
13215
+ * @param sanitizer The sanitizer, if provided
13310
13216
  *
13311
- * @param component The component which the change detection should be performed on.
13217
+ * @returns Component view created
13312
13218
  */
13313
- function detectChanges(component) {
13314
- const view = getComponentViewByInstance(component);
13315
- detectChangesInternal(view[TVIEW], view, component);
13219
+ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13220
+ const tView = rootView[TVIEW];
13221
+ const index = HEADER_OFFSET;
13222
+ ngDevMode && assertIndexInRange(rootView, index);
13223
+ rootView[index] = rNode;
13224
+ // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13225
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13226
+ // representing a host element.
13227
+ const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13228
+ const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13229
+ if (mergedAttrs !== null) {
13230
+ computeStaticStyling(tNode, mergedAttrs, true);
13231
+ if (rNode !== null) {
13232
+ setUpAttributes(hostRenderer, rNode, mergedAttrs);
13233
+ if (tNode.classes !== null) {
13234
+ writeDirectClass(hostRenderer, rNode, tNode.classes);
13235
+ }
13236
+ if (tNode.styles !== null) {
13237
+ writeDirectStyle(hostRenderer, rNode, tNode.styles);
13238
+ }
13239
+ }
13240
+ }
13241
+ const viewRenderer = rendererFactory.createRenderer(rNode, def);
13242
+ const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13243
+ if (tView.firstCreatePass) {
13244
+ diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13245
+ markAsComponentHost(tView, tNode);
13246
+ initTNodeFlags(tNode, rootView.length, 1);
13247
+ }
13248
+ addToViewTree(rootView, componentView);
13249
+ // Store component view at node index, with node as the HOST
13250
+ return rootView[index] = componentView;
13316
13251
  }
13317
13252
  /**
13318
- * Marks the component as dirty (needing change detection). Marking a component dirty will
13319
- * schedule a change detection on it at some point in the future.
13320
- *
13321
- * Marking an already dirty component as dirty won't do anything. Only one outstanding change
13322
- * detection can be scheduled per component tree.
13253
+ * Creates a root component and sets it up with features and host bindings. Shared by
13254
+ * renderComponent() and ViewContainerRef.createComponent().
13255
+ */
13256
+ function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13257
+ const tView = rootLView[TVIEW];
13258
+ // Create directive instance with factory() and store at next index in viewData
13259
+ const component = instantiateRootComponent(tView, rootLView, componentDef);
13260
+ rootContext.components.push(component);
13261
+ componentView[CONTEXT] = component;
13262
+ if (hostFeatures !== null) {
13263
+ for (const feature of hostFeatures) {
13264
+ feature(component, componentDef);
13265
+ }
13266
+ }
13267
+ // We want to generate an empty QueryList for root content queries for backwards
13268
+ // compatibility with ViewEngine.
13269
+ if (componentDef.contentQueries) {
13270
+ const tNode = getCurrentTNode();
13271
+ ngDevMode && assertDefined(tNode, 'TNode expected');
13272
+ componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13273
+ }
13274
+ const rootTNode = getCurrentTNode();
13275
+ ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
13276
+ if (tView.firstCreatePass &&
13277
+ (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
13278
+ setSelectedIndex(rootTNode.index);
13279
+ const rootTView = rootLView[TVIEW];
13280
+ registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
13281
+ invokeHostBindingsInCreationMode(componentDef, component);
13282
+ }
13283
+ return component;
13284
+ }
13285
+ function createRootContext(scheduler, playerHandler) {
13286
+ return {
13287
+ components: [],
13288
+ scheduler: scheduler || defaultScheduler,
13289
+ clean: CLEAN_PROMISE,
13290
+ playerHandler: playerHandler || null,
13291
+ flags: 0 /* RootContextFlags.Empty */
13292
+ };
13293
+ }
13294
+ /**
13295
+ * Used to enable lifecycle hooks on the root component.
13323
13296
  *
13324
- * @param component Component to mark as dirty.
13297
+ * Include this feature when calling `renderComponent` if the root component
13298
+ * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
13299
+ * be called properly.
13300
+ *
13301
+ * Example:
13302
+ *
13303
+ * ```
13304
+ * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
13305
+ * ```
13325
13306
  */
13326
- function markDirty(component) {
13327
- ngDevMode && assertDefined(component, 'component');
13328
- const rootView = markViewDirty(getComponentViewByInstance(component));
13329
- ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
13330
- scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
13307
+ function LifecycleHooksFeature() {
13308
+ const tNode = getCurrentTNode();
13309
+ ngDevMode && assertDefined(tNode, 'TNode is required');
13310
+ registerPostOrderHooks(getLView()[TVIEW], tNode);
13331
13311
  }
13332
13312
  /**
13333
- * Used to perform change detection on the whole application.
13313
+ * Wait on component until it is rendered.
13334
13314
  *
13335
- * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
13336
- * executes lifecycle hooks and conditionally checks components based on their
13337
- * `ChangeDetectionStrategy` and dirtiness.
13315
+ * This function returns a `Promise` which is resolved when the component's
13316
+ * change detection is executed. This is determined by finding the scheduler
13317
+ * associated with the `component`'s render tree and waiting until the scheduler
13318
+ * flushes. If nothing is scheduled, the function returns a resolved promise.
13338
13319
  *
13339
- * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
13340
- * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
13341
- * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
13342
- * be changed when calling `renderComponent` and providing the `scheduler` option.
13320
+ * Example:
13321
+ * ```
13322
+ * await whenRendered(myComponent);
13323
+ * ```
13324
+ *
13325
+ * @param component Component to wait upon
13326
+ * @returns Promise which resolves when the component is rendered.
13343
13327
  */
13344
- function tick(component) {
13345
- const rootView = getRootView(component);
13346
- const rootContext = rootView[CONTEXT];
13347
- tickRootContext(rootContext);
13328
+ function whenRendered(component) {
13329
+ return getRootContext(component).clean;
13348
13330
  }
13349
13331
 
13350
13332
  /**
@@ -13354,407 +13336,312 @@ function tick(component) {
13354
13336
  * Use of this source code is governed by an MIT-style license that can be
13355
13337
  * found in the LICENSE file at https://angular.io/license
13356
13338
  */
13339
+ function getSuperType(type) {
13340
+ return Object.getPrototypeOf(type.prototype).constructor;
13341
+ }
13357
13342
  /**
13358
- * Retrieves the component instance associated with a given DOM element.
13359
- *
13360
- * @usageNotes
13361
- * Given the following DOM structure:
13362
- *
13363
- * ```html
13364
- * <app-root>
13365
- * <div>
13366
- * <child-comp></child-comp>
13367
- * </div>
13368
- * </app-root>
13369
- * ```
13370
- *
13371
- * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
13372
- * associated with this DOM element.
13373
- *
13374
- * Calling the function on `<app-root>` will return the `MyApp` instance.
13375
- *
13376
- *
13377
- * @param element DOM element from which the component should be retrieved.
13378
- * @returns Component instance associated with the element or `null` if there
13379
- * is no component associated with it.
13343
+ * Merges the definition from a super class to a sub class.
13344
+ * @param definition The definition that is a SubClass of another directive of component
13380
13345
  *
13381
- * @publicApi
13382
- * @globalApi ng
13346
+ * @codeGenApi
13383
13347
  */
13384
- function getComponent$1(element) {
13385
- ngDevMode && assertDomElement(element);
13386
- const context = getLContext(element);
13387
- if (context === null)
13388
- return null;
13389
- if (context.component === undefined) {
13390
- const lView = context.lView;
13391
- if (lView === null) {
13392
- return null;
13348
+ function ɵɵInheritDefinitionFeature(definition) {
13349
+ let superType = getSuperType(definition.type);
13350
+ let shouldInheritFields = true;
13351
+ const inheritanceChain = [definition];
13352
+ while (superType) {
13353
+ let superDef = undefined;
13354
+ if (isComponentDef(definition)) {
13355
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13356
+ superDef = superType.ɵcmp || superType.ɵdir;
13393
13357
  }
13394
- context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
13358
+ else {
13359
+ if (superType.ɵcmp) {
13360
+ throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
13361
+ `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
13362
+ }
13363
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13364
+ superDef = superType.ɵdir;
13365
+ }
13366
+ if (superDef) {
13367
+ if (shouldInheritFields) {
13368
+ inheritanceChain.push(superDef);
13369
+ // Some fields in the definition may be empty, if there were no values to put in them that
13370
+ // would've justified object creation. Unwrap them if necessary.
13371
+ const writeableDef = definition;
13372
+ writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
13373
+ writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
13374
+ writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
13375
+ // Merge hostBindings
13376
+ const superHostBindings = superDef.hostBindings;
13377
+ superHostBindings && inheritHostBindings(definition, superHostBindings);
13378
+ // Merge queries
13379
+ const superViewQuery = superDef.viewQuery;
13380
+ const superContentQueries = superDef.contentQueries;
13381
+ superViewQuery && inheritViewQuery(definition, superViewQuery);
13382
+ superContentQueries && inheritContentQueries(definition, superContentQueries);
13383
+ // Merge inputs and outputs
13384
+ fillProperties(definition.inputs, superDef.inputs);
13385
+ fillProperties(definition.declaredInputs, superDef.declaredInputs);
13386
+ fillProperties(definition.outputs, superDef.outputs);
13387
+ // Merge animations metadata.
13388
+ // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
13389
+ if (isComponentDef(superDef) && superDef.data.animation) {
13390
+ // If super def is a Component, the `definition` is also a Component, since Directives can
13391
+ // not inherit Components (we throw an error above and cannot reach this code).
13392
+ const defData = definition.data;
13393
+ defData.animation = (defData.animation || []).concat(superDef.data.animation);
13394
+ }
13395
+ }
13396
+ // Run parent features
13397
+ const features = superDef.features;
13398
+ if (features) {
13399
+ for (let i = 0; i < features.length; i++) {
13400
+ const feature = features[i];
13401
+ if (feature && feature.ngInherit) {
13402
+ feature(definition);
13403
+ }
13404
+ // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
13405
+ // def already has all the necessary information inherited from its super class(es), so we
13406
+ // can stop merging fields from super classes. However we need to iterate through the
13407
+ // prototype chain to look for classes that might contain other "features" (like
13408
+ // NgOnChanges), which we should invoke for the original `definition`. We set the
13409
+ // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
13410
+ // logic and only invoking functions from the "features" list.
13411
+ if (feature === ɵɵInheritDefinitionFeature) {
13412
+ shouldInheritFields = false;
13413
+ }
13414
+ }
13415
+ }
13416
+ }
13417
+ superType = Object.getPrototypeOf(superType);
13395
13418
  }
13396
- return context.component;
13397
- }
13398
- /**
13399
- * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
13400
- * view that the element is part of. Otherwise retrieves the instance of the component whose view
13401
- * owns the element (in this case, the result is the same as calling `getOwningComponent`).
13402
- *
13403
- * @param element Element for which to get the surrounding component instance.
13404
- * @returns Instance of the component that is around the element or null if the element isn't
13405
- * inside any component.
13406
- *
13407
- * @publicApi
13408
- * @globalApi ng
13409
- */
13410
- function getContext(element) {
13411
- assertDomElement(element);
13412
- const context = getLContext(element);
13413
- const lView = context ? context.lView : null;
13414
- return lView === null ? null : lView[CONTEXT];
13419
+ mergeHostAttrsAcrossInheritance(inheritanceChain);
13415
13420
  }
13416
13421
  /**
13417
- * Retrieves the component instance whose view contains the DOM element.
13418
- *
13419
- * For example, if `<child-comp>` is used in the template of `<app-comp>`
13420
- * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
13421
- * would return `<app-comp>`.
13422
- *
13423
- * @param elementOrDir DOM element, component or directive instance
13424
- * for which to retrieve the root components.
13425
- * @returns Component instance whose view owns the DOM element or null if the element is not
13426
- * part of a component view.
13422
+ * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
13427
13423
  *
13428
- * @publicApi
13429
- * @globalApi ng
13424
+ * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
13425
+ * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
13426
+ * type.
13430
13427
  */
13431
- function getOwningComponent(elementOrDir) {
13432
- const context = getLContext(elementOrDir);
13433
- let lView = context ? context.lView : null;
13434
- if (lView === null)
13435
- return null;
13436
- let parent;
13437
- while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
13438
- lView = parent;
13428
+ function mergeHostAttrsAcrossInheritance(inheritanceChain) {
13429
+ let hostVars = 0;
13430
+ let hostAttrs = null;
13431
+ // We process the inheritance order from the base to the leaves here.
13432
+ for (let i = inheritanceChain.length - 1; i >= 0; i--) {
13433
+ const def = inheritanceChain[i];
13434
+ // For each `hostVars`, we need to add the superclass amount.
13435
+ def.hostVars = (hostVars += def.hostVars);
13436
+ // for each `hostAttrs` we need to merge it with superclass.
13437
+ def.hostAttrs =
13438
+ mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
13439
13439
  }
13440
- return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
13441
13440
  }
13442
- /**
13443
- * Retrieves all root components associated with a DOM element, directive or component instance.
13444
- * Root components are those which have been bootstrapped by Angular.
13445
- *
13446
- * @param elementOrDir DOM element, component or directive instance
13447
- * for which to retrieve the root components.
13448
- * @returns Root components associated with the target object.
13449
- *
13450
- * @publicApi
13451
- * @globalApi ng
13452
- */
13453
- function getRootComponents(elementOrDir) {
13454
- const lView = readPatchedLView(elementOrDir);
13455
- return lView !== null ? [...getRootContext(lView).components] : [];
13456
- }
13457
- /**
13458
- * Retrieves an `Injector` associated with an element, component or directive instance.
13459
- *
13460
- * @param elementOrDir DOM element, component or directive instance for which to
13461
- * retrieve the injector.
13462
- * @returns Injector associated with the element, component or directive instance.
13463
- *
13464
- * @publicApi
13465
- * @globalApi ng
13466
- */
13467
- function getInjector(elementOrDir) {
13468
- const context = getLContext(elementOrDir);
13469
- const lView = context ? context.lView : null;
13470
- if (lView === null)
13471
- return Injector.NULL;
13472
- const tNode = lView[TVIEW].data[context.nodeIndex];
13473
- return new NodeInjector(tNode, lView);
13474
- }
13475
- /**
13476
- * Retrieve a set of injection tokens at a given DOM node.
13477
- *
13478
- * @param element Element for which the injection tokens should be retrieved.
13479
- */
13480
- function getInjectionTokens(element) {
13481
- const context = getLContext(element);
13482
- const lView = context ? context.lView : null;
13483
- if (lView === null)
13484
- return [];
13485
- const tView = lView[TVIEW];
13486
- const tNode = tView.data[context.nodeIndex];
13487
- const providerTokens = [];
13488
- const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
13489
- const endIndex = tNode.directiveEnd;
13490
- for (let i = startIndex; i < endIndex; i++) {
13491
- let value = tView.data[i];
13492
- if (isDirectiveDefHack(value)) {
13493
- // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
13494
- // design flaw. We should always store same type so that we can be monomorphic. The issue
13495
- // is that for Components/Directives we store the def instead the type. The correct behavior
13496
- // is that we should always be storing injectable type in this location.
13497
- value = value.type;
13498
- }
13499
- providerTokens.push(value);
13441
+ function maybeUnwrapEmpty(value) {
13442
+ if (value === EMPTY_OBJ) {
13443
+ return {};
13500
13444
  }
13501
- return providerTokens;
13502
- }
13503
- /**
13504
- * Retrieves directive instances associated with a given DOM node. Does not include
13505
- * component instances.
13506
- *
13507
- * @usageNotes
13508
- * Given the following DOM structure:
13509
- *
13510
- * ```html
13511
- * <app-root>
13512
- * <button my-button></button>
13513
- * <my-comp></my-comp>
13514
- * </app-root>
13515
- * ```
13516
- *
13517
- * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
13518
- * directive that is associated with the DOM node.
13519
- *
13520
- * Calling `getDirectives` on `<my-comp>` will return an empty array.
13521
- *
13522
- * @param node DOM node for which to get the directives.
13523
- * @returns Array of directives associated with the node.
13524
- *
13525
- * @publicApi
13526
- * @globalApi ng
13527
- */
13528
- function getDirectives(node) {
13529
- // Skip text nodes because we can't have directives associated with them.
13530
- if (node instanceof Text) {
13445
+ else if (value === EMPTY_ARRAY) {
13531
13446
  return [];
13532
13447
  }
13533
- const context = getLContext(node);
13534
- const lView = context ? context.lView : null;
13535
- if (lView === null) {
13536
- return [];
13448
+ else {
13449
+ return value;
13537
13450
  }
13538
- const tView = lView[TVIEW];
13539
- const nodeIndex = context.nodeIndex;
13540
- if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
13541
- return [];
13451
+ }
13452
+ function inheritViewQuery(definition, superViewQuery) {
13453
+ const prevViewQuery = definition.viewQuery;
13454
+ if (prevViewQuery) {
13455
+ definition.viewQuery = (rf, ctx) => {
13456
+ superViewQuery(rf, ctx);
13457
+ prevViewQuery(rf, ctx);
13458
+ };
13542
13459
  }
13543
- if (context.directives === undefined) {
13544
- context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
13460
+ else {
13461
+ definition.viewQuery = superViewQuery;
13545
13462
  }
13546
- // The `directives` in this case are a named array called `LComponentView`. Clone the
13547
- // result so we don't expose an internal data structure in the user's console.
13548
- return context.directives === null ? [] : [...context.directives];
13549
13463
  }
13550
- /**
13551
- * Returns the debug (partial) metadata for a particular directive or component instance.
13552
- * The function accepts an instance of a directive or component and returns the corresponding
13553
- * metadata.
13554
- *
13555
- * @param directiveOrComponentInstance Instance of a directive or component
13556
- * @returns metadata of the passed directive or component
13557
- *
13558
- * @publicApi
13559
- * @globalApi ng
13560
- */
13561
- function getDirectiveMetadata$1(directiveOrComponentInstance) {
13562
- const { constructor } = directiveOrComponentInstance;
13563
- if (!constructor) {
13564
- throw new Error('Unable to find the instance constructor');
13464
+ function inheritContentQueries(definition, superContentQueries) {
13465
+ const prevContentQueries = definition.contentQueries;
13466
+ if (prevContentQueries) {
13467
+ definition.contentQueries = (rf, ctx, directiveIndex) => {
13468
+ superContentQueries(rf, ctx, directiveIndex);
13469
+ prevContentQueries(rf, ctx, directiveIndex);
13470
+ };
13565
13471
  }
13566
- // In case a component inherits from a directive, we may have component and directive metadata
13567
- // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
13568
- const componentDef = getComponentDef(constructor);
13569
- if (componentDef) {
13570
- return {
13571
- inputs: componentDef.inputs,
13572
- outputs: componentDef.outputs,
13573
- encapsulation: componentDef.encapsulation,
13574
- changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
13575
- ChangeDetectionStrategy.Default
13472
+ else {
13473
+ definition.contentQueries = superContentQueries;
13474
+ }
13475
+ }
13476
+ function inheritHostBindings(definition, superHostBindings) {
13477
+ const prevHostBindings = definition.hostBindings;
13478
+ if (prevHostBindings) {
13479
+ definition.hostBindings = (rf, ctx) => {
13480
+ superHostBindings(rf, ctx);
13481
+ prevHostBindings(rf, ctx);
13576
13482
  };
13577
13483
  }
13578
- const directiveDef = getDirectiveDef(constructor);
13579
- if (directiveDef) {
13580
- return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
13484
+ else {
13485
+ definition.hostBindings = superHostBindings;
13581
13486
  }
13582
- return null;
13583
13487
  }
13488
+
13584
13489
  /**
13585
- * Retrieve map of local references.
13586
- *
13587
- * The references are retrieved as a map of local reference name to element or directive instance.
13490
+ * @license
13491
+ * Copyright Google LLC All Rights Reserved.
13588
13492
  *
13589
- * @param target DOM element, component or directive instance for which to retrieve
13590
- * the local references.
13493
+ * Use of this source code is governed by an MIT-style license that can be
13494
+ * found in the LICENSE file at https://angular.io/license
13591
13495
  */
13592
- function getLocalRefs(target) {
13593
- const context = getLContext(target);
13594
- if (context === null)
13595
- return {};
13596
- if (context.localRefs === undefined) {
13597
- const lView = context.lView;
13598
- if (lView === null) {
13599
- return {};
13600
- }
13601
- context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
13602
- }
13603
- return context.localRefs || {};
13604
- }
13605
13496
  /**
13606
- * Retrieves the host element of a component or directive instance.
13607
- * The host element is the DOM element that matched the selector of the directive.
13608
- *
13609
- * @param componentOrDirective Component or directive instance for which the host
13610
- * element should be retrieved.
13611
- * @returns Host element of the target.
13612
- *
13613
- * @publicApi
13614
- * @globalApi ng
13497
+ * Fields which exist on either directive or component definitions, and need to be copied from
13498
+ * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13615
13499
  */
13616
- function getHostElement(componentOrDirective) {
13617
- return getLContext(componentOrDirective).native;
13618
- }
13500
+ const COPY_DIRECTIVE_FIELDS = [
13501
+ // The child class should use the providers of its parent.
13502
+ 'providersResolver',
13503
+ // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
13504
+ // as inputs, outputs, and host binding functions.
13505
+ ];
13619
13506
  /**
13620
- * Retrieves the rendered text for a given component.
13621
- *
13622
- * This function retrieves the host element of a component and
13623
- * and then returns the `textContent` for that element. This implies
13624
- * that the text returned will include re-projected content of
13625
- * the component as well.
13507
+ * Fields which exist only on component definitions, and need to be copied from parent to child
13508
+ * classes by the `ɵɵCopyDefinitionFeature`.
13626
13509
  *
13627
- * @param component The component to return the content text for.
13510
+ * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
13511
+ * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13628
13512
  */
13629
- function getRenderedText(component) {
13630
- const hostElement = getHostElement(component);
13631
- return hostElement.textContent || '';
13632
- }
13513
+ const COPY_COMPONENT_FIELDS = [
13514
+ // The child class should use the template function of its parent, including all template
13515
+ // semantics.
13516
+ 'template',
13517
+ 'decls',
13518
+ 'consts',
13519
+ 'vars',
13520
+ 'onPush',
13521
+ 'ngContentSelectors',
13522
+ // The child class should use the CSS styles of its parent, including all styling semantics.
13523
+ 'styles',
13524
+ 'encapsulation',
13525
+ // The child class should be checked by the runtime in the same way as its parent.
13526
+ 'schemas',
13527
+ ];
13633
13528
  /**
13634
- * Retrieves a list of event listeners associated with a DOM element. The list does include host
13635
- * listeners, but it does not include event listeners defined outside of the Angular context
13636
- * (e.g. through `addEventListener`).
13529
+ * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
13530
+ * definition.
13637
13531
  *
13638
- * @usageNotes
13639
- * Given the following DOM structure:
13532
+ * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
13533
+ * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
13534
+ * generates a skeleton definition on the child class, and applies this feature.
13640
13535
  *
13641
- * ```html
13642
- * <app-root>
13643
- * <div (click)="doSomething()"></div>
13644
- * </app-root>
13645
- * ```
13536
+ * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
13537
+ * including things like the component template function.
13646
13538
  *
13647
- * Calling `getListeners` on `<div>` will return an object that looks as follows:
13539
+ * @param definition The definition of a child class which inherits from a parent class with its
13540
+ * own definition.
13648
13541
  *
13649
- * ```ts
13650
- * {
13651
- * name: 'click',
13652
- * element: <div>,
13653
- * callback: () => doSomething(),
13654
- * useCapture: false
13655
- * }
13656
- * ```
13657
- *
13658
- * @param element Element for which the DOM listeners should be retrieved.
13659
- * @returns Array of event listeners on the DOM element.
13660
- *
13661
- * @publicApi
13662
- * @globalApi ng
13542
+ * @codeGenApi
13663
13543
  */
13664
- function getListeners(element) {
13665
- ngDevMode && assertDomElement(element);
13666
- const lContext = getLContext(element);
13667
- const lView = lContext === null ? null : lContext.lView;
13668
- if (lView === null)
13669
- return [];
13670
- const tView = lView[TVIEW];
13671
- const lCleanup = lView[CLEANUP];
13672
- const tCleanup = tView.cleanup;
13673
- const listeners = [];
13674
- if (tCleanup && lCleanup) {
13675
- for (let i = 0; i < tCleanup.length;) {
13676
- const firstParam = tCleanup[i++];
13677
- const secondParam = tCleanup[i++];
13678
- if (typeof firstParam === 'string') {
13679
- const name = firstParam;
13680
- const listenerElement = unwrapRNode(lView[secondParam]);
13681
- const callback = lCleanup[tCleanup[i++]];
13682
- const useCaptureOrIndx = tCleanup[i++];
13683
- // if useCaptureOrIndx is boolean then report it as is.
13684
- // if useCaptureOrIndx is positive number then it in unsubscribe method
13685
- // if useCaptureOrIndx is negative number then it is a Subscription
13686
- const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
13687
- const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
13688
- if (element == listenerElement) {
13689
- listeners.push({ element, name, callback, useCapture, type });
13690
- }
13691
- }
13544
+ function ɵɵCopyDefinitionFeature(definition) {
13545
+ let superType = getSuperType(definition.type);
13546
+ let superDef = undefined;
13547
+ if (isComponentDef(definition)) {
13548
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13549
+ superDef = superType.ɵcmp;
13550
+ }
13551
+ else {
13552
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13553
+ superDef = superType.ɵdir;
13554
+ }
13555
+ // Needed because `definition` fields are readonly.
13556
+ const defAny = definition;
13557
+ // Copy over any fields that apply to either directives or components.
13558
+ for (const field of COPY_DIRECTIVE_FIELDS) {
13559
+ defAny[field] = superDef[field];
13560
+ }
13561
+ if (isComponentDef(superDef)) {
13562
+ // Copy over any component-specific fields.
13563
+ for (const field of COPY_COMPONENT_FIELDS) {
13564
+ defAny[field] = superDef[field];
13692
13565
  }
13693
13566
  }
13694
- listeners.sort(sortListeners);
13695
- return listeners;
13696
- }
13697
- function sortListeners(a, b) {
13698
- if (a.name == b.name)
13699
- return 0;
13700
- return a.name < b.name ? -1 : 1;
13701
13567
  }
13568
+
13702
13569
  /**
13703
- * This function should not exist because it is megamorphic and only mostly correct.
13570
+ * @license
13571
+ * Copyright Google LLC All Rights Reserved.
13704
13572
  *
13705
- * See call site for more info.
13573
+ * Use of this source code is governed by an MIT-style license that can be
13574
+ * found in the LICENSE file at https://angular.io/license
13706
13575
  */
13707
- function isDirectiveDefHack(obj) {
13708
- return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
13576
+ let _symbolIterator = null;
13577
+ function getSymbolIterator() {
13578
+ if (!_symbolIterator) {
13579
+ const Symbol = _global['Symbol'];
13580
+ if (Symbol && Symbol.iterator) {
13581
+ _symbolIterator = Symbol.iterator;
13582
+ }
13583
+ else {
13584
+ // es6-shim specific logic
13585
+ const keys = Object.getOwnPropertyNames(Map.prototype);
13586
+ for (let i = 0; i < keys.length; ++i) {
13587
+ const key = keys[i];
13588
+ if (key !== 'entries' && key !== 'size' &&
13589
+ Map.prototype[key] === Map.prototype['entries']) {
13590
+ _symbolIterator = key;
13591
+ }
13592
+ }
13593
+ }
13594
+ }
13595
+ return _symbolIterator;
13709
13596
  }
13597
+
13710
13598
  /**
13711
- * Returns the attached `DebugNode` instance for an element in the DOM.
13599
+ * @license
13600
+ * Copyright Google LLC All Rights Reserved.
13712
13601
  *
13713
- * @param element DOM element which is owned by an existing component's view.
13602
+ * Use of this source code is governed by an MIT-style license that can be
13603
+ * found in the LICENSE file at https://angular.io/license
13714
13604
  */
13715
- function getDebugNode$1(element) {
13716
- if (ngDevMode && !(element instanceof Node)) {
13717
- throw new Error('Expecting instance of DOM Element');
13605
+ function isIterable(obj) {
13606
+ return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13607
+ }
13608
+ function isListLikeIterable(obj) {
13609
+ if (!isJsObject(obj))
13610
+ return false;
13611
+ return Array.isArray(obj) ||
13612
+ (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13613
+ getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13614
+ }
13615
+ function areIterablesEqual(a, b, comparator) {
13616
+ const iterator1 = a[getSymbolIterator()]();
13617
+ const iterator2 = b[getSymbolIterator()]();
13618
+ while (true) {
13619
+ const item1 = iterator1.next();
13620
+ const item2 = iterator2.next();
13621
+ if (item1.done && item2.done)
13622
+ return true;
13623
+ if (item1.done || item2.done)
13624
+ return false;
13625
+ if (!comparator(item1.value, item2.value))
13626
+ return false;
13718
13627
  }
13719
- const lContext = getLContext(element);
13720
- const lView = lContext ? lContext.lView : null;
13721
- if (lView === null) {
13722
- return null;
13628
+ }
13629
+ function iterateListLike(obj, fn) {
13630
+ if (Array.isArray(obj)) {
13631
+ for (let i = 0; i < obj.length; i++) {
13632
+ fn(obj[i]);
13633
+ }
13723
13634
  }
13724
- const nodeIndex = lContext.nodeIndex;
13725
- if (nodeIndex !== -1) {
13726
- const valueInLView = lView[nodeIndex];
13727
- // this means that value in the lView is a component with its own
13728
- // data. In this situation the TNode is not accessed at the same spot.
13729
- const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
13730
- ngDevMode &&
13731
- assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
13732
- return buildDebugNode(tNode, lView);
13635
+ else {
13636
+ const iterator = obj[getSymbolIterator()]();
13637
+ let item;
13638
+ while (!((item = iterator.next()).done)) {
13639
+ fn(item.value);
13640
+ }
13733
13641
  }
13734
- return null;
13735
- }
13736
- /**
13737
- * Retrieve the component `LView` from component/element.
13738
- *
13739
- * NOTE: `LView` is a private and should not be leaked outside.
13740
- * Don't export this method to `ng.*` on window.
13741
- *
13742
- * @param target DOM element or component instance for which to retrieve the LView.
13743
- */
13744
- function getComponentLView(target) {
13745
- const lContext = getLContext(target);
13746
- const nodeIndx = lContext.nodeIndex;
13747
- const lView = lContext.lView;
13748
- ngDevMode && assertLView(lView);
13749
- const componentLView = lView[nodeIndx];
13750
- ngDevMode && assertLView(componentLView);
13751
- return componentLView;
13752
13642
  }
13753
- /** Asserts that a value is a DOM Element. */
13754
- function assertDomElement(value) {
13755
- if (typeof Element !== 'undefined' && !(value instanceof Element)) {
13756
- throw new Error('Expecting instance of DOM Element');
13757
- }
13643
+ function isJsObject(o) {
13644
+ return o !== null && (typeof o === 'function' || typeof o === 'object');
13758
13645
  }
13759
13646
 
13760
13647
  /**
@@ -13764,18 +13651,22 @@ function assertDomElement(value) {
13764
13651
  * Use of this source code is governed by an MIT-style license that can be
13765
13652
  * found in the LICENSE file at https://angular.io/license
13766
13653
  */
13767
- /**
13768
- * Marks a component for check (in case of OnPush components) and synchronously
13769
- * performs change detection on the application this component belongs to.
13770
- *
13771
- * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
13772
- *
13773
- * @publicApi
13774
- * @globalApi ng
13775
- */
13776
- function applyChanges(component) {
13777
- markDirty(component);
13778
- getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
13654
+ function devModeEqual(a, b) {
13655
+ const isListLikeIterableA = isListLikeIterable(a);
13656
+ const isListLikeIterableB = isListLikeIterable(b);
13657
+ if (isListLikeIterableA && isListLikeIterableB) {
13658
+ return areIterablesEqual(a, b, devModeEqual);
13659
+ }
13660
+ else {
13661
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
13662
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
13663
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
13664
+ return true;
13665
+ }
13666
+ else {
13667
+ return Object.is(a, b);
13668
+ }
13669
+ }
13779
13670
  }
13780
13671
 
13781
13672
  /**
@@ -13785,70 +13676,73 @@ function applyChanges(component) {
13785
13676
  * Use of this source code is governed by an MIT-style license that can be
13786
13677
  * found in the LICENSE file at https://angular.io/license
13787
13678
  */
13679
+ // TODO(misko): consider inlining
13680
+ /** Updates binding and returns the value. */
13681
+ function updateBinding(lView, bindingIndex, value) {
13682
+ return lView[bindingIndex] = value;
13683
+ }
13684
+ /** Gets the current binding value. */
13685
+ function getBinding(lView, bindingIndex) {
13686
+ ngDevMode && assertIndexInRange(lView, bindingIndex);
13687
+ ngDevMode &&
13688
+ assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
13689
+ return lView[bindingIndex];
13690
+ }
13788
13691
  /**
13789
- * This file introduces series of globally accessible debug tools
13790
- * to allow for the Angular debugging story to function.
13791
- *
13792
- * To see this in action run the following command:
13793
- *
13794
- * bazel run //packages/core/test/bundling/todo:devserver
13692
+ * Updates binding if changed, then returns whether it was updated.
13795
13693
  *
13796
- * Then load `localhost:5432` and start using the console tools.
13797
- */
13798
- /**
13799
- * This value reflects the property on the window where the dev
13800
- * tools are patched (window.ng).
13801
- * */
13802
- const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
13803
- let _published = false;
13804
- /**
13805
- * Publishes a collection of default debug tools onto`window.ng`.
13694
+ * This function also checks the `CheckNoChangesMode` and throws if changes are made.
13695
+ * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
13696
+ * behavior.
13806
13697
  *
13807
- * These functions are available globally when Angular is in development
13808
- * mode and are automatically stripped away from prod mode is on.
13698
+ * @param lView current `LView`
13699
+ * @param bindingIndex The binding in the `LView` to check
13700
+ * @param value New value to check against `lView[bindingIndex]`
13701
+ * @returns `true` if the bindings has changed. (Throws if binding has changed during
13702
+ * `CheckNoChangesMode`)
13809
13703
  */
13810
- function publishDefaultGlobalUtils$1() {
13811
- if (!_published) {
13812
- _published = true;
13813
- /**
13814
- * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
13815
- * The contract of the function might be changed in any release and/or the function can be
13816
- * removed completely.
13817
- */
13818
- publishGlobalUtil('ɵsetProfiler', setProfiler);
13819
- publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
13820
- publishGlobalUtil('getComponent', getComponent$1);
13821
- publishGlobalUtil('getContext', getContext);
13822
- publishGlobalUtil('getListeners', getListeners);
13823
- publishGlobalUtil('getOwningComponent', getOwningComponent);
13824
- publishGlobalUtil('getHostElement', getHostElement);
13825
- publishGlobalUtil('getInjector', getInjector);
13826
- publishGlobalUtil('getRootComponents', getRootComponents);
13827
- publishGlobalUtil('getDirectives', getDirectives);
13828
- publishGlobalUtil('applyChanges', applyChanges);
13704
+ function bindingUpdated(lView, bindingIndex, value) {
13705
+ ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
13706
+ ngDevMode &&
13707
+ assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
13708
+ const oldValue = lView[bindingIndex];
13709
+ if (Object.is(oldValue, value)) {
13710
+ return false;
13829
13711
  }
13830
- }
13831
- /**
13832
- * Publishes the given function to `window.ng` so that it can be
13833
- * used from the browser console when an application is not in production.
13834
- */
13835
- function publishGlobalUtil(name, fn) {
13836
- if (typeof COMPILED === 'undefined' || !COMPILED) {
13837
- // Note: we can't export `ng` when using closure enhanced optimization as:
13838
- // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
13839
- // - we can't declare a closure extern as the namespace `ng` is already used within Google
13840
- // for typings for AngularJS (via `goog.provide('ng....')`).
13841
- const w = _global;
13842
- ngDevMode && assertDefined(fn, 'function not defined');
13843
- if (w) {
13844
- let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
13845
- if (!container) {
13846
- container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
13712
+ else {
13713
+ if (ngDevMode && isInCheckNoChangesMode()) {
13714
+ // View engine didn't report undefined values as changed on the first checkNoChanges pass
13715
+ // (before the change detection was run).
13716
+ const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
13717
+ if (!devModeEqual(oldValueToCompare, value)) {
13718
+ const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
13719
+ throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
13847
13720
  }
13848
- container[name] = fn;
13721
+ // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
13722
+ // For this reason we exit as if no change. The early exit is needed to prevent the changed
13723
+ // value to be written into `LView` (If we would write the new value that we would not see it
13724
+ // as change on next CD.)
13725
+ return false;
13849
13726
  }
13727
+ lView[bindingIndex] = value;
13728
+ return true;
13850
13729
  }
13851
13730
  }
13731
+ /** Updates 2 bindings if changed, then returns whether either was updated. */
13732
+ function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
13733
+ const different = bindingUpdated(lView, bindingIndex, exp1);
13734
+ return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
13735
+ }
13736
+ /** Updates 3 bindings if changed, then returns whether any was updated. */
13737
+ function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
13738
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13739
+ return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
13740
+ }
13741
+ /** Updates 4 bindings if changed, then returns whether any was updated. */
13742
+ function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
13743
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13744
+ return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
13745
+ }
13852
13746
 
13853
13747
  /**
13854
13748
  * @license
@@ -13857,981 +13751,377 @@ function publishGlobalUtil(name, fn) {
13857
13751
  * Use of this source code is governed by an MIT-style license that can be
13858
13752
  * found in the LICENSE file at https://angular.io/license
13859
13753
  */
13860
- // TODO: A hack to not pull in the NullInjector from @angular/core.
13861
- const NULL_INJECTOR = {
13862
- get: (token, notFoundValue) => {
13863
- throwProviderNotFoundError(token, 'NullInjector');
13864
- }
13865
- };
13866
13754
  /**
13867
- * Bootstraps a Component into an existing host element and returns an instance
13868
- * of the component.
13755
+ * Updates the value of or removes a bound attribute on an Element.
13756
+ *
13757
+ * Used in the case of `[attr.title]="value"`
13869
13758
  *
13870
- * Use this function to bootstrap a component into the DOM tree. Each invocation
13871
- * of this function will create a separate tree of components, injectors and
13872
- * change detection cycles and lifetimes. To dynamically insert a new component
13873
- * into an existing tree such that it shares the same injection, change detection
13874
- * and object lifetime, use {@link ViewContainer#createComponent}.
13759
+ * @param name name The name of the attribute.
13760
+ * @param value value The attribute is removed when value is `null` or `undefined`.
13761
+ * Otherwise the attribute value is set to the stringified value.
13762
+ * @param sanitizer An optional function used to sanitize the value.
13763
+ * @param namespace Optional namespace to use when setting the attribute.
13875
13764
  *
13876
- * @param componentType Component to bootstrap
13877
- * @param options Optional parameters which control bootstrapping
13765
+ * @codeGenApi
13878
13766
  */
13879
- function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
13880
- ngDevMode && publishDefaultGlobalUtils$1();
13881
- ngDevMode && assertComponentType(componentType);
13882
- enableRenderer3();
13883
- const rendererFactory = opts.rendererFactory || domRendererFactory3;
13884
- const sanitizer = opts.sanitizer || null;
13885
- const componentDef = getComponentDef(componentType);
13886
- if (componentDef.type != componentType)
13887
- componentDef.type = componentType;
13888
- // The first index of the first selector is the tag name.
13889
- const componentTag = componentDef.selectors[0][0];
13890
- const hostRenderer = rendererFactory.createRenderer(null, null);
13891
- const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
13892
- const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
13893
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
13894
- const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
13895
- const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
13896
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
13897
- const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
13898
- enterView(rootView);
13899
- let component;
13900
- try {
13901
- if (rendererFactory.begin)
13902
- rendererFactory.begin();
13903
- const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
13904
- component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
13905
- // create mode pass
13906
- renderView(rootTView, rootView, null);
13907
- // update mode pass
13908
- refreshView(rootTView, rootView, null, null);
13909
- }
13910
- finally {
13911
- leaveView();
13912
- if (rendererFactory.end)
13913
- rendererFactory.end();
13767
+ function ɵɵattribute(name, value, sanitizer, namespace) {
13768
+ const lView = getLView();
13769
+ const bindingIndex = nextBindingIndex();
13770
+ if (bindingUpdated(lView, bindingIndex, value)) {
13771
+ const tView = getTView();
13772
+ const tNode = getSelectedTNode();
13773
+ elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
13774
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
13914
13775
  }
13915
- return component;
13776
+ return ɵɵattribute;
13916
13777
  }
13778
+
13917
13779
  /**
13918
- * Creates the root component view and the root component node.
13919
- *
13920
- * @param rNode Render host element.
13921
- * @param def ComponentDef
13922
- * @param rootView The parent view where the host node is stored
13923
- * @param rendererFactory Factory to be used for creating child renderers.
13924
- * @param hostRenderer The current renderer
13925
- * @param sanitizer The sanitizer, if provided
13780
+ * @license
13781
+ * Copyright Google LLC All Rights Reserved.
13926
13782
  *
13927
- * @returns Component view created
13783
+ * Use of this source code is governed by an MIT-style license that can be
13784
+ * found in the LICENSE file at https://angular.io/license
13928
13785
  */
13929
- function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13930
- const tView = rootView[TVIEW];
13931
- const index = HEADER_OFFSET;
13932
- ngDevMode && assertIndexInRange(rootView, index);
13933
- rootView[index] = rNode;
13934
- // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13935
- // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13936
- // representing a host element.
13937
- const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13938
- const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13939
- if (mergedAttrs !== null) {
13940
- computeStaticStyling(tNode, mergedAttrs, true);
13941
- if (rNode !== null) {
13942
- setUpAttributes(hostRenderer, rNode, mergedAttrs);
13943
- if (tNode.classes !== null) {
13944
- writeDirectClass(hostRenderer, rNode, tNode.classes);
13945
- }
13946
- if (tNode.styles !== null) {
13947
- writeDirectStyle(hostRenderer, rNode, tNode.styles);
13948
- }
13949
- }
13950
- }
13951
- const viewRenderer = rendererFactory.createRenderer(rNode, def);
13952
- const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13953
- if (tView.firstCreatePass) {
13954
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13955
- markAsComponentHost(tView, tNode);
13956
- initTNodeFlags(tNode, rootView.length, 1);
13957
- }
13958
- addToViewTree(rootView, componentView);
13959
- // Store component view at node index, with node as the HOST
13960
- return rootView[index] = componentView;
13961
- }
13962
13786
  /**
13963
- * Creates a root component and sets it up with features and host bindings. Shared by
13964
- * renderComponent() and ViewContainerRef.createComponent().
13787
+ * Create interpolation bindings with a variable number of expressions.
13788
+ *
13789
+ * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
13790
+ * Those are faster because there is no need to create an array of expressions and iterate over it.
13791
+ *
13792
+ * `values`:
13793
+ * - has static text at even indexes,
13794
+ * - has evaluated expressions at odd indexes.
13795
+ *
13796
+ * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
13965
13797
  */
13966
- function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13967
- const tView = rootLView[TVIEW];
13968
- // Create directive instance with factory() and store at next index in viewData
13969
- const component = instantiateRootComponent(tView, rootLView, componentDef);
13970
- rootContext.components.push(component);
13971
- componentView[CONTEXT] = component;
13972
- if (hostFeatures !== null) {
13973
- for (const feature of hostFeatures) {
13974
- feature(component, componentDef);
13975
- }
13798
+ function interpolationV(lView, values) {
13799
+ ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
13800
+ ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
13801
+ let isBindingUpdated = false;
13802
+ let bindingIndex = getBindingIndex();
13803
+ for (let i = 1; i < values.length; i += 2) {
13804
+ // Check if bindings (odd indexes) have changed
13805
+ isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
13976
13806
  }
13977
- // We want to generate an empty QueryList for root content queries for backwards
13978
- // compatibility with ViewEngine.
13979
- if (componentDef.contentQueries) {
13980
- const tNode = getCurrentTNode();
13981
- ngDevMode && assertDefined(tNode, 'TNode expected');
13982
- componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13807
+ setBindingIndex(bindingIndex);
13808
+ if (!isBindingUpdated) {
13809
+ return NO_CHANGE;
13983
13810
  }
13984
- const rootTNode = getCurrentTNode();
13985
- ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
13986
- if (tView.firstCreatePass &&
13987
- (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
13988
- setSelectedIndex(rootTNode.index);
13989
- const rootTView = rootLView[TVIEW];
13990
- registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
13991
- invokeHostBindingsInCreationMode(componentDef, component);
13811
+ // Build the updated content
13812
+ let content = values[0];
13813
+ for (let i = 1; i < values.length; i += 2) {
13814
+ content += renderStringify(values[i]) + values[i + 1];
13992
13815
  }
13993
- return component;
13994
- }
13995
- function createRootContext(scheduler, playerHandler) {
13996
- return {
13997
- components: [],
13998
- scheduler: scheduler || defaultScheduler,
13999
- clean: CLEAN_PROMISE,
14000
- playerHandler: playerHandler || null,
14001
- flags: 0 /* RootContextFlags.Empty */
14002
- };
13816
+ return content;
14003
13817
  }
14004
13818
  /**
14005
- * Used to enable lifecycle hooks on the root component.
14006
- *
14007
- * Include this feature when calling `renderComponent` if the root component
14008
- * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
14009
- * be called properly.
14010
- *
14011
- * Example:
13819
+ * Creates an interpolation binding with 1 expression.
14012
13820
  *
14013
- * ```
14014
- * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
14015
- * ```
13821
+ * @param prefix static value used for concatenation only.
13822
+ * @param v0 value checked for change.
13823
+ * @param suffix static value used for concatenation only.
14016
13824
  */
14017
- function LifecycleHooksFeature() {
14018
- const tNode = getCurrentTNode();
14019
- ngDevMode && assertDefined(tNode, 'TNode is required');
14020
- registerPostOrderHooks(getLView()[TVIEW], tNode);
13825
+ function interpolation1(lView, prefix, v0, suffix) {
13826
+ const different = bindingUpdated(lView, nextBindingIndex(), v0);
13827
+ return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14021
13828
  }
14022
13829
  /**
14023
- * Wait on component until it is rendered.
14024
- *
14025
- * This function returns a `Promise` which is resolved when the component's
14026
- * change detection is executed. This is determined by finding the scheduler
14027
- * associated with the `component`'s render tree and waiting until the scheduler
14028
- * flushes. If nothing is scheduled, the function returns a resolved promise.
14029
- *
14030
- * Example:
14031
- * ```
14032
- * await whenRendered(myComponent);
14033
- * ```
14034
- *
14035
- * @param component Component to wait upon
14036
- * @returns Promise which resolves when the component is rendered.
13830
+ * Creates an interpolation binding with 2 expressions.
14037
13831
  */
14038
- function whenRendered(component) {
14039
- return getRootContext(component).clean;
13832
+ function interpolation2(lView, prefix, v0, i0, v1, suffix) {
13833
+ const bindingIndex = getBindingIndex();
13834
+ const different = bindingUpdated2(lView, bindingIndex, v0, v1);
13835
+ incrementBindingIndex(2);
13836
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14040
13837
  }
14041
-
14042
13838
  /**
14043
- * @license
14044
- * Copyright Google LLC All Rights Reserved.
14045
- *
14046
- * Use of this source code is governed by an MIT-style license that can be
14047
- * found in the LICENSE file at https://angular.io/license
13839
+ * Creates an interpolation binding with 3 expressions.
14048
13840
  */
14049
- function getSuperType(type) {
14050
- return Object.getPrototypeOf(type.prototype).constructor;
13841
+ function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
13842
+ const bindingIndex = getBindingIndex();
13843
+ const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
13844
+ incrementBindingIndex(3);
13845
+ return different ?
13846
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
13847
+ NO_CHANGE;
14051
13848
  }
14052
13849
  /**
14053
- * Merges the definition from a super class to a sub class.
14054
- * @param definition The definition that is a SubClass of another directive of component
14055
- *
14056
- * @codeGenApi
13850
+ * Create an interpolation binding with 4 expressions.
14057
13851
  */
14058
- function ɵɵInheritDefinitionFeature(definition) {
14059
- let superType = getSuperType(definition.type);
14060
- let shouldInheritFields = true;
14061
- const inheritanceChain = [definition];
14062
- while (superType) {
14063
- let superDef = undefined;
14064
- if (isComponentDef(definition)) {
14065
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14066
- superDef = superType.ɵcmp || superType.ɵdir;
14067
- }
14068
- else {
14069
- if (superType.ɵcmp) {
14070
- throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
14071
- `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
14072
- }
14073
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14074
- superDef = superType.ɵdir;
14075
- }
14076
- if (superDef) {
14077
- if (shouldInheritFields) {
14078
- inheritanceChain.push(superDef);
14079
- // Some fields in the definition may be empty, if there were no values to put in them that
14080
- // would've justified object creation. Unwrap them if necessary.
14081
- const writeableDef = definition;
14082
- writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
14083
- writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
14084
- writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
14085
- // Merge hostBindings
14086
- const superHostBindings = superDef.hostBindings;
14087
- superHostBindings && inheritHostBindings(definition, superHostBindings);
14088
- // Merge queries
14089
- const superViewQuery = superDef.viewQuery;
14090
- const superContentQueries = superDef.contentQueries;
14091
- superViewQuery && inheritViewQuery(definition, superViewQuery);
14092
- superContentQueries && inheritContentQueries(definition, superContentQueries);
14093
- // Merge inputs and outputs
14094
- fillProperties(definition.inputs, superDef.inputs);
14095
- fillProperties(definition.declaredInputs, superDef.declaredInputs);
14096
- fillProperties(definition.outputs, superDef.outputs);
14097
- // Merge animations metadata.
14098
- // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
14099
- if (isComponentDef(superDef) && superDef.data.animation) {
14100
- // If super def is a Component, the `definition` is also a Component, since Directives can
14101
- // not inherit Components (we throw an error above and cannot reach this code).
14102
- const defData = definition.data;
14103
- defData.animation = (defData.animation || []).concat(superDef.data.animation);
14104
- }
14105
- }
14106
- // Run parent features
14107
- const features = superDef.features;
14108
- if (features) {
14109
- for (let i = 0; i < features.length; i++) {
14110
- const feature = features[i];
14111
- if (feature && feature.ngInherit) {
14112
- feature(definition);
14113
- }
14114
- // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
14115
- // def already has all the necessary information inherited from its super class(es), so we
14116
- // can stop merging fields from super classes. However we need to iterate through the
14117
- // prototype chain to look for classes that might contain other "features" (like
14118
- // NgOnChanges), which we should invoke for the original `definition`. We set the
14119
- // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
14120
- // logic and only invoking functions from the "features" list.
14121
- if (feature === ɵɵInheritDefinitionFeature) {
14122
- shouldInheritFields = false;
14123
- }
14124
- }
14125
- }
14126
- }
14127
- superType = Object.getPrototypeOf(superType);
14128
- }
14129
- mergeHostAttrsAcrossInheritance(inheritanceChain);
13852
+ function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
13853
+ const bindingIndex = getBindingIndex();
13854
+ const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13855
+ incrementBindingIndex(4);
13856
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13857
+ renderStringify(v2) + i2 + renderStringify(v3) + suffix :
13858
+ NO_CHANGE;
14130
13859
  }
14131
13860
  /**
14132
- * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
14133
- *
14134
- * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
14135
- * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
14136
- * type.
13861
+ * Creates an interpolation binding with 5 expressions.
14137
13862
  */
14138
- function mergeHostAttrsAcrossInheritance(inheritanceChain) {
14139
- let hostVars = 0;
14140
- let hostAttrs = null;
14141
- // We process the inheritance order from the base to the leaves here.
14142
- for (let i = inheritanceChain.length - 1; i >= 0; i--) {
14143
- const def = inheritanceChain[i];
14144
- // For each `hostVars`, we need to add the superclass amount.
14145
- def.hostVars = (hostVars += def.hostVars);
14146
- // for each `hostAttrs` we need to merge it with superclass.
14147
- def.hostAttrs =
14148
- mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
14149
- }
14150
- }
14151
- function maybeUnwrapEmpty(value) {
14152
- if (value === EMPTY_OBJ) {
14153
- return {};
14154
- }
14155
- else if (value === EMPTY_ARRAY) {
14156
- return [];
14157
- }
14158
- else {
14159
- return value;
14160
- }
14161
- }
14162
- function inheritViewQuery(definition, superViewQuery) {
14163
- const prevViewQuery = definition.viewQuery;
14164
- if (prevViewQuery) {
14165
- definition.viewQuery = (rf, ctx) => {
14166
- superViewQuery(rf, ctx);
14167
- prevViewQuery(rf, ctx);
14168
- };
14169
- }
14170
- else {
14171
- definition.viewQuery = superViewQuery;
14172
- }
14173
- }
14174
- function inheritContentQueries(definition, superContentQueries) {
14175
- const prevContentQueries = definition.contentQueries;
14176
- if (prevContentQueries) {
14177
- definition.contentQueries = (rf, ctx, directiveIndex) => {
14178
- superContentQueries(rf, ctx, directiveIndex);
14179
- prevContentQueries(rf, ctx, directiveIndex);
14180
- };
14181
- }
14182
- else {
14183
- definition.contentQueries = superContentQueries;
14184
- }
14185
- }
14186
- function inheritHostBindings(definition, superHostBindings) {
14187
- const prevHostBindings = definition.hostBindings;
14188
- if (prevHostBindings) {
14189
- definition.hostBindings = (rf, ctx) => {
14190
- superHostBindings(rf, ctx);
14191
- prevHostBindings(rf, ctx);
14192
- };
14193
- }
14194
- else {
14195
- definition.hostBindings = superHostBindings;
14196
- }
13863
+ function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
13864
+ const bindingIndex = getBindingIndex();
13865
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13866
+ different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
13867
+ incrementBindingIndex(5);
13868
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13869
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
13870
+ NO_CHANGE;
14197
13871
  }
14198
-
14199
13872
  /**
14200
- * @license
14201
- * Copyright Google LLC All Rights Reserved.
14202
- *
14203
- * Use of this source code is governed by an MIT-style license that can be
14204
- * found in the LICENSE file at https://angular.io/license
13873
+ * Creates an interpolation binding with 6 expressions.
14205
13874
  */
13875
+ function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
13876
+ const bindingIndex = getBindingIndex();
13877
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13878
+ different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
13879
+ incrementBindingIndex(6);
13880
+ return different ?
13881
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
13882
+ renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
13883
+ NO_CHANGE;
13884
+ }
14206
13885
  /**
14207
- * Fields which exist on either directive or component definitions, and need to be copied from
14208
- * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13886
+ * Creates an interpolation binding with 7 expressions.
14209
13887
  */
14210
- const COPY_DIRECTIVE_FIELDS = [
14211
- // The child class should use the providers of its parent.
14212
- 'providersResolver',
14213
- // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
14214
- // as inputs, outputs, and host binding functions.
14215
- ];
13888
+ function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
13889
+ const bindingIndex = getBindingIndex();
13890
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13891
+ different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
13892
+ incrementBindingIndex(7);
13893
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13894
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13895
+ renderStringify(v5) + i5 + renderStringify(v6) + suffix :
13896
+ NO_CHANGE;
13897
+ }
14216
13898
  /**
14217
- * Fields which exist only on component definitions, and need to be copied from parent to child
14218
- * classes by the `ɵɵCopyDefinitionFeature`.
14219
- *
14220
- * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
14221
- * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13899
+ * Creates an interpolation binding with 8 expressions.
14222
13900
  */
14223
- const COPY_COMPONENT_FIELDS = [
14224
- // The child class should use the template function of its parent, including all template
14225
- // semantics.
14226
- 'template',
14227
- 'decls',
14228
- 'consts',
14229
- 'vars',
14230
- 'onPush',
14231
- 'ngContentSelectors',
14232
- // The child class should use the CSS styles of its parent, including all styling semantics.
14233
- 'styles',
14234
- 'encapsulation',
14235
- // The child class should be checked by the runtime in the same way as its parent.
14236
- 'schemas',
14237
- ];
13901
+ function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
13902
+ const bindingIndex = getBindingIndex();
13903
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13904
+ different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
13905
+ incrementBindingIndex(8);
13906
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13907
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13908
+ renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
13909
+ NO_CHANGE;
13910
+ }
13911
+
14238
13912
  /**
14239
- * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
14240
- * definition.
14241
13913
  *
14242
- * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
14243
- * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
14244
- * generates a skeleton definition on the child class, and applies this feature.
13914
+ * Update an interpolated attribute on an element with single bound value surrounded by text.
14245
13915
  *
14246
- * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
14247
- * including things like the component template function.
13916
+ * Used when the value passed to a property has 1 interpolated value in it:
14248
13917
  *
14249
- * @param definition The definition of a child class which inherits from a parent class with its
14250
- * own definition.
13918
+ * ```html
13919
+ * <div attr.title="prefix{{v0}}suffix"></div>
13920
+ * ```
14251
13921
  *
14252
- * @codeGenApi
14253
- */
14254
- function ɵɵCopyDefinitionFeature(definition) {
14255
- let superType = getSuperType(definition.type);
14256
- let superDef = undefined;
14257
- if (isComponentDef(definition)) {
14258
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14259
- superDef = superType.ɵcmp;
14260
- }
14261
- else {
14262
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14263
- superDef = superType.ɵdir;
14264
- }
14265
- // Needed because `definition` fields are readonly.
14266
- const defAny = definition;
14267
- // Copy over any fields that apply to either directives or components.
14268
- for (const field of COPY_DIRECTIVE_FIELDS) {
14269
- defAny[field] = superDef[field];
14270
- }
14271
- if (isComponentDef(superDef)) {
14272
- // Copy over any component-specific fields.
14273
- for (const field of COPY_COMPONENT_FIELDS) {
14274
- defAny[field] = superDef[field];
14275
- }
14276
- }
14277
- }
14278
-
14279
- /**
14280
- * @license
14281
- * Copyright Google LLC All Rights Reserved.
13922
+ * Its compiled representation is::
14282
13923
  *
14283
- * Use of this source code is governed by an MIT-style license that can be
14284
- * found in the LICENSE file at https://angular.io/license
13924
+ * ```ts
13925
+ * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
13926
+ * ```
13927
+ *
13928
+ * @param attrName The name of the attribute to update
13929
+ * @param prefix Static value used for concatenation only.
13930
+ * @param v0 Value checked for change.
13931
+ * @param suffix Static value used for concatenation only.
13932
+ * @param sanitizer An optional sanitizer function
13933
+ * @returns itself, so that it may be chained.
13934
+ * @codeGenApi
14285
13935
  */
14286
- let _symbolIterator = null;
14287
- function getSymbolIterator() {
14288
- if (!_symbolIterator) {
14289
- const Symbol = _global['Symbol'];
14290
- if (Symbol && Symbol.iterator) {
14291
- _symbolIterator = Symbol.iterator;
14292
- }
14293
- else {
14294
- // es6-shim specific logic
14295
- const keys = Object.getOwnPropertyNames(Map.prototype);
14296
- for (let i = 0; i < keys.length; ++i) {
14297
- const key = keys[i];
14298
- if (key !== 'entries' && key !== 'size' &&
14299
- Map.prototype[key] === Map.prototype['entries']) {
14300
- _symbolIterator = key;
14301
- }
14302
- }
14303
- }
13936
+ function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
13937
+ const lView = getLView();
13938
+ const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
13939
+ if (interpolatedValue !== NO_CHANGE) {
13940
+ const tNode = getSelectedTNode();
13941
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13942
+ ngDevMode &&
13943
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14304
13944
  }
14305
- return _symbolIterator;
13945
+ return ɵɵattributeInterpolate1;
14306
13946
  }
14307
-
14308
13947
  /**
14309
- * @license
14310
- * Copyright Google LLC All Rights Reserved.
14311
13948
  *
14312
- * Use of this source code is governed by an MIT-style license that can be
14313
- * found in the LICENSE file at https://angular.io/license
13949
+ * Update an interpolated attribute on an element with 2 bound values surrounded by text.
13950
+ *
13951
+ * Used when the value passed to a property has 2 interpolated values in it:
13952
+ *
13953
+ * ```html
13954
+ * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
13955
+ * ```
13956
+ *
13957
+ * Its compiled representation is::
13958
+ *
13959
+ * ```ts
13960
+ * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
13961
+ * ```
13962
+ *
13963
+ * @param attrName The name of the attribute to update
13964
+ * @param prefix Static value used for concatenation only.
13965
+ * @param v0 Value checked for change.
13966
+ * @param i0 Static value used for concatenation only.
13967
+ * @param v1 Value checked for change.
13968
+ * @param suffix Static value used for concatenation only.
13969
+ * @param sanitizer An optional sanitizer function
13970
+ * @returns itself, so that it may be chained.
13971
+ * @codeGenApi
14314
13972
  */
14315
- function isIterable(obj) {
14316
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
14317
- }
14318
- function isListLikeIterable(obj) {
14319
- if (!isJsObject(obj))
14320
- return false;
14321
- return Array.isArray(obj) ||
14322
- (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
14323
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
14324
- }
14325
- function areIterablesEqual(a, b, comparator) {
14326
- const iterator1 = a[getSymbolIterator()]();
14327
- const iterator2 = b[getSymbolIterator()]();
14328
- while (true) {
14329
- const item1 = iterator1.next();
14330
- const item2 = iterator2.next();
14331
- if (item1.done && item2.done)
14332
- return true;
14333
- if (item1.done || item2.done)
14334
- return false;
14335
- if (!comparator(item1.value, item2.value))
14336
- return false;
14337
- }
14338
- }
14339
- function iterateListLike(obj, fn) {
14340
- if (Array.isArray(obj)) {
14341
- for (let i = 0; i < obj.length; i++) {
14342
- fn(obj[i]);
14343
- }
14344
- }
14345
- else {
14346
- const iterator = obj[getSymbolIterator()]();
14347
- let item;
14348
- while (!((item = iterator.next()).done)) {
14349
- fn(item.value);
14350
- }
13973
+ function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
13974
+ const lView = getLView();
13975
+ const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
13976
+ if (interpolatedValue !== NO_CHANGE) {
13977
+ const tNode = getSelectedTNode();
13978
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13979
+ ngDevMode &&
13980
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14351
13981
  }
13982
+ return ɵɵattributeInterpolate2;
14352
13983
  }
14353
- function isJsObject(o) {
14354
- return o !== null && (typeof o === 'function' || typeof o === 'object');
14355
- }
14356
-
14357
13984
  /**
14358
- * @license
14359
- * Copyright Google LLC All Rights Reserved.
14360
13985
  *
14361
- * Use of this source code is governed by an MIT-style license that can be
14362
- * found in the LICENSE file at https://angular.io/license
13986
+ * Update an interpolated attribute on an element with 3 bound values surrounded by text.
13987
+ *
13988
+ * Used when the value passed to a property has 3 interpolated values in it:
13989
+ *
13990
+ * ```html
13991
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
13992
+ * ```
13993
+ *
13994
+ * Its compiled representation is::
13995
+ *
13996
+ * ```ts
13997
+ * ɵɵattributeInterpolate3(
13998
+ * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
13999
+ * ```
14000
+ *
14001
+ * @param attrName The name of the attribute to update
14002
+ * @param prefix Static value used for concatenation only.
14003
+ * @param v0 Value checked for change.
14004
+ * @param i0 Static value used for concatenation only.
14005
+ * @param v1 Value checked for change.
14006
+ * @param i1 Static value used for concatenation only.
14007
+ * @param v2 Value checked for change.
14008
+ * @param suffix Static value used for concatenation only.
14009
+ * @param sanitizer An optional sanitizer function
14010
+ * @returns itself, so that it may be chained.
14011
+ * @codeGenApi
14363
14012
  */
14364
- function devModeEqual(a, b) {
14365
- const isListLikeIterableA = isListLikeIterable(a);
14366
- const isListLikeIterableB = isListLikeIterable(b);
14367
- if (isListLikeIterableA && isListLikeIterableB) {
14368
- return areIterablesEqual(a, b, devModeEqual);
14369
- }
14370
- else {
14371
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
14372
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
14373
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
14374
- return true;
14375
- }
14376
- else {
14377
- return Object.is(a, b);
14378
- }
14013
+ function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14014
+ const lView = getLView();
14015
+ const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14016
+ if (interpolatedValue !== NO_CHANGE) {
14017
+ const tNode = getSelectedTNode();
14018
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14019
+ ngDevMode &&
14020
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14379
14021
  }
14022
+ return ɵɵattributeInterpolate3;
14380
14023
  }
14381
-
14382
14024
  /**
14383
- * @license
14384
- * Copyright Google LLC All Rights Reserved.
14385
14025
  *
14386
- * Use of this source code is governed by an MIT-style license that can be
14387
- * found in the LICENSE file at https://angular.io/license
14026
+ * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14027
+ *
14028
+ * Used when the value passed to a property has 4 interpolated values in it:
14029
+ *
14030
+ * ```html
14031
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14032
+ * ```
14033
+ *
14034
+ * Its compiled representation is::
14035
+ *
14036
+ * ```ts
14037
+ * ɵɵattributeInterpolate4(
14038
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14039
+ * ```
14040
+ *
14041
+ * @param attrName The name of the attribute to update
14042
+ * @param prefix Static value used for concatenation only.
14043
+ * @param v0 Value checked for change.
14044
+ * @param i0 Static value used for concatenation only.
14045
+ * @param v1 Value checked for change.
14046
+ * @param i1 Static value used for concatenation only.
14047
+ * @param v2 Value checked for change.
14048
+ * @param i2 Static value used for concatenation only.
14049
+ * @param v3 Value checked for change.
14050
+ * @param suffix Static value used for concatenation only.
14051
+ * @param sanitizer An optional sanitizer function
14052
+ * @returns itself, so that it may be chained.
14053
+ * @codeGenApi
14388
14054
  */
14389
- // TODO(misko): consider inlining
14390
- /** Updates binding and returns the value. */
14391
- function updateBinding(lView, bindingIndex, value) {
14392
- return lView[bindingIndex] = value;
14393
- }
14394
- /** Gets the current binding value. */
14395
- function getBinding(lView, bindingIndex) {
14396
- ngDevMode && assertIndexInRange(lView, bindingIndex);
14397
- ngDevMode &&
14398
- assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
14399
- return lView[bindingIndex];
14055
+ function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14056
+ const lView = getLView();
14057
+ const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14058
+ if (interpolatedValue !== NO_CHANGE) {
14059
+ const tNode = getSelectedTNode();
14060
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14061
+ ngDevMode &&
14062
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14063
+ }
14064
+ return ɵɵattributeInterpolate4;
14400
14065
  }
14401
14066
  /**
14402
- * Updates binding if changed, then returns whether it was updated.
14403
14067
  *
14404
- * This function also checks the `CheckNoChangesMode` and throws if changes are made.
14405
- * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
14406
- * behavior.
14068
+ * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14407
14069
  *
14408
- * @param lView current `LView`
14409
- * @param bindingIndex The binding in the `LView` to check
14410
- * @param value New value to check against `lView[bindingIndex]`
14411
- * @returns `true` if the bindings has changed. (Throws if binding has changed during
14412
- * `CheckNoChangesMode`)
14413
- */
14414
- function bindingUpdated(lView, bindingIndex, value) {
14415
- ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
14416
- ngDevMode &&
14417
- assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
14418
- const oldValue = lView[bindingIndex];
14419
- if (Object.is(oldValue, value)) {
14420
- return false;
14421
- }
14422
- else {
14423
- if (ngDevMode && isInCheckNoChangesMode()) {
14424
- // View engine didn't report undefined values as changed on the first checkNoChanges pass
14425
- // (before the change detection was run).
14426
- const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
14427
- if (!devModeEqual(oldValueToCompare, value)) {
14428
- const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
14429
- throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
14430
- }
14431
- // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
14432
- // For this reason we exit as if no change. The early exit is needed to prevent the changed
14433
- // value to be written into `LView` (If we would write the new value that we would not see it
14434
- // as change on next CD.)
14435
- return false;
14436
- }
14437
- lView[bindingIndex] = value;
14438
- return true;
14439
- }
14440
- }
14441
- /** Updates 2 bindings if changed, then returns whether either was updated. */
14442
- function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
14443
- const different = bindingUpdated(lView, bindingIndex, exp1);
14444
- return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
14445
- }
14446
- /** Updates 3 bindings if changed, then returns whether any was updated. */
14447
- function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
14448
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14449
- return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
14450
- }
14451
- /** Updates 4 bindings if changed, then returns whether any was updated. */
14452
- function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
14453
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14454
- return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
14455
- }
14456
-
14457
- /**
14458
- * @license
14459
- * Copyright Google LLC All Rights Reserved.
14460
- *
14461
- * Use of this source code is governed by an MIT-style license that can be
14462
- * found in the LICENSE file at https://angular.io/license
14463
- */
14464
- /**
14465
- * Updates the value of or removes a bound attribute on an Element.
14466
- *
14467
- * Used in the case of `[attr.title]="value"`
14468
- *
14469
- * @param name name The name of the attribute.
14470
- * @param value value The attribute is removed when value is `null` or `undefined`.
14471
- * Otherwise the attribute value is set to the stringified value.
14472
- * @param sanitizer An optional function used to sanitize the value.
14473
- * @param namespace Optional namespace to use when setting the attribute.
14474
- *
14475
- * @codeGenApi
14476
- */
14477
- function ɵɵattribute(name, value, sanitizer, namespace) {
14478
- const lView = getLView();
14479
- const bindingIndex = nextBindingIndex();
14480
- if (bindingUpdated(lView, bindingIndex, value)) {
14481
- const tView = getTView();
14482
- const tNode = getSelectedTNode();
14483
- elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
14484
- ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
14485
- }
14486
- return ɵɵattribute;
14487
- }
14488
-
14489
- /**
14490
- * @license
14491
- * Copyright Google LLC All Rights Reserved.
14492
- *
14493
- * Use of this source code is governed by an MIT-style license that can be
14494
- * found in the LICENSE file at https://angular.io/license
14495
- */
14496
- /**
14497
- * Create interpolation bindings with a variable number of expressions.
14498
- *
14499
- * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
14500
- * Those are faster because there is no need to create an array of expressions and iterate over it.
14501
- *
14502
- * `values`:
14503
- * - has static text at even indexes,
14504
- * - has evaluated expressions at odd indexes.
14505
- *
14506
- * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
14507
- */
14508
- function interpolationV(lView, values) {
14509
- ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
14510
- ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
14511
- let isBindingUpdated = false;
14512
- let bindingIndex = getBindingIndex();
14513
- for (let i = 1; i < values.length; i += 2) {
14514
- // Check if bindings (odd indexes) have changed
14515
- isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
14516
- }
14517
- setBindingIndex(bindingIndex);
14518
- if (!isBindingUpdated) {
14519
- return NO_CHANGE;
14520
- }
14521
- // Build the updated content
14522
- let content = values[0];
14523
- for (let i = 1; i < values.length; i += 2) {
14524
- content += renderStringify(values[i]) + values[i + 1];
14525
- }
14526
- return content;
14527
- }
14528
- /**
14529
- * Creates an interpolation binding with 1 expression.
14530
- *
14531
- * @param prefix static value used for concatenation only.
14532
- * @param v0 value checked for change.
14533
- * @param suffix static value used for concatenation only.
14534
- */
14535
- function interpolation1(lView, prefix, v0, suffix) {
14536
- const different = bindingUpdated(lView, nextBindingIndex(), v0);
14537
- return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14538
- }
14539
- /**
14540
- * Creates an interpolation binding with 2 expressions.
14541
- */
14542
- function interpolation2(lView, prefix, v0, i0, v1, suffix) {
14543
- const bindingIndex = getBindingIndex();
14544
- const different = bindingUpdated2(lView, bindingIndex, v0, v1);
14545
- incrementBindingIndex(2);
14546
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14547
- }
14548
- /**
14549
- * Creates an interpolation binding with 3 expressions.
14550
- */
14551
- function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
14552
- const bindingIndex = getBindingIndex();
14553
- const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
14554
- incrementBindingIndex(3);
14555
- return different ?
14556
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
14557
- NO_CHANGE;
14558
- }
14559
- /**
14560
- * Create an interpolation binding with 4 expressions.
14561
- */
14562
- function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
14563
- const bindingIndex = getBindingIndex();
14564
- const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14565
- incrementBindingIndex(4);
14566
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14567
- renderStringify(v2) + i2 + renderStringify(v3) + suffix :
14568
- NO_CHANGE;
14569
- }
14570
- /**
14571
- * Creates an interpolation binding with 5 expressions.
14572
- */
14573
- function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
14574
- const bindingIndex = getBindingIndex();
14575
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14576
- different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
14577
- incrementBindingIndex(5);
14578
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14579
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
14580
- NO_CHANGE;
14581
- }
14582
- /**
14583
- * Creates an interpolation binding with 6 expressions.
14584
- */
14585
- function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
14586
- const bindingIndex = getBindingIndex();
14587
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14588
- different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
14589
- incrementBindingIndex(6);
14590
- return different ?
14591
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
14592
- renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
14593
- NO_CHANGE;
14594
- }
14595
- /**
14596
- * Creates an interpolation binding with 7 expressions.
14597
- */
14598
- function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
14599
- const bindingIndex = getBindingIndex();
14600
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14601
- different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
14602
- incrementBindingIndex(7);
14603
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14604
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14605
- renderStringify(v5) + i5 + renderStringify(v6) + suffix :
14606
- NO_CHANGE;
14607
- }
14608
- /**
14609
- * Creates an interpolation binding with 8 expressions.
14610
- */
14611
- function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
14612
- const bindingIndex = getBindingIndex();
14613
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14614
- different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
14615
- incrementBindingIndex(8);
14616
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14617
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14618
- renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
14619
- NO_CHANGE;
14620
- }
14621
-
14622
- /**
14623
- *
14624
- * Update an interpolated attribute on an element with single bound value surrounded by text.
14625
- *
14626
- * Used when the value passed to a property has 1 interpolated value in it:
14070
+ * Used when the value passed to a property has 5 interpolated values in it:
14627
14071
  *
14628
14072
  * ```html
14629
- * <div attr.title="prefix{{v0}}suffix"></div>
14073
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14630
14074
  * ```
14631
14075
  *
14632
14076
  * Its compiled representation is::
14633
14077
  *
14634
14078
  * ```ts
14635
- * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
14079
+ * ɵɵattributeInterpolate5(
14080
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14636
14081
  * ```
14637
14082
  *
14638
14083
  * @param attrName The name of the attribute to update
14639
14084
  * @param prefix Static value used for concatenation only.
14640
14085
  * @param v0 Value checked for change.
14086
+ * @param i0 Static value used for concatenation only.
14087
+ * @param v1 Value checked for change.
14088
+ * @param i1 Static value used for concatenation only.
14089
+ * @param v2 Value checked for change.
14090
+ * @param i2 Static value used for concatenation only.
14091
+ * @param v3 Value checked for change.
14092
+ * @param i3 Static value used for concatenation only.
14093
+ * @param v4 Value checked for change.
14641
14094
  * @param suffix Static value used for concatenation only.
14642
14095
  * @param sanitizer An optional sanitizer function
14643
14096
  * @returns itself, so that it may be chained.
14644
14097
  * @codeGenApi
14645
14098
  */
14646
- function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
14099
+ function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14647
14100
  const lView = getLView();
14648
- const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
14101
+ const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14649
14102
  if (interpolatedValue !== NO_CHANGE) {
14650
14103
  const tNode = getSelectedTNode();
14651
14104
  elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14652
14105
  ngDevMode &&
14653
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14106
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14654
14107
  }
14655
- return ɵɵattributeInterpolate1;
14108
+ return ɵɵattributeInterpolate5;
14656
14109
  }
14657
14110
  /**
14658
14111
  *
14659
- * Update an interpolated attribute on an element with 2 bound values surrounded by text.
14112
+ * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14660
14113
  *
14661
- * Used when the value passed to a property has 2 interpolated values in it:
14114
+ * Used when the value passed to a property has 6 interpolated values in it:
14662
14115
  *
14663
14116
  * ```html
14664
- * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
14117
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14665
14118
  * ```
14666
14119
  *
14667
14120
  * Its compiled representation is::
14668
14121
  *
14669
14122
  * ```ts
14670
- * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
14671
- * ```
14672
- *
14673
- * @param attrName The name of the attribute to update
14674
- * @param prefix Static value used for concatenation only.
14675
- * @param v0 Value checked for change.
14676
- * @param i0 Static value used for concatenation only.
14677
- * @param v1 Value checked for change.
14678
- * @param suffix Static value used for concatenation only.
14679
- * @param sanitizer An optional sanitizer function
14680
- * @returns itself, so that it may be chained.
14681
- * @codeGenApi
14682
- */
14683
- function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
14684
- const lView = getLView();
14685
- const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
14686
- if (interpolatedValue !== NO_CHANGE) {
14687
- const tNode = getSelectedTNode();
14688
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14689
- ngDevMode &&
14690
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14691
- }
14692
- return ɵɵattributeInterpolate2;
14693
- }
14694
- /**
14695
- *
14696
- * Update an interpolated attribute on an element with 3 bound values surrounded by text.
14697
- *
14698
- * Used when the value passed to a property has 3 interpolated values in it:
14699
- *
14700
- * ```html
14701
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
14702
- * ```
14703
- *
14704
- * Its compiled representation is::
14705
- *
14706
- * ```ts
14707
- * ɵɵattributeInterpolate3(
14708
- * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
14709
- * ```
14710
- *
14711
- * @param attrName The name of the attribute to update
14712
- * @param prefix Static value used for concatenation only.
14713
- * @param v0 Value checked for change.
14714
- * @param i0 Static value used for concatenation only.
14715
- * @param v1 Value checked for change.
14716
- * @param i1 Static value used for concatenation only.
14717
- * @param v2 Value checked for change.
14718
- * @param suffix Static value used for concatenation only.
14719
- * @param sanitizer An optional sanitizer function
14720
- * @returns itself, so that it may be chained.
14721
- * @codeGenApi
14722
- */
14723
- function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14724
- const lView = getLView();
14725
- const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14726
- if (interpolatedValue !== NO_CHANGE) {
14727
- const tNode = getSelectedTNode();
14728
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14729
- ngDevMode &&
14730
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14731
- }
14732
- return ɵɵattributeInterpolate3;
14733
- }
14734
- /**
14735
- *
14736
- * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14737
- *
14738
- * Used when the value passed to a property has 4 interpolated values in it:
14739
- *
14740
- * ```html
14741
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14742
- * ```
14743
- *
14744
- * Its compiled representation is::
14745
- *
14746
- * ```ts
14747
- * ɵɵattributeInterpolate4(
14748
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14749
- * ```
14750
- *
14751
- * @param attrName The name of the attribute to update
14752
- * @param prefix Static value used for concatenation only.
14753
- * @param v0 Value checked for change.
14754
- * @param i0 Static value used for concatenation only.
14755
- * @param v1 Value checked for change.
14756
- * @param i1 Static value used for concatenation only.
14757
- * @param v2 Value checked for change.
14758
- * @param i2 Static value used for concatenation only.
14759
- * @param v3 Value checked for change.
14760
- * @param suffix Static value used for concatenation only.
14761
- * @param sanitizer An optional sanitizer function
14762
- * @returns itself, so that it may be chained.
14763
- * @codeGenApi
14764
- */
14765
- function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14766
- const lView = getLView();
14767
- const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14768
- if (interpolatedValue !== NO_CHANGE) {
14769
- const tNode = getSelectedTNode();
14770
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14771
- ngDevMode &&
14772
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14773
- }
14774
- return ɵɵattributeInterpolate4;
14775
- }
14776
- /**
14777
- *
14778
- * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14779
- *
14780
- * Used when the value passed to a property has 5 interpolated values in it:
14781
- *
14782
- * ```html
14783
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14784
- * ```
14785
- *
14786
- * Its compiled representation is::
14787
- *
14788
- * ```ts
14789
- * ɵɵattributeInterpolate5(
14790
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14791
- * ```
14792
- *
14793
- * @param attrName The name of the attribute to update
14794
- * @param prefix Static value used for concatenation only.
14795
- * @param v0 Value checked for change.
14796
- * @param i0 Static value used for concatenation only.
14797
- * @param v1 Value checked for change.
14798
- * @param i1 Static value used for concatenation only.
14799
- * @param v2 Value checked for change.
14800
- * @param i2 Static value used for concatenation only.
14801
- * @param v3 Value checked for change.
14802
- * @param i3 Static value used for concatenation only.
14803
- * @param v4 Value checked for change.
14804
- * @param suffix Static value used for concatenation only.
14805
- * @param sanitizer An optional sanitizer function
14806
- * @returns itself, so that it may be chained.
14807
- * @codeGenApi
14808
- */
14809
- function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14810
- const lView = getLView();
14811
- const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14812
- if (interpolatedValue !== NO_CHANGE) {
14813
- const tNode = getSelectedTNode();
14814
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14815
- ngDevMode &&
14816
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14817
- }
14818
- return ɵɵattributeInterpolate5;
14819
- }
14820
- /**
14821
- *
14822
- * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14823
- *
14824
- * Used when the value passed to a property has 6 interpolated values in it:
14825
- *
14826
- * ```html
14827
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14828
- * ```
14829
- *
14830
- * Its compiled representation is::
14831
- *
14832
- * ```ts
14833
- * ɵɵattributeInterpolate6(
14834
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
14123
+ * ɵɵattributeInterpolate6(
14124
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
14835
14125
  * ```
14836
14126
  *
14837
14127
  * @param attrName The name of the attribute to update
@@ -15004,6 +14294,57 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
15004
14294
  return ɵɵattributeInterpolateV;
15005
14295
  }
15006
14296
 
14297
+ /**
14298
+ * @license
14299
+ * Copyright Google LLC All Rights Reserved.
14300
+ *
14301
+ * Use of this source code is governed by an MIT-style license that can be
14302
+ * found in the LICENSE file at https://angular.io/license
14303
+ */
14304
+ /**
14305
+ * Synchronously perform change detection on a component (and possibly its sub-components).
14306
+ *
14307
+ * This function triggers change detection in a synchronous way on a component.
14308
+ *
14309
+ * @param component The component which the change detection should be performed on.
14310
+ */
14311
+ function detectChanges(component) {
14312
+ const view = getComponentViewByInstance(component);
14313
+ detectChangesInternal(view[TVIEW], view, component);
14314
+ }
14315
+ /**
14316
+ * Marks the component as dirty (needing change detection). Marking a component dirty will
14317
+ * schedule a change detection on it at some point in the future.
14318
+ *
14319
+ * Marking an already dirty component as dirty won't do anything. Only one outstanding change
14320
+ * detection can be scheduled per component tree.
14321
+ *
14322
+ * @param component Component to mark as dirty.
14323
+ */
14324
+ function markDirty(component) {
14325
+ ngDevMode && assertDefined(component, 'component');
14326
+ const rootView = markViewDirty(getComponentViewByInstance(component));
14327
+ ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
14328
+ scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
14329
+ }
14330
+ /**
14331
+ * Used to perform change detection on the whole application.
14332
+ *
14333
+ * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
14334
+ * executes lifecycle hooks and conditionally checks components based on their
14335
+ * `ChangeDetectionStrategy` and dirtiness.
14336
+ *
14337
+ * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
14338
+ * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
14339
+ * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
14340
+ * be changed when calling `renderComponent` and providing the `scheduler` option.
14341
+ */
14342
+ function tick(component) {
14343
+ const rootView = getRootView(component);
14344
+ const rootContext = rootView[CONTEXT];
14345
+ tickRootContext(rootContext);
14346
+ }
14347
+
15007
14348
  /**
15008
14349
  * @license
15009
14350
  * Copyright Google LLC All Rights Reserved.
@@ -15548,51 +14889,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
15548
14889
  tNode.index;
15549
14890
  // In order to match current behavior, native DOM event listeners must be added for all
15550
14891
  // events (including outputs).
15551
- if (isProceduralRenderer(renderer)) {
15552
- // There might be cases where multiple directives on the same element try to register an event
15553
- // handler function for the same event. In this situation we want to avoid registration of
15554
- // several native listeners as each registration would be intercepted by NgZone and
15555
- // trigger change detection. This would mean that a single user action would result in several
15556
- // change detections being invoked. To avoid this situation we want to have only one call to
15557
- // native handler registration (for the same element and same type of event).
15558
- //
15559
- // In order to have just one native event handler in presence of multiple handler functions,
15560
- // we just register a first handler function as a native event listener and then chain
15561
- // (coalesce) other handler functions on top of the first native handler function.
15562
- let existingListener = null;
15563
- // Please note that the coalescing described here doesn't happen for events specifying an
15564
- // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
15565
- // view engine.
15566
- // Also, we don't have to search for existing listeners is there are no directives
15567
- // matching on a given node as we can't register multiple event handlers for the same event in
15568
- // a template (this would mean having duplicate attributes).
15569
- if (!eventTargetResolver && isTNodeDirectiveHost) {
15570
- existingListener = findExistingListener(tView, lView, eventName, tNode.index);
15571
- }
15572
- if (existingListener !== null) {
15573
- // Attach a new listener to coalesced listeners list, maintaining the order in which
15574
- // listeners are registered. For performance reasons, we keep a reference to the last
15575
- // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
15576
- // the entire set each time we need to add a new listener.
15577
- const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
15578
- lastListenerFn.__ngNextListenerFn__ = listenerFn;
15579
- existingListener.__ngLastListenerFn__ = listenerFn;
15580
- processOutputs = false;
15581
- }
15582
- else {
15583
- listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
15584
- const cleanupFn = renderer.listen(target, eventName, listenerFn);
15585
- ngDevMode && ngDevMode.rendererAddEventListener++;
15586
- lCleanup.push(listenerFn, cleanupFn);
15587
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15588
- }
14892
+ // There might be cases where multiple directives on the same element try to register an event
14893
+ // handler function for the same event. In this situation we want to avoid registration of
14894
+ // several native listeners as each registration would be intercepted by NgZone and
14895
+ // trigger change detection. This would mean that a single user action would result in several
14896
+ // change detections being invoked. To avoid this situation we want to have only one call to
14897
+ // native handler registration (for the same element and same type of event).
14898
+ //
14899
+ // In order to have just one native event handler in presence of multiple handler functions,
14900
+ // we just register a first handler function as a native event listener and then chain
14901
+ // (coalesce) other handler functions on top of the first native handler function.
14902
+ let existingListener = null;
14903
+ // Please note that the coalescing described here doesn't happen for events specifying an
14904
+ // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
14905
+ // view engine.
14906
+ // Also, we don't have to search for existing listeners is there are no directives
14907
+ // matching on a given node as we can't register multiple event handlers for the same event in
14908
+ // a template (this would mean having duplicate attributes).
14909
+ if (!eventTargetResolver && isTNodeDirectiveHost) {
14910
+ existingListener = findExistingListener(tView, lView, eventName, tNode.index);
14911
+ }
14912
+ if (existingListener !== null) {
14913
+ // Attach a new listener to coalesced listeners list, maintaining the order in which
14914
+ // listeners are registered. For performance reasons, we keep a reference to the last
14915
+ // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
14916
+ // the entire set each time we need to add a new listener.
14917
+ const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
14918
+ lastListenerFn.__ngNextListenerFn__ = listenerFn;
14919
+ existingListener.__ngLastListenerFn__ = listenerFn;
14920
+ processOutputs = false;
15589
14921
  }
15590
14922
  else {
15591
- listenerFn = wrapListener(tNode, lView, context, listenerFn, true /** preventDefault */);
15592
- target.addEventListener(eventName, listenerFn, useCapture);
14923
+ listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
14924
+ const cleanupFn = renderer.listen(target, eventName, listenerFn);
15593
14925
  ngDevMode && ngDevMode.rendererAddEventListener++;
15594
- lCleanup.push(listenerFn);
15595
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture);
14926
+ lCleanup.push(listenerFn, cleanupFn);
14927
+ tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15596
14928
  }
15597
14929
  }
15598
14930
  else {
@@ -17666,7 +16998,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
17666
16998
  valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
17667
16999
  }
17668
17000
  let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
17669
- key === prop ? valueAtLViewIndex : undefined;
17001
+ (key === prop ? valueAtLViewIndex : undefined);
17670
17002
  if (containsStatics && !isStylingValuePresent(currentValue)) {
17671
17003
  currentValue = keyValueArrayGet(rawKey, prop);
17672
17004
  }
@@ -21519,7 +20851,7 @@ function noComponentFactoryError(component) {
21519
20851
  return error;
21520
20852
  }
21521
20853
  const ERROR_COMPONENT = 'ngComponent';
21522
- function getComponent(error) {
20854
+ function getComponent$1(error) {
21523
20855
  return error[ERROR_COMPONENT];
21524
20856
  }
21525
20857
  class _NullComponentFactoryResolver {
@@ -21703,14 +21035,6 @@ class Renderer2 {
21703
21035
  * @nocollapse
21704
21036
  */
21705
21037
  Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
21706
- /** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
21707
- function getOrCreateRenderer2(lView) {
21708
- const renderer = lView[RENDERER];
21709
- if (ngDevMode && !isProceduralRenderer(renderer)) {
21710
- throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
21711
- }
21712
- return renderer;
21713
- }
21714
21038
  /** Injects a Renderer2 for the current component. */
21715
21039
  function injectRenderer2() {
21716
21040
  // We need the Renderer to be based on the component that it's being injected into, however since
@@ -21718,7 +21042,7 @@ function injectRenderer2() {
21718
21042
  const lView = getLView();
21719
21043
  const tNode = getCurrentTNode();
21720
21044
  const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
21721
- return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);
21045
+ return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
21722
21046
  }
21723
21047
 
21724
21048
  /**
@@ -21765,7 +21089,7 @@ class Version {
21765
21089
  /**
21766
21090
  * @publicApi
21767
21091
  */
21768
- const VERSION = new Version('14.1.0-next.3');
21092
+ const VERSION = new Version('14.1.0-next.4');
21769
21093
 
21770
21094
  /**
21771
21095
  * @license
@@ -22144,375 +21468,811 @@ class RootViewRef extends ViewRef$1 {
22144
21468
  * Use of this source code is governed by an MIT-style license that can be
22145
21469
  * found in the LICENSE file at https://angular.io/license
22146
21470
  */
22147
- class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
22148
- /**
22149
- * @param ngModule The NgModuleRef to which all resolved factories are bound.
22150
- */
22151
- constructor(ngModule) {
22152
- super();
22153
- this.ngModule = ngModule;
22154
- }
22155
- resolveComponentFactory(component) {
22156
- ngDevMode && assertComponentType(component);
22157
- const componentDef = getComponentDef(component);
22158
- return new ComponentFactory(componentDef, this.ngModule);
22159
- }
22160
- }
22161
- function toRefArray(map) {
22162
- const array = [];
22163
- for (let nonMinified in map) {
22164
- if (map.hasOwnProperty(nonMinified)) {
22165
- const minified = map[nonMinified];
22166
- array.push({ propName: minified, templateName: nonMinified });
21471
+ class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
21472
+ /**
21473
+ * @param ngModule The NgModuleRef to which all resolved factories are bound.
21474
+ */
21475
+ constructor(ngModule) {
21476
+ super();
21477
+ this.ngModule = ngModule;
21478
+ }
21479
+ resolveComponentFactory(component) {
21480
+ ngDevMode && assertComponentType(component);
21481
+ const componentDef = getComponentDef(component);
21482
+ return new ComponentFactory(componentDef, this.ngModule);
21483
+ }
21484
+ }
21485
+ function toRefArray(map) {
21486
+ const array = [];
21487
+ for (let nonMinified in map) {
21488
+ if (map.hasOwnProperty(nonMinified)) {
21489
+ const minified = map[nonMinified];
21490
+ array.push({ propName: minified, templateName: nonMinified });
21491
+ }
21492
+ }
21493
+ return array;
21494
+ }
21495
+ function getNamespace(elementName) {
21496
+ const name = elementName.toLowerCase();
21497
+ return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21498
+ }
21499
+ /**
21500
+ * Injector that looks up a value using a specific injector, before falling back to the module
21501
+ * injector. Used primarily when creating components or embedded views dynamically.
21502
+ */
21503
+ class ChainedInjector {
21504
+ constructor(injector, parentInjector) {
21505
+ this.injector = injector;
21506
+ this.parentInjector = parentInjector;
21507
+ }
21508
+ get(token, notFoundValue, flags) {
21509
+ const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
21510
+ if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
21511
+ notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
21512
+ // Return the value from the root element injector when
21513
+ // - it provides it
21514
+ // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21515
+ // - the module injector should not be checked
21516
+ // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21517
+ return value;
21518
+ }
21519
+ return this.parentInjector.get(token, notFoundValue, flags);
21520
+ }
21521
+ }
21522
+ /**
21523
+ * Render3 implementation of {@link viewEngine_ComponentFactory}.
21524
+ */
21525
+ class ComponentFactory extends ComponentFactory$1 {
21526
+ /**
21527
+ * @param componentDef The component definition.
21528
+ * @param ngModule The NgModuleRef to which the factory is bound.
21529
+ */
21530
+ constructor(componentDef, ngModule) {
21531
+ super();
21532
+ this.componentDef = componentDef;
21533
+ this.ngModule = ngModule;
21534
+ this.componentType = componentDef.type;
21535
+ this.selector = stringifyCSSSelectorList(componentDef.selectors);
21536
+ this.ngContentSelectors =
21537
+ componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
21538
+ this.isBoundToModule = !!ngModule;
21539
+ }
21540
+ get inputs() {
21541
+ return toRefArray(this.componentDef.inputs);
21542
+ }
21543
+ get outputs() {
21544
+ return toRefArray(this.componentDef.outputs);
21545
+ }
21546
+ create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
21547
+ environmentInjector = environmentInjector || this.ngModule;
21548
+ let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
21549
+ environmentInjector :
21550
+ environmentInjector === null || environmentInjector === void 0 ? void 0 : environmentInjector.injector;
21551
+ if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
21552
+ realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
21553
+ realEnvironmentInjector;
21554
+ }
21555
+ const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
21556
+ const rendererFactory = rootViewInjector.get(RendererFactory2, null);
21557
+ if (rendererFactory === null) {
21558
+ throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
21559
+ 'Angular was not able to inject a renderer (RendererFactory2). ' +
21560
+ 'Likely this is due to a broken DI hierarchy. ' +
21561
+ 'Make sure that any injector used to create this component has a correct parent.');
21562
+ }
21563
+ const sanitizer = rootViewInjector.get(Sanitizer, null);
21564
+ const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
21565
+ // Determine a tag name used for creating host elements when this component is created
21566
+ // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
21567
+ const elementName = this.componentDef.selectors[0][0] || 'div';
21568
+ const hostRNode = rootSelectorOrNode ?
21569
+ locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
21570
+ createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
21571
+ const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
21572
+ 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
21573
+ const rootContext = createRootContext();
21574
+ // Create the root view. Uses empty TView and ContentTemplate.
21575
+ const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
21576
+ const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
21577
+ // rootView is the parent when bootstrapping
21578
+ // TODO(misko): it looks like we are entering view here but we don't really need to as
21579
+ // `renderView` does that. However as the code is written it is needed because
21580
+ // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
21581
+ // issues would allow us to drop this.
21582
+ enterView(rootLView);
21583
+ let component;
21584
+ let tElementNode;
21585
+ try {
21586
+ const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
21587
+ if (hostRNode) {
21588
+ if (rootSelectorOrNode) {
21589
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
21590
+ }
21591
+ else {
21592
+ // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
21593
+ // is not defined), also apply attributes and classes extracted from component selector.
21594
+ // Extract attributes and classes from the first selector only to match VE behavior.
21595
+ const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
21596
+ if (attrs) {
21597
+ setUpAttributes(hostRenderer, hostRNode, attrs);
21598
+ }
21599
+ if (classes && classes.length > 0) {
21600
+ writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
21601
+ }
21602
+ }
21603
+ }
21604
+ tElementNode = getTNode(rootTView, HEADER_OFFSET);
21605
+ if (projectableNodes !== undefined) {
21606
+ const projection = tElementNode.projection = [];
21607
+ for (let i = 0; i < this.ngContentSelectors.length; i++) {
21608
+ const nodesforSlot = projectableNodes[i];
21609
+ // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
21610
+ // case). Here we do normalize passed data structure to be an array of arrays to avoid
21611
+ // complex checks down the line.
21612
+ // We also normalize the length of the passed in projectable nodes (to match the number of
21613
+ // <ng-container> slots defined by a component).
21614
+ projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
21615
+ }
21616
+ }
21617
+ // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
21618
+ // executed here?
21619
+ // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
21620
+ component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
21621
+ renderView(rootTView, rootLView, null);
21622
+ }
21623
+ finally {
21624
+ leaveView();
21625
+ }
21626
+ return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
21627
+ }
21628
+ }
21629
+ const componentFactoryResolver = new ComponentFactoryResolver();
21630
+ /**
21631
+ * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
21632
+ * ComponentFactoryResolver
21633
+ * already exists, retrieves the existing ComponentFactoryResolver.
21634
+ *
21635
+ * @returns The ComponentFactoryResolver instance to use
21636
+ */
21637
+ function injectComponentFactoryResolver() {
21638
+ return componentFactoryResolver;
21639
+ }
21640
+ /**
21641
+ * Represents an instance of a Component created via a {@link ComponentFactory}.
21642
+ *
21643
+ * `ComponentRef` provides access to the Component Instance as well other objects related to this
21644
+ * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
21645
+ * method.
21646
+ *
21647
+ */
21648
+ class ComponentRef extends ComponentRef$1 {
21649
+ constructor(componentType, instance, location, _rootLView, _tNode) {
21650
+ super();
21651
+ this.location = location;
21652
+ this._rootLView = _rootLView;
21653
+ this._tNode = _tNode;
21654
+ this.instance = instance;
21655
+ this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
21656
+ this.componentType = componentType;
21657
+ }
21658
+ setInput(name, value) {
21659
+ const inputData = this._tNode.inputs;
21660
+ let dataValue;
21661
+ if (inputData !== null && (dataValue = inputData[name])) {
21662
+ const lView = this._rootLView;
21663
+ setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
21664
+ markDirtyIfOnPush(lView, this._tNode.index);
21665
+ }
21666
+ else {
21667
+ if (ngDevMode) {
21668
+ const cmpNameForError = stringifyForError(this.componentType);
21669
+ let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
21670
+ message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
21671
+ reportUnknownPropertyError(message);
21672
+ }
21673
+ }
21674
+ }
21675
+ get injector() {
21676
+ return new NodeInjector(this._tNode, this._rootLView);
21677
+ }
21678
+ destroy() {
21679
+ this.hostView.destroy();
21680
+ }
21681
+ onDestroy(callback) {
21682
+ this.hostView.onDestroy(callback);
21683
+ }
21684
+ }
21685
+
21686
+ /**
21687
+ * @license
21688
+ * Copyright Google LLC All Rights Reserved.
21689
+ *
21690
+ * Use of this source code is governed by an MIT-style license that can be
21691
+ * found in the LICENSE file at https://angular.io/license
21692
+ */
21693
+ /**
21694
+ * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
21695
+ * @param ngModule NgModule class.
21696
+ * @param parentInjector Optional injector instance to use as a parent for the module injector. If
21697
+ * not provided, `NullInjector` will be used instead.
21698
+ * @publicApi
21699
+ */
21700
+ function createNgModuleRef(ngModule, parentInjector) {
21701
+ return new NgModuleRef(ngModule, parentInjector !== null && parentInjector !== void 0 ? parentInjector : null);
21702
+ }
21703
+ class NgModuleRef extends NgModuleRef$1 {
21704
+ constructor(ngModuleType, _parent) {
21705
+ super();
21706
+ this._parent = _parent;
21707
+ // tslint:disable-next-line:require-internal-with-underscore
21708
+ this._bootstrapComponents = [];
21709
+ this.injector = this;
21710
+ this.destroyCbs = [];
21711
+ // When bootstrapping a module we have a dependency graph that looks like this:
21712
+ // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
21713
+ // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
21714
+ // circular dependency which will result in a runtime error, because the injector doesn't
21715
+ // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
21716
+ // and providing it, rather than letting the injector resolve it.
21717
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21718
+ const ngModuleDef = getNgModuleDef(ngModuleType);
21719
+ ngDevMode &&
21720
+ assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
21721
+ this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
21722
+ this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
21723
+ { provide: NgModuleRef$1, useValue: this }, {
21724
+ provide: ComponentFactoryResolver$1,
21725
+ useValue: this.componentFactoryResolver
21726
+ }
21727
+ ], stringify(ngModuleType), new Set(['environment']));
21728
+ // We need to resolve the injector types separately from the injector creation, because
21729
+ // the module might be trying to use this ref in its constructor for DI which will cause a
21730
+ // circular error that will eventually error out, because the injector isn't created yet.
21731
+ this._r3Injector.resolveInjectorInitializers();
21732
+ this.instance = this.get(ngModuleType);
21733
+ }
21734
+ get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
21735
+ if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
21736
+ return this;
21737
+ }
21738
+ return this._r3Injector.get(token, notFoundValue, injectFlags);
21739
+ }
21740
+ runInContext(fn) {
21741
+ return this.injector.runInContext(fn);
21742
+ }
21743
+ destroy() {
21744
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21745
+ const injector = this._r3Injector;
21746
+ !injector.destroyed && injector.destroy();
21747
+ this.destroyCbs.forEach(fn => fn());
21748
+ this.destroyCbs = null;
21749
+ }
21750
+ onDestroy(callback) {
21751
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21752
+ this.destroyCbs.push(callback);
21753
+ }
21754
+ }
21755
+ class NgModuleFactory extends NgModuleFactory$1 {
21756
+ constructor(moduleType) {
21757
+ super();
21758
+ this.moduleType = moduleType;
21759
+ }
21760
+ create(parentInjector) {
21761
+ return new NgModuleRef(this.moduleType, parentInjector);
21762
+ }
21763
+ }
21764
+ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
21765
+ constructor(providers, parent, source) {
21766
+ super();
21767
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21768
+ this.instance = null;
21769
+ const injector = new R3Injector([
21770
+ ...providers,
21771
+ { provide: NgModuleRef$1, useValue: this },
21772
+ { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
21773
+ ], parent || getNullInjector(), source, new Set(['environment']));
21774
+ this.injector = injector;
21775
+ injector.resolveInjectorInitializers();
21776
+ }
21777
+ destroy() {
21778
+ this.injector.destroy();
21779
+ }
21780
+ onDestroy(callback) {
21781
+ this.injector.onDestroy(callback);
21782
+ }
21783
+ }
21784
+ /**
21785
+ * Create a new environment injector.
21786
+ *
21787
+ * Learn more about environment injectors in
21788
+ * [this guide](guide/standalone-components#environment-injectors).
21789
+ *
21790
+ * @param providers An array of providers.
21791
+ * @param parent A parent environment injector.
21792
+ * @param debugName An optional name for this injector instance, which will be used in error
21793
+ * messages.
21794
+ *
21795
+ * @publicApi
21796
+ * @developerPreview
21797
+ */
21798
+ function createEnvironmentInjector(providers, parent, debugName = null) {
21799
+ const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
21800
+ return adapter.injector;
21801
+ }
21802
+
21803
+ /**
21804
+ * @license
21805
+ * Copyright Google LLC All Rights Reserved.
21806
+ *
21807
+ * Use of this source code is governed by an MIT-style license that can be
21808
+ * found in the LICENSE file at https://angular.io/license
21809
+ */
21810
+ /**
21811
+ * A service used by the framework to create instances of standalone injectors. Those injectors are
21812
+ * created on demand in case of dynamic component instantiation and contain ambient providers
21813
+ * collected from the imports graph rooted at a given standalone component.
21814
+ */
21815
+ class StandaloneService {
21816
+ constructor(_injector) {
21817
+ this._injector = _injector;
21818
+ this.cachedInjectors = new Map();
21819
+ }
21820
+ getOrCreateStandaloneInjector(componentDef) {
21821
+ if (!componentDef.standalone) {
21822
+ return null;
21823
+ }
21824
+ if (!this.cachedInjectors.has(componentDef.id)) {
21825
+ const providers = internalImportProvidersFrom(false, componentDef.type);
21826
+ const standaloneInjector = providers.length > 0 ?
21827
+ createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
21828
+ null;
21829
+ this.cachedInjectors.set(componentDef.id, standaloneInjector);
21830
+ }
21831
+ return this.cachedInjectors.get(componentDef.id);
21832
+ }
21833
+ ngOnDestroy() {
21834
+ try {
21835
+ for (const injector of this.cachedInjectors.values()) {
21836
+ if (injector !== null) {
21837
+ injector.destroy();
21838
+ }
21839
+ }
21840
+ }
21841
+ finally {
21842
+ this.cachedInjectors.clear();
21843
+ }
21844
+ }
21845
+ }
21846
+ /** @nocollapse */
21847
+ StandaloneService.ɵprov = ɵɵdefineInjectable({
21848
+ token: StandaloneService,
21849
+ providedIn: 'environment',
21850
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
21851
+ });
21852
+ /**
21853
+ * A feature that acts as a setup code for the {@link StandaloneService}.
21854
+ *
21855
+ * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
21856
+ * function (an entry points to a standalone injector creation) on a component definition object. We
21857
+ * go through the features infrastructure to make sure that the standalone injector creation logic
21858
+ * is tree-shakable and not included in applications that don't use standalone components.
21859
+ *
21860
+ * @codeGenApi
21861
+ */
21862
+ function ɵɵStandaloneFeature(definition) {
21863
+ definition.getStandaloneInjector = (parentInjector) => {
21864
+ return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
21865
+ };
21866
+ }
21867
+
21868
+ /**
21869
+ * @license
21870
+ * Copyright Google LLC All Rights Reserved.
21871
+ *
21872
+ * Use of this source code is governed by an MIT-style license that can be
21873
+ * found in the LICENSE file at https://angular.io/license
21874
+ */
21875
+ /**
21876
+ * Retrieves the component instance associated with a given DOM element.
21877
+ *
21878
+ * @usageNotes
21879
+ * Given the following DOM structure:
21880
+ *
21881
+ * ```html
21882
+ * <app-root>
21883
+ * <div>
21884
+ * <child-comp></child-comp>
21885
+ * </div>
21886
+ * </app-root>
21887
+ * ```
21888
+ *
21889
+ * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
21890
+ * associated with this DOM element.
21891
+ *
21892
+ * Calling the function on `<app-root>` will return the `MyApp` instance.
21893
+ *
21894
+ *
21895
+ * @param element DOM element from which the component should be retrieved.
21896
+ * @returns Component instance associated with the element or `null` if there
21897
+ * is no component associated with it.
21898
+ *
21899
+ * @publicApi
21900
+ * @globalApi ng
21901
+ */
21902
+ function getComponent(element) {
21903
+ ngDevMode && assertDomElement(element);
21904
+ const context = getLContext(element);
21905
+ if (context === null)
21906
+ return null;
21907
+ if (context.component === undefined) {
21908
+ const lView = context.lView;
21909
+ if (lView === null) {
21910
+ return null;
22167
21911
  }
21912
+ context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
22168
21913
  }
22169
- return array;
21914
+ return context.component;
22170
21915
  }
22171
- function getNamespace(elementName) {
22172
- const name = elementName.toLowerCase();
22173
- return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21916
+ /**
21917
+ * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
21918
+ * view that the element is part of. Otherwise retrieves the instance of the component whose view
21919
+ * owns the element (in this case, the result is the same as calling `getOwningComponent`).
21920
+ *
21921
+ * @param element Element for which to get the surrounding component instance.
21922
+ * @returns Instance of the component that is around the element or null if the element isn't
21923
+ * inside any component.
21924
+ *
21925
+ * @publicApi
21926
+ * @globalApi ng
21927
+ */
21928
+ function getContext(element) {
21929
+ assertDomElement(element);
21930
+ const context = getLContext(element);
21931
+ const lView = context ? context.lView : null;
21932
+ return lView === null ? null : lView[CONTEXT];
22174
21933
  }
22175
21934
  /**
22176
- * Injector that looks up a value using a specific injector, before falling back to the module
22177
- * injector. Used primarily when creating components or embedded views dynamically.
21935
+ * Retrieves the component instance whose view contains the DOM element.
21936
+ *
21937
+ * For example, if `<child-comp>` is used in the template of `<app-comp>`
21938
+ * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
21939
+ * would return `<app-comp>`.
21940
+ *
21941
+ * @param elementOrDir DOM element, component or directive instance
21942
+ * for which to retrieve the root components.
21943
+ * @returns Component instance whose view owns the DOM element or null if the element is not
21944
+ * part of a component view.
21945
+ *
21946
+ * @publicApi
21947
+ * @globalApi ng
22178
21948
  */
22179
- class ChainedInjector {
22180
- constructor(injector, parentInjector) {
22181
- this.injector = injector;
22182
- this.parentInjector = parentInjector;
22183
- }
22184
- get(token, notFoundValue, flags) {
22185
- const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
22186
- if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
22187
- notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
22188
- // Return the value from the root element injector when
22189
- // - it provides it
22190
- // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22191
- // - the module injector should not be checked
22192
- // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22193
- return value;
22194
- }
22195
- return this.parentInjector.get(token, notFoundValue, flags);
21949
+ function getOwningComponent(elementOrDir) {
21950
+ const context = getLContext(elementOrDir);
21951
+ let lView = context ? context.lView : null;
21952
+ if (lView === null)
21953
+ return null;
21954
+ let parent;
21955
+ while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
21956
+ lView = parent;
22196
21957
  }
21958
+ return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
22197
21959
  }
22198
21960
  /**
22199
- * Render3 implementation of {@link viewEngine_ComponentFactory}.
21961
+ * Retrieves all root components associated with a DOM element, directive or component instance.
21962
+ * Root components are those which have been bootstrapped by Angular.
21963
+ *
21964
+ * @param elementOrDir DOM element, component or directive instance
21965
+ * for which to retrieve the root components.
21966
+ * @returns Root components associated with the target object.
21967
+ *
21968
+ * @publicApi
21969
+ * @globalApi ng
22200
21970
  */
22201
- class ComponentFactory extends ComponentFactory$1 {
22202
- /**
22203
- * @param componentDef The component definition.
22204
- * @param ngModule The NgModuleRef to which the factory is bound.
22205
- */
22206
- constructor(componentDef, ngModule) {
22207
- super();
22208
- this.componentDef = componentDef;
22209
- this.ngModule = ngModule;
22210
- this.componentType = componentDef.type;
22211
- this.selector = stringifyCSSSelectorList(componentDef.selectors);
22212
- this.ngContentSelectors =
22213
- componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
22214
- this.isBoundToModule = !!ngModule;
22215
- }
22216
- get inputs() {
22217
- return toRefArray(this.componentDef.inputs);
22218
- }
22219
- get outputs() {
22220
- return toRefArray(this.componentDef.outputs);
22221
- }
22222
- create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
22223
- environmentInjector = environmentInjector || this.ngModule;
22224
- let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
22225
- environmentInjector :
22226
- environmentInjector === null || environmentInjector === void 0 ? void 0 : environmentInjector.injector;
22227
- if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
22228
- realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
22229
- realEnvironmentInjector;
22230
- }
22231
- const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
22232
- const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
22233
- const sanitizer = rootViewInjector.get(Sanitizer, null);
22234
- const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
22235
- // Determine a tag name used for creating host elements when this component is created
22236
- // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
22237
- const elementName = this.componentDef.selectors[0][0] || 'div';
22238
- const hostRNode = rootSelectorOrNode ?
22239
- locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
22240
- createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
22241
- const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
22242
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
22243
- const rootContext = createRootContext();
22244
- // Create the root view. Uses empty TView and ContentTemplate.
22245
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
22246
- const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
22247
- // rootView is the parent when bootstrapping
22248
- // TODO(misko): it looks like we are entering view here but we don't really need to as
22249
- // `renderView` does that. However as the code is written it is needed because
22250
- // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
22251
- // issues would allow us to drop this.
22252
- enterView(rootLView);
22253
- let component;
22254
- let tElementNode;
22255
- try {
22256
- const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
22257
- if (hostRNode) {
22258
- if (rootSelectorOrNode) {
22259
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
22260
- }
22261
- else {
22262
- // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
22263
- // is not defined), also apply attributes and classes extracted from component selector.
22264
- // Extract attributes and classes from the first selector only to match VE behavior.
22265
- const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
22266
- if (attrs) {
22267
- setUpAttributes(hostRenderer, hostRNode, attrs);
22268
- }
22269
- if (classes && classes.length > 0) {
22270
- writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
22271
- }
22272
- }
22273
- }
22274
- tElementNode = getTNode(rootTView, HEADER_OFFSET);
22275
- if (projectableNodes !== undefined) {
22276
- const projection = tElementNode.projection = [];
22277
- for (let i = 0; i < this.ngContentSelectors.length; i++) {
22278
- const nodesforSlot = projectableNodes[i];
22279
- // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
22280
- // case). Here we do normalize passed data structure to be an array of arrays to avoid
22281
- // complex checks down the line.
22282
- // We also normalize the length of the passed in projectable nodes (to match the number of
22283
- // <ng-container> slots defined by a component).
22284
- projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
22285
- }
22286
- }
22287
- // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
22288
- // executed here?
22289
- // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
22290
- component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
22291
- renderView(rootTView, rootLView, null);
22292
- }
22293
- finally {
22294
- leaveView();
21971
+ function getRootComponents(elementOrDir) {
21972
+ const lView = readPatchedLView(elementOrDir);
21973
+ return lView !== null ? [...getRootContext(lView).components] : [];
21974
+ }
21975
+ /**
21976
+ * Retrieves an `Injector` associated with an element, component or directive instance.
21977
+ *
21978
+ * @param elementOrDir DOM element, component or directive instance for which to
21979
+ * retrieve the injector.
21980
+ * @returns Injector associated with the element, component or directive instance.
21981
+ *
21982
+ * @publicApi
21983
+ * @globalApi ng
21984
+ */
21985
+ function getInjector(elementOrDir) {
21986
+ const context = getLContext(elementOrDir);
21987
+ const lView = context ? context.lView : null;
21988
+ if (lView === null)
21989
+ return Injector.NULL;
21990
+ const tNode = lView[TVIEW].data[context.nodeIndex];
21991
+ return new NodeInjector(tNode, lView);
21992
+ }
21993
+ /**
21994
+ * Retrieve a set of injection tokens at a given DOM node.
21995
+ *
21996
+ * @param element Element for which the injection tokens should be retrieved.
21997
+ */
21998
+ function getInjectionTokens(element) {
21999
+ const context = getLContext(element);
22000
+ const lView = context ? context.lView : null;
22001
+ if (lView === null)
22002
+ return [];
22003
+ const tView = lView[TVIEW];
22004
+ const tNode = tView.data[context.nodeIndex];
22005
+ const providerTokens = [];
22006
+ const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
22007
+ const endIndex = tNode.directiveEnd;
22008
+ for (let i = startIndex; i < endIndex; i++) {
22009
+ let value = tView.data[i];
22010
+ if (isDirectiveDefHack(value)) {
22011
+ // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
22012
+ // design flaw. We should always store same type so that we can be monomorphic. The issue
22013
+ // is that for Components/Directives we store the def instead the type. The correct behavior
22014
+ // is that we should always be storing injectable type in this location.
22015
+ value = value.type;
22295
22016
  }
22296
- return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
22017
+ providerTokens.push(value);
22297
22018
  }
22019
+ return providerTokens;
22298
22020
  }
22299
- const componentFactoryResolver = new ComponentFactoryResolver();
22300
22021
  /**
22301
- * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
22302
- * ComponentFactoryResolver
22303
- * already exists, retrieves the existing ComponentFactoryResolver.
22022
+ * Retrieves directive instances associated with a given DOM node. Does not include
22023
+ * component instances.
22304
22024
  *
22305
- * @returns The ComponentFactoryResolver instance to use
22025
+ * @usageNotes
22026
+ * Given the following DOM structure:
22027
+ *
22028
+ * ```html
22029
+ * <app-root>
22030
+ * <button my-button></button>
22031
+ * <my-comp></my-comp>
22032
+ * </app-root>
22033
+ * ```
22034
+ *
22035
+ * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
22036
+ * directive that is associated with the DOM node.
22037
+ *
22038
+ * Calling `getDirectives` on `<my-comp>` will return an empty array.
22039
+ *
22040
+ * @param node DOM node for which to get the directives.
22041
+ * @returns Array of directives associated with the node.
22042
+ *
22043
+ * @publicApi
22044
+ * @globalApi ng
22306
22045
  */
22307
- function injectComponentFactoryResolver() {
22308
- return componentFactoryResolver;
22046
+ function getDirectives(node) {
22047
+ // Skip text nodes because we can't have directives associated with them.
22048
+ if (node instanceof Text) {
22049
+ return [];
22050
+ }
22051
+ const context = getLContext(node);
22052
+ const lView = context ? context.lView : null;
22053
+ if (lView === null) {
22054
+ return [];
22055
+ }
22056
+ const tView = lView[TVIEW];
22057
+ const nodeIndex = context.nodeIndex;
22058
+ if (!(tView === null || tView === void 0 ? void 0 : tView.data[nodeIndex])) {
22059
+ return [];
22060
+ }
22061
+ if (context.directives === undefined) {
22062
+ context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
22063
+ }
22064
+ // The `directives` in this case are a named array called `LComponentView`. Clone the
22065
+ // result so we don't expose an internal data structure in the user's console.
22066
+ return context.directives === null ? [] : [...context.directives];
22309
22067
  }
22310
22068
  /**
22311
- * Represents an instance of a Component created via a {@link ComponentFactory}.
22069
+ * Returns the debug (partial) metadata for a particular directive or component instance.
22070
+ * The function accepts an instance of a directive or component and returns the corresponding
22071
+ * metadata.
22312
22072
  *
22313
- * `ComponentRef` provides access to the Component Instance as well other objects related to this
22314
- * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
22315
- * method.
22073
+ * @param directiveOrComponentInstance Instance of a directive or component
22074
+ * @returns metadata of the passed directive or component
22316
22075
  *
22076
+ * @publicApi
22077
+ * @globalApi ng
22317
22078
  */
22318
- class ComponentRef extends ComponentRef$1 {
22319
- constructor(componentType, instance, location, _rootLView, _tNode) {
22320
- super();
22321
- this.location = location;
22322
- this._rootLView = _rootLView;
22323
- this._tNode = _tNode;
22324
- this.instance = instance;
22325
- this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
22326
- this.componentType = componentType;
22327
- }
22328
- get injector() {
22329
- return new NodeInjector(this._tNode, this._rootLView);
22079
+ function getDirectiveMetadata$1(directiveOrComponentInstance) {
22080
+ const { constructor } = directiveOrComponentInstance;
22081
+ if (!constructor) {
22082
+ throw new Error('Unable to find the instance constructor');
22330
22083
  }
22331
- destroy() {
22332
- this.hostView.destroy();
22084
+ // In case a component inherits from a directive, we may have component and directive metadata
22085
+ // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
22086
+ const componentDef = getComponentDef(constructor);
22087
+ if (componentDef) {
22088
+ return {
22089
+ inputs: componentDef.inputs,
22090
+ outputs: componentDef.outputs,
22091
+ encapsulation: componentDef.encapsulation,
22092
+ changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
22093
+ ChangeDetectionStrategy.Default
22094
+ };
22333
22095
  }
22334
- onDestroy(callback) {
22335
- this.hostView.onDestroy(callback);
22096
+ const directiveDef = getDirectiveDef(constructor);
22097
+ if (directiveDef) {
22098
+ return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
22336
22099
  }
22100
+ return null;
22337
22101
  }
22338
-
22339
22102
  /**
22340
- * @license
22341
- * Copyright Google LLC All Rights Reserved.
22103
+ * Retrieve map of local references.
22342
22104
  *
22343
- * Use of this source code is governed by an MIT-style license that can be
22344
- * found in the LICENSE file at https://angular.io/license
22105
+ * The references are retrieved as a map of local reference name to element or directive instance.
22106
+ *
22107
+ * @param target DOM element, component or directive instance for which to retrieve
22108
+ * the local references.
22345
22109
  */
22110
+ function getLocalRefs(target) {
22111
+ const context = getLContext(target);
22112
+ if (context === null)
22113
+ return {};
22114
+ if (context.localRefs === undefined) {
22115
+ const lView = context.lView;
22116
+ if (lView === null) {
22117
+ return {};
22118
+ }
22119
+ context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
22120
+ }
22121
+ return context.localRefs || {};
22122
+ }
22346
22123
  /**
22347
- * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
22348
- * @param ngModule NgModule class.
22349
- * @param parentInjector Optional injector instance to use as a parent for the module injector. If
22350
- * not provided, `NullInjector` will be used instead.
22124
+ * Retrieves the host element of a component or directive instance.
22125
+ * The host element is the DOM element that matched the selector of the directive.
22126
+ *
22127
+ * @param componentOrDirective Component or directive instance for which the host
22128
+ * element should be retrieved.
22129
+ * @returns Host element of the target.
22130
+ *
22351
22131
  * @publicApi
22132
+ * @globalApi ng
22352
22133
  */
22353
- function createNgModuleRef(ngModule, parentInjector) {
22354
- return new NgModuleRef(ngModule, parentInjector !== null && parentInjector !== void 0 ? parentInjector : null);
22134
+ function getHostElement(componentOrDirective) {
22135
+ return getLContext(componentOrDirective).native;
22355
22136
  }
22356
- class NgModuleRef extends NgModuleRef$1 {
22357
- constructor(ngModuleType, _parent) {
22358
- super();
22359
- this._parent = _parent;
22360
- // tslint:disable-next-line:require-internal-with-underscore
22361
- this._bootstrapComponents = [];
22362
- this.injector = this;
22363
- this.destroyCbs = [];
22364
- // When bootstrapping a module we have a dependency graph that looks like this:
22365
- // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
22366
- // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
22367
- // circular dependency which will result in a runtime error, because the injector doesn't
22368
- // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
22369
- // and providing it, rather than letting the injector resolve it.
22370
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22371
- const ngModuleDef = getNgModuleDef(ngModuleType);
22372
- ngDevMode &&
22373
- assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
22374
- this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
22375
- this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
22376
- { provide: NgModuleRef$1, useValue: this }, {
22377
- provide: ComponentFactoryResolver$1,
22378
- useValue: this.componentFactoryResolver
22137
+ /**
22138
+ * Retrieves the rendered text for a given component.
22139
+ *
22140
+ * This function retrieves the host element of a component and
22141
+ * and then returns the `textContent` for that element. This implies
22142
+ * that the text returned will include re-projected content of
22143
+ * the component as well.
22144
+ *
22145
+ * @param component The component to return the content text for.
22146
+ */
22147
+ function getRenderedText(component) {
22148
+ const hostElement = getHostElement(component);
22149
+ return hostElement.textContent || '';
22150
+ }
22151
+ /**
22152
+ * Retrieves a list of event listeners associated with a DOM element. The list does include host
22153
+ * listeners, but it does not include event listeners defined outside of the Angular context
22154
+ * (e.g. through `addEventListener`).
22155
+ *
22156
+ * @usageNotes
22157
+ * Given the following DOM structure:
22158
+ *
22159
+ * ```html
22160
+ * <app-root>
22161
+ * <div (click)="doSomething()"></div>
22162
+ * </app-root>
22163
+ * ```
22164
+ *
22165
+ * Calling `getListeners` on `<div>` will return an object that looks as follows:
22166
+ *
22167
+ * ```ts
22168
+ * {
22169
+ * name: 'click',
22170
+ * element: <div>,
22171
+ * callback: () => doSomething(),
22172
+ * useCapture: false
22173
+ * }
22174
+ * ```
22175
+ *
22176
+ * @param element Element for which the DOM listeners should be retrieved.
22177
+ * @returns Array of event listeners on the DOM element.
22178
+ *
22179
+ * @publicApi
22180
+ * @globalApi ng
22181
+ */
22182
+ function getListeners(element) {
22183
+ ngDevMode && assertDomElement(element);
22184
+ const lContext = getLContext(element);
22185
+ const lView = lContext === null ? null : lContext.lView;
22186
+ if (lView === null)
22187
+ return [];
22188
+ const tView = lView[TVIEW];
22189
+ const lCleanup = lView[CLEANUP];
22190
+ const tCleanup = tView.cleanup;
22191
+ const listeners = [];
22192
+ if (tCleanup && lCleanup) {
22193
+ for (let i = 0; i < tCleanup.length;) {
22194
+ const firstParam = tCleanup[i++];
22195
+ const secondParam = tCleanup[i++];
22196
+ if (typeof firstParam === 'string') {
22197
+ const name = firstParam;
22198
+ const listenerElement = unwrapRNode(lView[secondParam]);
22199
+ const callback = lCleanup[tCleanup[i++]];
22200
+ const useCaptureOrIndx = tCleanup[i++];
22201
+ // if useCaptureOrIndx is boolean then report it as is.
22202
+ // if useCaptureOrIndx is positive number then it in unsubscribe method
22203
+ // if useCaptureOrIndx is negative number then it is a Subscription
22204
+ const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
22205
+ const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
22206
+ if (element == listenerElement) {
22207
+ listeners.push({ element, name, callback, useCapture, type });
22208
+ }
22379
22209
  }
22380
- ], stringify(ngModuleType), new Set(['environment']));
22381
- // We need to resolve the injector types separately from the injector creation, because
22382
- // the module might be trying to use this ref in its constructor for DI which will cause a
22383
- // circular error that will eventually error out, because the injector isn't created yet.
22384
- this._r3Injector.resolveInjectorInitializers();
22385
- this.instance = this.get(ngModuleType);
22386
- }
22387
- get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
22388
- if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
22389
- return this;
22390
22210
  }
22391
- return this._r3Injector.get(token, notFoundValue, injectFlags);
22392
- }
22393
- destroy() {
22394
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22395
- const injector = this._r3Injector;
22396
- !injector.destroyed && injector.destroy();
22397
- this.destroyCbs.forEach(fn => fn());
22398
- this.destroyCbs = null;
22399
- }
22400
- onDestroy(callback) {
22401
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22402
- this.destroyCbs.push(callback);
22403
- }
22404
- }
22405
- class NgModuleFactory extends NgModuleFactory$1 {
22406
- constructor(moduleType) {
22407
- super();
22408
- this.moduleType = moduleType;
22409
- }
22410
- create(parentInjector) {
22411
- return new NgModuleRef(this.moduleType, parentInjector);
22412
22211
  }
22212
+ listeners.sort(sortListeners);
22213
+ return listeners;
22413
22214
  }
22414
- class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
22415
- constructor(providers, parent, source) {
22416
- super();
22417
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22418
- this.instance = null;
22419
- const injector = new R3Injector([
22420
- ...providers,
22421
- { provide: NgModuleRef$1, useValue: this },
22422
- { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
22423
- ], parent || getNullInjector(), source, new Set(['environment']));
22424
- this.injector = injector;
22425
- injector.resolveInjectorInitializers();
22426
- }
22427
- destroy() {
22428
- this.injector.destroy();
22429
- }
22430
- onDestroy(callback) {
22431
- this.injector.onDestroy(callback);
22432
- }
22215
+ function sortListeners(a, b) {
22216
+ if (a.name == b.name)
22217
+ return 0;
22218
+ return a.name < b.name ? -1 : 1;
22433
22219
  }
22434
22220
  /**
22435
- * Create a new environment injector.
22436
- *
22437
- * Learn more about environment injectors in
22438
- * [this guide](guide/standalone-components#environment-injectors).
22439
- *
22440
- * @param providers An array of providers.
22441
- * @param parent A parent environment injector.
22442
- * @param debugName An optional name for this injector instance, which will be used in error
22443
- * messages.
22221
+ * This function should not exist because it is megamorphic and only mostly correct.
22444
22222
  *
22445
- * @publicApi
22446
- * @developerPreview
22223
+ * See call site for more info.
22447
22224
  */
22448
- function createEnvironmentInjector(providers, parent, debugName = null) {
22449
- const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
22450
- return adapter.injector;
22225
+ function isDirectiveDefHack(obj) {
22226
+ return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
22451
22227
  }
22452
-
22453
22228
  /**
22454
- * @license
22455
- * Copyright Google LLC All Rights Reserved.
22229
+ * Returns the attached `DebugNode` instance for an element in the DOM.
22456
22230
  *
22457
- * Use of this source code is governed by an MIT-style license that can be
22458
- * found in the LICENSE file at https://angular.io/license
22459
- */
22460
- /**
22461
- * A service used by the framework to create instances of standalone injectors. Those injectors are
22462
- * created on demand in case of dynamic component instantiation and contain ambient providers
22463
- * collected from the imports graph rooted at a given standalone component.
22231
+ * @param element DOM element which is owned by an existing component's view.
22464
22232
  */
22465
- class StandaloneService {
22466
- constructor(_injector) {
22467
- this._injector = _injector;
22468
- this.cachedInjectors = new Map();
22233
+ function getDebugNode$1(element) {
22234
+ if (ngDevMode && !(element instanceof Node)) {
22235
+ throw new Error('Expecting instance of DOM Element');
22469
22236
  }
22470
- getOrCreateStandaloneInjector(componentDef) {
22471
- if (!componentDef.standalone) {
22472
- return null;
22473
- }
22474
- if (!this.cachedInjectors.has(componentDef.id)) {
22475
- const providers = internalImportProvidersFrom(false, componentDef.type);
22476
- const standaloneInjector = providers.length > 0 ?
22477
- createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
22478
- null;
22479
- this.cachedInjectors.set(componentDef.id, standaloneInjector);
22480
- }
22481
- return this.cachedInjectors.get(componentDef.id);
22237
+ const lContext = getLContext(element);
22238
+ const lView = lContext ? lContext.lView : null;
22239
+ if (lView === null) {
22240
+ return null;
22482
22241
  }
22483
- ngOnDestroy() {
22484
- try {
22485
- for (const injector of this.cachedInjectors.values()) {
22486
- if (injector !== null) {
22487
- injector.destroy();
22488
- }
22489
- }
22490
- }
22491
- finally {
22492
- this.cachedInjectors.clear();
22493
- }
22242
+ const nodeIndex = lContext.nodeIndex;
22243
+ if (nodeIndex !== -1) {
22244
+ const valueInLView = lView[nodeIndex];
22245
+ // this means that value in the lView is a component with its own
22246
+ // data. In this situation the TNode is not accessed at the same spot.
22247
+ const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
22248
+ ngDevMode &&
22249
+ assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
22250
+ return buildDebugNode(tNode, lView);
22494
22251
  }
22252
+ return null;
22495
22253
  }
22496
- /** @nocollapse */
22497
- StandaloneService.ɵprov = ɵɵdefineInjectable({
22498
- token: StandaloneService,
22499
- providedIn: 'environment',
22500
- factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
22501
- });
22502
22254
  /**
22503
- * A feature that acts as a setup code for the {@link StandaloneService}.
22255
+ * Retrieve the component `LView` from component/element.
22504
22256
  *
22505
- * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
22506
- * function (an entry points to a standalone injector creation) on a component definition object. We
22507
- * go through the features infrastructure to make sure that the standalone injector creation logic
22508
- * is tree-shakable and not included in applications that don't use standalone components.
22257
+ * NOTE: `LView` is a private and should not be leaked outside.
22258
+ * Don't export this method to `ng.*` on window.
22509
22259
  *
22510
- * @codeGenApi
22260
+ * @param target DOM element or component instance for which to retrieve the LView.
22511
22261
  */
22512
- function ɵɵStandaloneFeature(definition) {
22513
- definition.getStandaloneInjector = (parentInjector) => {
22514
- return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
22515
- };
22262
+ function getComponentLView(target) {
22263
+ const lContext = getLContext(target);
22264
+ const nodeIndx = lContext.nodeIndex;
22265
+ const lView = lContext.lView;
22266
+ ngDevMode && assertLView(lView);
22267
+ const componentLView = lView[nodeIndx];
22268
+ ngDevMode && assertLView(componentLView);
22269
+ return componentLView;
22270
+ }
22271
+ /** Asserts that a value is a DOM Element. */
22272
+ function assertDomElement(value) {
22273
+ if (typeof Element !== 'undefined' && !(value instanceof Element)) {
22274
+ throw new Error('Expecting instance of DOM Element');
22275
+ }
22516
22276
  }
22517
22277
 
22518
22278
  /**
@@ -23733,7 +23493,7 @@ const unusedValueExportToPlacateAjd = 1;
23733
23493
  * Use of this source code is governed by an MIT-style license that can be
23734
23494
  * found in the LICENSE file at https://angular.io/license
23735
23495
  */
23736
- const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd;
23496
+ const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
23737
23497
  class LQuery_ {
23738
23498
  constructor(queryList) {
23739
23499
  this.queryList = queryList;
@@ -26155,6 +25915,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
26155
25915
  class CompilerFactory {
26156
25916
  }
26157
25917
 
25918
+ /**
25919
+ * @license
25920
+ * Copyright Google LLC All Rights Reserved.
25921
+ *
25922
+ * Use of this source code is governed by an MIT-style license that can be
25923
+ * found in the LICENSE file at https://angular.io/license
25924
+ */
25925
+ /**
25926
+ * Marks a component for check (in case of OnPush components) and synchronously
25927
+ * performs change detection on the application this component belongs to.
25928
+ *
25929
+ * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
25930
+ *
25931
+ * @publicApi
25932
+ * @globalApi ng
25933
+ */
25934
+ function applyChanges(component) {
25935
+ markDirty(component);
25936
+ getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
25937
+ }
25938
+
25939
+ /**
25940
+ * @license
25941
+ * Copyright Google LLC All Rights Reserved.
25942
+ *
25943
+ * Use of this source code is governed by an MIT-style license that can be
25944
+ * found in the LICENSE file at https://angular.io/license
25945
+ */
25946
+ /**
25947
+ * This file introduces series of globally accessible debug tools
25948
+ * to allow for the Angular debugging story to function.
25949
+ *
25950
+ * To see this in action run the following command:
25951
+ *
25952
+ * bazel run //packages/core/test/bundling/todo:devserver
25953
+ *
25954
+ * Then load `localhost:5432` and start using the console tools.
25955
+ */
25956
+ /**
25957
+ * This value reflects the property on the window where the dev
25958
+ * tools are patched (window.ng).
25959
+ * */
25960
+ const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
25961
+ let _published = false;
25962
+ /**
25963
+ * Publishes a collection of default debug tools onto`window.ng`.
25964
+ *
25965
+ * These functions are available globally when Angular is in development
25966
+ * mode and are automatically stripped away from prod mode is on.
25967
+ */
25968
+ function publishDefaultGlobalUtils$1() {
25969
+ if (!_published) {
25970
+ _published = true;
25971
+ /**
25972
+ * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
25973
+ * The contract of the function might be changed in any release and/or the function can be
25974
+ * removed completely.
25975
+ */
25976
+ publishGlobalUtil('ɵsetProfiler', setProfiler);
25977
+ publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
25978
+ publishGlobalUtil('getComponent', getComponent);
25979
+ publishGlobalUtil('getContext', getContext);
25980
+ publishGlobalUtil('getListeners', getListeners);
25981
+ publishGlobalUtil('getOwningComponent', getOwningComponent);
25982
+ publishGlobalUtil('getHostElement', getHostElement);
25983
+ publishGlobalUtil('getInjector', getInjector);
25984
+ publishGlobalUtil('getRootComponents', getRootComponents);
25985
+ publishGlobalUtil('getDirectives', getDirectives);
25986
+ publishGlobalUtil('applyChanges', applyChanges);
25987
+ }
25988
+ }
25989
+ /**
25990
+ * Publishes the given function to `window.ng` so that it can be
25991
+ * used from the browser console when an application is not in production.
25992
+ */
25993
+ function publishGlobalUtil(name, fn) {
25994
+ if (typeof COMPILED === 'undefined' || !COMPILED) {
25995
+ // Note: we can't export `ng` when using closure enhanced optimization as:
25996
+ // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
25997
+ // - we can't declare a closure extern as the namespace `ng` is already used within Google
25998
+ // for typings for AngularJS (via `goog.provide('ng....')`).
25999
+ const w = _global;
26000
+ ngDevMode && assertDefined(fn, 'function not defined');
26001
+ if (w) {
26002
+ let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
26003
+ if (!container) {
26004
+ container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
26005
+ }
26006
+ container[name] = fn;
26007
+ }
26008
+ }
26009
+ }
26010
+
26158
26011
  /**
26159
26012
  * @license
26160
26013
  * Copyright Google LLC All Rights Reserved.
@@ -28071,7 +27924,7 @@ class DebugNode {
28071
27924
  get componentInstance() {
28072
27925
  const nativeElement = this.nativeNode;
28073
27926
  return nativeElement &&
28074
- (getComponent$1(nativeElement) || getOwningComponent(nativeElement));
27927
+ (getComponent(nativeElement) || getOwningComponent(nativeElement));
28075
27928
  }
28076
27929
  /**
28077
27930
  * An object that provides parent context for this element. Often an ancestor component instance
@@ -28082,7 +27935,7 @@ class DebugNode {
28082
27935
  * of heroes"`.
28083
27936
  */
28084
27937
  get context() {
28085
- return getComponent$1(this.nativeNode) || getContext(this.nativeNode);
27938
+ return getComponent(this.nativeNode) || getContext(this.nativeNode);
28086
27939
  }
28087
27940
  /**
28088
27941
  * The callbacks attached to the component's @Output properties and/or the element's event
@@ -28422,8 +28275,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
28422
28275
  // Renderer2, however that's not the case in Ivy. This approach is being used because:
28423
28276
  // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
28424
28277
  // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
28425
- // 2. We would have to make `Renderer3` "know" about debug nodes.
28426
- // 3. It allows us to capture nodes that were inserted directly via the DOM.
28278
+ // 2. It allows us to capture nodes that were inserted directly via the DOM.
28427
28279
  nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
28428
28280
  }
28429
28281
  // In all cases, if a dynamic container exists for this node, each view inside it has to be
@@ -29895,5 +29747,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
29895
29747
  * Generated bundle index. Do not edit.
29896
29748
  */
29897
29749
 
29898
- export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderComponent as ɵrenderComponent, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
29750
+ export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
29899
29751
  //# sourceMappingURL=core.mjs.map