@angular/core 8.0.3 → 8.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/bundles/core-testing.umd.js +35 -9
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core-testing.umd.min.js +10 -10
  4. package/bundles/core-testing.umd.min.js.map +1 -1
  5. package/bundles/core.umd.js +11379 -9387
  6. package/bundles/core.umd.js.map +1 -1
  7. package/bundles/core.umd.min.js +205 -135
  8. package/bundles/core.umd.min.js.map +1 -1
  9. package/core.d.ts +1286 -406
  10. package/core.metadata.json +1 -1
  11. package/esm2015/core.js +2 -3
  12. package/esm2015/index.js +2 -2
  13. package/esm2015/public_api.js +2 -2
  14. package/esm2015/src/application_ref.js +7 -1
  15. package/esm2015/src/codegen_private_exports.js +2 -2
  16. package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
  17. package/esm2015/src/core.js +4 -4
  18. package/esm2015/src/core_private_export.js +3 -1
  19. package/esm2015/src/core_render3_private_export.js +5 -3
  20. package/esm2015/src/debug/debug_node.js +4 -4
  21. package/esm2015/src/di/index.js +3 -3
  22. package/esm2015/src/di/injectable.js +1 -1
  23. package/esm2015/src/di/injector.js +24 -96
  24. package/esm2015/src/di/injector_compatibility.js +103 -6
  25. package/esm2015/src/di/interface/defs.js +24 -3
  26. package/esm2015/src/di/interface/provider.js +1 -1
  27. package/esm2015/src/di/r3_injector.js +82 -49
  28. package/esm2015/src/di/reflective_injector.js +3 -2
  29. package/esm2015/src/di.js +1 -1
  30. package/esm2015/src/i18n/locale_data.js +61 -0
  31. package/esm2015/src/i18n/locale_data_api.js +53 -0
  32. package/esm2015/src/i18n/locale_en.js +51 -0
  33. package/esm2015/src/i18n/localization.js +37 -0
  34. package/esm2015/src/linker/ng_module_factory_loader.js +4 -52
  35. package/esm2015/src/linker/ng_module_factory_registration.js +83 -0
  36. package/esm2015/src/metadata/directives.js +2 -2
  37. package/esm2015/src/metadata/ng_module.js +6 -1
  38. package/esm2015/src/metadata/resource_loading.js +2 -2
  39. package/esm2015/src/reflection/reflection_capabilities.js +14 -3
  40. package/esm2015/src/render3/assert.js +3 -2
  41. package/esm2015/src/render3/component.js +11 -5
  42. package/esm2015/src/render3/component_ref.js +4 -2
  43. package/esm2015/src/render3/debug.js +23 -15
  44. package/esm2015/src/render3/definition.js +12 -2
  45. package/esm2015/src/render3/errors.js +29 -1
  46. package/esm2015/src/render3/features/inherit_definition_feature.js +51 -37
  47. package/esm2015/src/render3/fields.js +3 -1
  48. package/esm2015/src/render3/i18n.js +76 -465
  49. package/esm2015/src/render3/index.js +3 -3
  50. package/esm2015/src/render3/instructions/all.js +10 -5
  51. package/esm2015/src/render3/instructions/attribute.js +28 -0
  52. package/esm2015/src/render3/instructions/attribute_interpolation.js +376 -0
  53. package/esm2015/src/render3/instructions/container.js +17 -16
  54. package/esm2015/src/render3/instructions/element.js +57 -35
  55. package/esm2015/src/render3/instructions/element_container.js +9 -8
  56. package/esm2015/src/render3/instructions/embedded_view.js +9 -12
  57. package/esm2015/src/render3/instructions/interpolation.js +375 -0
  58. package/esm2015/src/render3/instructions/listener.js +3 -2
  59. package/esm2015/src/render3/instructions/projection.js +18 -57
  60. package/esm2015/src/render3/instructions/property.js +10 -4
  61. package/esm2015/src/render3/instructions/property_interpolation.js +49 -382
  62. package/esm2015/src/render3/instructions/shared.js +82 -118
  63. package/esm2015/src/render3/instructions/styling.js +189 -236
  64. package/esm2015/src/render3/instructions/text.js +8 -7
  65. package/esm2015/src/render3/instructions/text_interpolation.js +357 -0
  66. package/esm2015/src/render3/interfaces/container.js +9 -5
  67. package/esm2015/src/render3/interfaces/definition.js +12 -6
  68. package/esm2015/src/render3/interfaces/node.js +20 -8
  69. package/esm2015/src/render3/interfaces/projection.js +1 -1
  70. package/esm2015/src/render3/interfaces/styling.js +16 -15
  71. package/esm2015/src/render3/interfaces/view.js +2 -2
  72. package/esm2015/src/render3/jit/directive.js +14 -5
  73. package/esm2015/src/render3/jit/environment.js +30 -15
  74. package/esm2015/src/render3/jit/module.js +38 -19
  75. package/esm2015/src/render3/ng_module_ref.js +39 -3
  76. package/esm2015/src/render3/node_manipulation.js +45 -43
  77. package/esm2015/src/render3/node_selector_matcher.js +40 -14
  78. package/esm2015/src/render3/query.js +77 -61
  79. package/esm2015/src/render3/state.js +33 -6
  80. package/esm2015/src/render3/styling/class_and_style_bindings.js +92 -80
  81. package/esm2015/src/render3/styling/host_instructions_queue.js +8 -5
  82. package/esm2015/src/render3/styling/shared.js +2 -2
  83. package/esm2015/src/render3/styling/util.js +2 -2
  84. package/esm2015/src/render3/styling_next/bindings.js +602 -0
  85. package/esm2015/src/render3/styling_next/instructions.js +366 -0
  86. package/esm2015/src/render3/styling_next/interfaces.js +374 -0
  87. package/esm2015/src/render3/styling_next/map_based_bindings.js +408 -0
  88. package/esm2015/src/render3/styling_next/state.js +51 -0
  89. package/esm2015/src/render3/styling_next/styling_debug.js +291 -0
  90. package/esm2015/src/render3/styling_next/util.js +259 -0
  91. package/esm2015/src/render3/util/attrs_utils.js +4 -3
  92. package/esm2015/src/render3/util/debug_utils.js +18 -0
  93. package/esm2015/src/render3/util/view_traversal_utils.js +2 -2
  94. package/esm2015/src/render3/view_engine_compatibility.js +24 -10
  95. package/esm2015/src/sanitization/sanitization.js +17 -7
  96. package/esm2015/src/sanitization/style_sanitizer.js +11 -1
  97. package/esm2015/src/util/ng_dev_mode.js +7 -3
  98. package/esm2015/src/version.js +1 -1
  99. package/esm2015/src/view/ng_module.js +3 -3
  100. package/esm2015/src/view/util.js +2 -2
  101. package/esm2015/testing/src/r3_test_bed_compiler.js +44 -12
  102. package/esm2015/testing/src/test_bed_common.js +2 -5
  103. package/esm5/core.js +2 -3
  104. package/esm5/src/application_ref.js +6 -1
  105. package/esm5/src/codegen_private_exports.js +2 -2
  106. package/esm5/src/compiler/compiler_facade_interface.js +1 -1
  107. package/esm5/src/core_private_export.js +3 -1
  108. package/esm5/src/core_render3_private_export.js +5 -3
  109. package/esm5/src/debug/debug_node.js +4 -4
  110. package/esm5/src/di/index.js +3 -3
  111. package/esm5/src/di/injectable.js +1 -1
  112. package/esm5/src/di/injector.js +14 -74
  113. package/esm5/src/di/injector_compatibility.js +77 -6
  114. package/esm5/src/di/interface/defs.js +24 -3
  115. package/esm5/src/di/interface/provider.js +1 -1
  116. package/esm5/src/di/r3_injector.js +60 -37
  117. package/esm5/src/di/reflective_injector.js +3 -2
  118. package/esm5/src/i18n/locale_data.js +38 -0
  119. package/esm5/src/i18n/locale_data_api.js +46 -0
  120. package/esm5/src/i18n/locale_en.js +39 -0
  121. package/esm5/src/i18n/localization.js +29 -0
  122. package/esm5/src/linker/ng_module_factory_loader.js +4 -32
  123. package/esm5/src/linker/ng_module_factory_registration.js +50 -0
  124. package/esm5/src/metadata/directives.js +2 -2
  125. package/esm5/src/metadata/ng_module.js +1 -1
  126. package/esm5/src/metadata/resource_loading.js +2 -2
  127. package/esm5/src/reflection/reflection_capabilities.js +14 -3
  128. package/esm5/src/render3/assert.js +2 -1
  129. package/esm5/src/render3/component.js +10 -4
  130. package/esm5/src/render3/component_ref.js +4 -2
  131. package/esm5/src/render3/debug.js +17 -10
  132. package/esm5/src/render3/definition.js +8 -2
  133. package/esm5/src/render3/errors.js +14 -1
  134. package/esm5/src/render3/features/inherit_definition_feature.js +41 -36
  135. package/esm5/src/render3/fields.js +2 -1
  136. package/esm5/src/render3/i18n.js +67 -437
  137. package/esm5/src/render3/index.js +3 -3
  138. package/esm5/src/render3/instructions/all.js +6 -1
  139. package/esm5/src/render3/instructions/attribute.js +22 -0
  140. package/esm5/src/render3/instructions/attribute_interpolation.js +346 -0
  141. package/esm5/src/render3/instructions/container.js +16 -15
  142. package/esm5/src/render3/instructions/element.js +43 -32
  143. package/esm5/src/render3/instructions/element_container.js +9 -8
  144. package/esm5/src/render3/instructions/embedded_view.js +8 -11
  145. package/esm5/src/render3/instructions/interpolation.js +243 -0
  146. package/esm5/src/render3/instructions/listener.js +3 -2
  147. package/esm5/src/render3/instructions/projection.js +19 -54
  148. package/esm5/src/render3/instructions/property.js +10 -4
  149. package/esm5/src/render3/instructions/property_interpolation.js +40 -254
  150. package/esm5/src/render3/instructions/shared.js +70 -105
  151. package/esm5/src/render3/instructions/styling.js +167 -209
  152. package/esm5/src/render3/instructions/text.js +8 -7
  153. package/esm5/src/render3/instructions/text_interpolation.js +264 -0
  154. package/esm5/src/render3/interfaces/container.js +8 -2
  155. package/esm5/src/render3/interfaces/definition.js +1 -1
  156. package/esm5/src/render3/interfaces/node.js +1 -8
  157. package/esm5/src/render3/interfaces/projection.js +1 -1
  158. package/esm5/src/render3/interfaces/styling.js +2 -2
  159. package/esm5/src/render3/interfaces/view.js +1 -1
  160. package/esm5/src/render3/jit/directive.js +12 -5
  161. package/esm5/src/render3/jit/environment.js +30 -15
  162. package/esm5/src/render3/jit/module.js +23 -18
  163. package/esm5/src/render3/ng_module_ref.js +37 -3
  164. package/esm5/src/render3/node_manipulation.js +39 -38
  165. package/esm5/src/render3/node_selector_matcher.js +36 -14
  166. package/esm5/src/render3/query.js +75 -53
  167. package/esm5/src/render3/state.js +29 -5
  168. package/esm5/src/render3/styling/class_and_style_bindings.js +80 -66
  169. package/esm5/src/render3/styling/host_instructions_queue.js +6 -3
  170. package/esm5/src/render3/styling/shared.js +2 -2
  171. package/esm5/src/render3/styling/util.js +2 -2
  172. package/esm5/src/render3/styling_next/bindings.js +446 -0
  173. package/esm5/src/render3/styling_next/instructions.js +277 -0
  174. package/esm5/src/render3/styling_next/interfaces.js +1 -0
  175. package/esm5/src/render3/styling_next/map_based_bindings.js +324 -0
  176. package/esm5/src/render3/styling_next/state.js +23 -0
  177. package/esm5/src/render3/styling_next/styling_debug.js +130 -0
  178. package/esm5/src/render3/styling_next/util.js +147 -0
  179. package/esm5/src/render3/util/attrs_utils.js +4 -3
  180. package/esm5/src/render3/util/debug_utils.js +11 -0
  181. package/esm5/src/render3/util/view_traversal_utils.js +2 -2
  182. package/esm5/src/render3/view_engine_compatibility.js +23 -10
  183. package/esm5/src/sanitization/sanitization.js +14 -6
  184. package/esm5/src/sanitization/style_sanitizer.js +1 -1
  185. package/esm5/src/util/ng_dev_mode.js +7 -3
  186. package/esm5/src/version.js +1 -1
  187. package/esm5/src/view/ng_module.js +3 -3
  188. package/esm5/src/view/util.js +2 -2
  189. package/esm5/testing/src/r3_test_bed_compiler.js +37 -11
  190. package/esm5/testing/src/test_bed_common.js +1 -1
  191. package/fesm2015/core.js +13604 -10868
  192. package/fesm2015/core.js.map +1 -1
  193. package/fesm2015/testing.js +43 -11
  194. package/fesm2015/testing.js.map +1 -1
  195. package/fesm5/core.js +11279 -9305
  196. package/fesm5/core.js.map +1 -1
  197. package/fesm5/testing.js +36 -10
  198. package/fesm5/testing.js.map +1 -1
  199. package/package.json +1 -1
  200. package/schematics/migrations/injectable-pipe/index.js +2 -5
  201. package/schematics/migrations/move-document/index.js +2 -5
  202. package/schematics/migrations/static-queries/index.js +2 -5
  203. package/schematics/migrations/template-var-assignment/index.js +2 -5
  204. package/src/r3_symbols.d.ts +24 -18
  205. package/testing/testing.d.ts +2 -5
  206. package/testing.d.ts +1 -1
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v8.0.3
2
+ * @license Angular v8.1.0-beta.0
3
3
  * (c) 2010-2019 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { getDebugNode, RendererFactory2, InjectionToken, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, ɵNG_COMPONENT_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIRECTIVE_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵpatchComponentDefWithScope, ɵNG_INJECTOR_DEF, ɵNG_MODULE_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ModuleWithComponentFactories, ɵtransitiveScopesFor, Injector, InjectFlags, ɵresetCompiledComponents, ɵflushModuleScopingQueueAsMuchAsPossible, Injectable, ɵclearOverrides, ɵoverrideComponentView, ɵAPP_ROOT, ɵoverrideProvider, ɵivyEnabled, Optional, SkipSelf } from '@angular/core';
7
+ import { getDebugNode, RendererFactory2, InjectionToken, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, ɵNG_COMPONENT_DEF, ɵRender3NgModuleRef, LOCALE_ID, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ApplicationInitStatus, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIRECTIVE_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵpatchComponentDefWithScope, ɵNG_INJECTOR_DEF, ɵNG_MODULE_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ModuleWithComponentFactories, ɵtransitiveScopesFor, Injector, InjectFlags, ɵresetCompiledComponents, ɵflushModuleScopingQueueAsMuchAsPossible, Injectable, ɵclearOverrides, ɵoverrideComponentView, ɵAPP_ROOT, ɵoverrideProvider, ɵivyEnabled, Optional, SkipSelf } from '@angular/core';
8
8
  import { __awaiter } from 'tslib';
9
9
  import { ResourceLoader } from '@angular/compiler';
10
10
 
@@ -1273,8 +1273,21 @@ class NgModuleResolver extends OverrideResolver {
1273
1273
  * @fileoverview added by tsickle
1274
1274
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1275
1275
  */
1276
- /** @type {?} */
1277
- const TESTING_MODULE = 'TestingModule';
1276
+ /** @enum {number} */
1277
+ const TestingModuleOverride = {
1278
+ DECLARATION: 0,
1279
+ OVERRIDE_TEMPLATE: 1,
1280
+ };
1281
+ TestingModuleOverride[TestingModuleOverride.DECLARATION] = 'DECLARATION';
1282
+ TestingModuleOverride[TestingModuleOverride.OVERRIDE_TEMPLATE] = 'OVERRIDE_TEMPLATE';
1283
+ /**
1284
+ * @param {?} value
1285
+ * @return {?}
1286
+ */
1287
+ function isTestingModuleOverride(value) {
1288
+ return value === TestingModuleOverride.DECLARATION ||
1289
+ value === TestingModuleOverride.OVERRIDE_TEMPLATE;
1290
+ }
1278
1291
  class R3TestBedCompiler {
1279
1292
  /**
1280
1293
  * @param {?} platform
@@ -1335,7 +1348,7 @@ class R3TestBedCompiler {
1335
1348
  configureTestingModule(moduleDef) {
1336
1349
  // Enqueue any compilation tasks for the directly declared component.
1337
1350
  if (moduleDef.declarations !== undefined) {
1338
- this.queueTypeArray(moduleDef.declarations, TESTING_MODULE);
1351
+ this.queueTypeArray(moduleDef.declarations, TestingModuleOverride.DECLARATION);
1339
1352
  this.declarations.push(...moduleDef.declarations);
1340
1353
  }
1341
1354
  // Enqueue any compilation tasks for imported modules.
@@ -1455,7 +1468,7 @@ class R3TestBedCompiler {
1455
1468
  this.existingComponentStyles.set(type, def.styles);
1456
1469
  }
1457
1470
  // Set the component's scope to be the testing module.
1458
- this.componentToModuleScope.set(type, TESTING_MODULE);
1471
+ this.componentToModuleScope.set(type, TestingModuleOverride.OVERRIDE_TEMPLATE);
1459
1472
  }
1460
1473
  /**
1461
1474
  * @return {?}
@@ -1504,6 +1517,10 @@ class R3TestBedCompiler {
1504
1517
  /** @type {?} */
1505
1518
  const parentInjector = this.platform.injector;
1506
1519
  this.testModuleRef = new ɵRender3NgModuleRef(this.testModuleType, parentInjector);
1520
+ // Set the locale ID, it can be overridden for the tests
1521
+ /** @type {?} */
1522
+ const localeId = this.testModuleRef.injector.get(LOCALE_ID, ɵDEFAULT_LOCALE_ID);
1523
+ ɵsetLocaleId(localeId);
1507
1524
  // ApplicationInitStatus.runInitializers() is marked @internal to core.
1508
1525
  // Cast it to any before accessing it.
1509
1526
  ((/** @type {?} */ (this.testModuleRef.injector.get(ApplicationInitStatus)))).runInitializers();
@@ -1617,7 +1634,7 @@ class R3TestBedCompiler {
1617
1634
  (moduleType) => {
1618
1635
  if (!moduleToScope.has(moduleType)) {
1619
1636
  /** @type {?} */
1620
- const realType = moduleType === TESTING_MODULE ? this.testModuleType : moduleType;
1637
+ const realType = isTestingModuleOverride(moduleType) ? this.testModuleType : moduleType;
1621
1638
  moduleToScope.set(moduleType, ɵtransitiveScopesFor(realType));
1622
1639
  }
1623
1640
  return (/** @type {?} */ (moduleToScope.get(moduleType)));
@@ -1753,9 +1770,22 @@ class R3TestBedCompiler {
1753
1770
  }
1754
1771
  this.seenComponents.add(type);
1755
1772
  // Keep track of the module which declares this component, so later the component's scope
1756
- // can be set correctly. Only record this the first time, because it might be overridden by
1757
- // overrideTemplateUsingTestingModule.
1758
- if (!this.componentToModuleScope.has(type)) {
1773
+ // can be set correctly. If the component has already been recorded here, then one of several
1774
+ // cases is true:
1775
+ // * the module containing the component was imported multiple times (common).
1776
+ // * the component is declared in multiple modules (which is an error).
1777
+ // * the component was in 'declarations' of the testing module, and also in an imported module
1778
+ // in which case the module scope will be TestingModuleOverride.DECLARATION.
1779
+ // * overrideTemplateUsingTestingModule was called for the component in which case the module
1780
+ // scope will be TestingModuleOverride.OVERRIDE_TEMPLATE.
1781
+ //
1782
+ // If the component was previously in the testing module's 'declarations' (meaning the
1783
+ // current value is TestingModuleOverride.DECLARATION), then `moduleType` is the component's
1784
+ // real module, which was imported. This pattern is understood to mean that the component
1785
+ // should use its original scope, but that the testing module should also contain the
1786
+ // component in its scope.
1787
+ if (!this.componentToModuleScope.has(type) ||
1788
+ this.componentToModuleScope.get(type) === TestingModuleOverride.DECLARATION) {
1759
1789
  this.componentToModuleScope.set(type, moduleType);
1760
1790
  }
1761
1791
  return;
@@ -1887,6 +1917,8 @@ class R3TestBedCompiler {
1887
1917
  this.initialNgDefs.clear();
1888
1918
  this.moduleProvidersOverridden.clear();
1889
1919
  this.restoreComponentResolutionQueue();
1920
+ // Restore the locale ID to the default value, this shouldn't be necessary but we never know
1921
+ ɵsetLocaleId(ɵDEFAULT_LOCALE_ID);
1890
1922
  }
1891
1923
  /**
1892
1924
  * @private
@@ -1918,7 +1950,7 @@ class R3TestBedCompiler {
1918
1950
  imports,
1919
1951
  schemas: this.schemas,
1920
1952
  providers,
1921
- });
1953
+ }, /* allowDuplicateDeclarationsInRoot */ true);
1922
1954
  // clang-format on
1923
1955
  this.applyProviderOverridesToModule(this.testModuleType);
1924
1956
  }