@angular/core 7.2.0-beta.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. package/bundles/core-testing.umd.js +194 -128
  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 +5582 -4512
  6. package/bundles/core.umd.js.map +1 -1
  7. package/bundles/core.umd.min.js +122 -129
  8. package/bundles/core.umd.min.js.map +1 -1
  9. package/core.d.ts +12 -12
  10. package/core.metadata.json +1 -1
  11. package/esm2015/core.externs.js +45 -35
  12. package/esm2015/core.js +12 -13
  13. package/esm2015/index.js +3 -4
  14. package/esm2015/public_api.js +3 -5
  15. package/esm2015/src/application_init.js +22 -10
  16. package/esm2015/src/application_module.js +6 -5
  17. package/esm2015/src/application_ref.js +94 -37
  18. package/esm2015/src/application_tokens.js +21 -16
  19. package/esm2015/src/change_detection/change_detection.js +8 -7
  20. package/esm2015/src/change_detection/change_detection_util.js +2 -4
  21. package/esm2015/src/change_detection/change_detector_ref.js +2 -3
  22. package/esm2015/src/change_detection/constants.js +30 -32
  23. package/esm2015/src/change_detection/differs/default_iterable_differ.js +108 -29
  24. package/esm2015/src/change_detection/differs/default_keyvalue_differ.js +53 -16
  25. package/esm2015/src/change_detection/differs/iterable_differs.js +100 -90
  26. package/esm2015/src/change_detection/differs/keyvalue_differs.js +85 -73
  27. package/esm2015/src/change_detection/pipe_transform.js +10 -5
  28. package/esm2015/src/change_detection.js +7 -3
  29. package/esm2015/src/codegen_private_exports.js +2 -3
  30. package/esm2015/src/console.js +3 -3
  31. package/esm2015/src/core.js +3 -4
  32. package/esm2015/src/core_private_export.js +2 -3
  33. package/esm2015/src/core_render3_private_export.js +13 -7
  34. package/esm2015/src/debug/debug_node.js +132 -90
  35. package/esm2015/src/di/defs.js +59 -50
  36. package/esm2015/src/di/forward_ref.js +5 -6
  37. package/esm2015/src/di/injectable.js +11 -11
  38. package/esm2015/src/di/injection_token.js +10 -6
  39. package/esm2015/src/di/injector.js +53 -43
  40. package/esm2015/src/di/injector_compatibility.js +13 -12
  41. package/esm2015/src/di/metadata.js +22 -13
  42. package/esm2015/src/di/provider.js +137 -120
  43. package/esm2015/src/di/r3_injector.js +127 -57
  44. package/esm2015/src/di/reflective_errors.js +19 -13
  45. package/esm2015/src/di/reflective_injector.js +20 -16
  46. package/esm2015/src/di/reflective_key.js +7 -5
  47. package/esm2015/src/di/reflective_provider.js +21 -20
  48. package/esm2015/src/di/scope.js +5 -5
  49. package/esm2015/src/di/util.js +13 -14
  50. package/esm2015/src/di.js +2 -3
  51. package/esm2015/src/error_handler.js +5 -4
  52. package/esm2015/src/errors.js +7 -8
  53. package/esm2015/src/event_emitter.js +3 -3
  54. package/esm2015/src/i18n/tokens.js +12 -10
  55. package/esm2015/src/is_dev_mode.js +2 -3
  56. package/esm2015/src/ivy_switch.js +2 -3
  57. package/esm2015/src/linker/compiler.js +9 -12
  58. package/esm2015/src/linker/component_factory.js +2 -3
  59. package/esm2015/src/linker/component_factory_resolver.js +24 -10
  60. package/esm2015/src/linker/element_ref.js +5 -3
  61. package/esm2015/src/linker/ng_module_factory.js +6 -5
  62. package/esm2015/src/linker/ng_module_factory_loader.js +63 -16
  63. package/esm2015/src/linker/query_list.js +16 -14
  64. package/esm2015/src/linker/system_js_ng_module_factory_loader.js +12 -5
  65. package/esm2015/src/linker/template_ref.js +2 -3
  66. package/esm2015/src/linker/view_container_ref.js +2 -3
  67. package/esm2015/src/linker/view_ref.js +13 -7
  68. package/esm2015/src/linker.js +3 -3
  69. package/esm2015/src/metadata/di.js +22 -15
  70. package/esm2015/src/metadata/directives.js +33 -19
  71. package/esm2015/src/metadata/lifecycle_hooks.js +81 -66
  72. package/esm2015/src/metadata/ng_module.js +82 -68
  73. package/esm2015/src/metadata/resource_loading.js +4 -3
  74. package/esm2015/src/metadata/view.js +25 -26
  75. package/esm2015/src/metadata.js +6 -3
  76. package/esm2015/src/platform_core_providers.js +5 -5
  77. package/esm2015/src/profile/profile.js +17 -13
  78. package/esm2015/src/profile/wtf_impl.js +36 -16
  79. package/esm2015/src/r3_symbols.js +18 -5
  80. package/esm2015/src/reflection/platform_reflection_capabilities.js +81 -40
  81. package/esm2015/src/reflection/reflection.js +5 -5
  82. package/esm2015/src/reflection/reflection_capabilities.js +38 -27
  83. package/esm2015/src/reflection/reflector.js +2 -3
  84. package/esm2015/src/reflection/types.js +2 -12
  85. package/esm2015/src/render/api.js +67 -47
  86. package/esm2015/src/render.js +3 -3
  87. package/esm2015/src/render3/assert.js +38 -3
  88. package/esm2015/src/render3/bindings.js +111 -0
  89. package/esm2015/src/render3/component.js +88 -77
  90. package/esm2015/src/render3/component_ref.js +86 -56
  91. package/esm2015/src/render3/context_discovery.js +94 -92
  92. package/esm2015/src/render3/definition.js +58 -51
  93. package/esm2015/src/render3/di.js +206 -166
  94. package/esm2015/src/render3/di_setup.js +51 -31
  95. package/esm2015/src/render3/discovery_utils.js +225 -39
  96. package/esm2015/src/render3/empty.js +28 -0
  97. package/esm2015/src/render3/errors.js +11 -15
  98. package/esm2015/src/render3/features/inherit_definition_feature.js +13 -10
  99. package/esm2015/src/render3/features/ng_onchanges_feature.js +15 -12
  100. package/esm2015/src/render3/features/providers_feature.js +2 -3
  101. package/esm2015/src/render3/fields.js +5 -5
  102. package/esm2015/src/render3/global_utils.js +22 -7
  103. package/esm2015/src/render3/global_utils_api.js +13 -7
  104. package/esm2015/src/render3/hooks.js +21 -26
  105. package/esm2015/src/render3/i18n.js +134 -115
  106. package/esm2015/src/render3/index.js +15 -7
  107. package/esm2015/src/render3/instructions.js +938 -813
  108. package/esm2015/src/render3/interfaces/container.js +37 -6
  109. package/esm2015/src/render3/interfaces/context.js +39 -37
  110. package/esm2015/src/render3/interfaces/definition.js +225 -265
  111. package/esm2015/src/render3/interfaces/i18n.js +179 -151
  112. package/esm2015/src/render3/interfaces/injector.js +95 -13
  113. package/esm2015/src/render3/interfaces/node.js +413 -382
  114. package/esm2015/src/render3/interfaces/player.js +78 -37
  115. package/esm2015/src/render3/interfaces/projection.js +5 -10
  116. package/esm2015/src/render3/interfaces/query.js +66 -60
  117. package/esm2015/src/render3/interfaces/renderer.js +292 -117
  118. package/esm2015/src/render3/interfaces/sanitization.js +2 -6
  119. package/esm2015/src/render3/interfaces/styling.js +322 -111
  120. package/esm2015/src/render3/interfaces/view.js +356 -298
  121. package/esm2015/src/render3/jit/compiler_facade.js +10 -4
  122. package/esm2015/src/render3/jit/compiler_facade_interface.js +195 -152
  123. package/esm2015/src/render3/jit/directive.js +26 -16
  124. package/esm2015/src/render3/jit/environment.js +8 -5
  125. package/esm2015/src/render3/jit/injectable.js +7 -10
  126. package/esm2015/src/render3/jit/module.js +309 -25
  127. package/esm2015/src/render3/jit/pipe.js +2 -3
  128. package/esm2015/src/render3/jit/util.js +2 -3
  129. package/esm2015/src/render3/metadata.js +11 -10
  130. package/esm2015/src/render3/ng_dev_mode.js +5 -6
  131. package/esm2015/src/render3/ng_module_ref.js +48 -22
  132. package/esm2015/src/render3/node_assert.js +2 -3
  133. package/esm2015/src/render3/node_manipulation.js +137 -117
  134. package/esm2015/src/render3/node_selector_matcher.js +46 -19
  135. package/esm2015/src/render3/pipe.js +36 -21
  136. package/esm2015/src/render3/players.js +17 -12
  137. package/esm2015/src/render3/pure_function.js +86 -39
  138. package/esm2015/src/render3/query.js +93 -80
  139. package/esm2015/src/render3/state.js +88 -203
  140. package/esm2015/src/render3/styling/class_and_style_bindings.js +963 -249
  141. package/esm2015/src/render3/styling/core_player_handler.js +6 -4
  142. package/esm2015/src/render3/styling/player_factory.js +3 -4
  143. package/esm2015/src/render3/styling/util.js +69 -31
  144. package/esm2015/src/render3/tokens.js +7 -6
  145. package/esm2015/src/render3/util.js +65 -55
  146. package/esm2015/src/render3/view_engine_compatibility.js +36 -59
  147. package/esm2015/src/render3/view_engine_compatibility_prebound.js +2 -3
  148. package/esm2015/src/render3/view_ref.js +58 -44
  149. package/esm2015/src/sanitization/bypass.js +29 -6
  150. package/esm2015/src/sanitization/html_sanitizer.js +48 -16
  151. package/esm2015/src/sanitization/inert_body.js +33 -18
  152. package/esm2015/src/sanitization/sanitization.js +35 -25
  153. package/esm2015/src/sanitization/security.js +3 -4
  154. package/esm2015/src/sanitization/style_sanitizer.js +10 -7
  155. package/esm2015/src/sanitization/url_sanitizer.js +9 -7
  156. package/esm2015/src/testability/testability.js +72 -42
  157. package/esm2015/src/type.js +6 -8
  158. package/esm2015/src/util/decorators.js +19 -14
  159. package/esm2015/src/util/lang.js +2 -3
  160. package/esm2015/src/util/ng_reflect.js +2 -3
  161. package/esm2015/src/util/noop.js +2 -3
  162. package/esm2015/src/util/property.js +3 -4
  163. package/esm2015/src/util.js +12 -4
  164. package/esm2015/src/version.js +6 -6
  165. package/esm2015/src/view/element.js +17 -17
  166. package/esm2015/src/view/entrypoint.js +15 -5
  167. package/esm2015/src/view/errors.js +4 -5
  168. package/esm2015/src/view/index.js +2 -3
  169. package/esm2015/src/view/ng_content.js +3 -4
  170. package/esm2015/src/view/ng_module.js +2 -3
  171. package/esm2015/src/view/provider.js +89 -24
  172. package/esm2015/src/view/pure_expression.js +14 -15
  173. package/esm2015/src/view/query.js +14 -14
  174. package/esm2015/src/view/refs.js +96 -38
  175. package/esm2015/src/view/services.js +64 -37
  176. package/esm2015/src/view/text.js +5 -6
  177. package/esm2015/src/view/types.js +390 -325
  178. package/esm2015/src/view/util.js +29 -24
  179. package/esm2015/src/view/view.js +43 -36
  180. package/esm2015/src/view/view_attach.js +9 -10
  181. package/esm2015/src/zone/ng_zone.js +29 -28
  182. package/esm2015/src/zone.js +3 -3
  183. package/esm2015/testing/index.js +2 -3
  184. package/esm2015/testing/public_api.js +4 -4
  185. package/esm2015/testing/src/async.js +2 -3
  186. package/esm2015/testing/src/async_fallback.js +8 -7
  187. package/esm2015/testing/src/async_test_completer.js +14 -6
  188. package/esm2015/testing/src/before_each.js +10 -4
  189. package/esm2015/testing/src/component_fixture.js +48 -17
  190. package/esm2015/testing/src/fake_async.js +9 -3
  191. package/esm2015/testing/src/fake_async_fallback.js +5 -5
  192. package/esm2015/testing/src/lang_utils.js +3 -4
  193. package/esm2015/testing/src/logger.js +2 -3
  194. package/esm2015/testing/src/metadata_override.js +2 -6
  195. package/esm2015/testing/src/metadata_overrider.js +9 -8
  196. package/esm2015/testing/src/ng_zone_mock.js +2 -3
  197. package/esm2015/testing/src/private_export_testing.js +2 -3
  198. package/esm2015/testing/src/r3_test_bed.js +324 -174
  199. package/esm2015/testing/src/resolvers.js +28 -11
  200. package/esm2015/testing/src/test_bed.js +123 -54
  201. package/esm2015/testing/src/test_bed_common.js +142 -85
  202. package/esm2015/testing/src/test_compiler.js +2 -3
  203. package/esm2015/testing/src/testing.js +3 -3
  204. package/esm2015/testing/src/testing_internal.js +17 -12
  205. package/esm2015/testing/testing.js +1 -2
  206. package/esm5/core.js +12 -13
  207. package/esm5/index.js +1 -2
  208. package/esm5/public_api.js +1 -2
  209. package/esm5/src/application_init.js +1 -2
  210. package/esm5/src/application_module.js +1 -2
  211. package/esm5/src/application_ref.js +1 -2
  212. package/esm5/src/application_tokens.js +1 -2
  213. package/esm5/src/change_detection/change_detection.js +1 -2
  214. package/esm5/src/change_detection/change_detection_util.js +1 -2
  215. package/esm5/src/change_detection/change_detector_ref.js +1 -2
  216. package/esm5/src/change_detection/constants.js +3 -4
  217. package/esm5/src/change_detection/differs/default_iterable_differ.js +1 -2
  218. package/esm5/src/change_detection/differs/default_keyvalue_differ.js +1 -2
  219. package/esm5/src/change_detection/differs/iterable_differs.js +1 -2
  220. package/esm5/src/change_detection/differs/keyvalue_differs.js +1 -2
  221. package/esm5/src/change_detection/pipe_transform.js +1 -2
  222. package/esm5/src/change_detection.js +1 -2
  223. package/esm5/src/codegen_private_exports.js +1 -2
  224. package/esm5/src/console.js +1 -2
  225. package/esm5/src/core.js +1 -2
  226. package/esm5/src/core_private_export.js +1 -2
  227. package/esm5/src/core_render3_private_export.js +7 -5
  228. package/esm5/src/debug/debug_node.js +79 -58
  229. package/esm5/src/di/defs.js +3 -4
  230. package/esm5/src/di/forward_ref.js +1 -2
  231. package/esm5/src/di/injectable.js +1 -2
  232. package/esm5/src/di/injection_token.js +1 -2
  233. package/esm5/src/di/injector.js +1 -2
  234. package/esm5/src/di/injector_compatibility.js +1 -2
  235. package/esm5/src/di/metadata.js +1 -2
  236. package/esm5/src/di/provider.js +1 -2
  237. package/esm5/src/di/r3_injector.js +48 -28
  238. package/esm5/src/di/reflective_errors.js +1 -2
  239. package/esm5/src/di/reflective_injector.js +1 -2
  240. package/esm5/src/di/reflective_key.js +1 -2
  241. package/esm5/src/di/reflective_provider.js +1 -2
  242. package/esm5/src/di/scope.js +1 -2
  243. package/esm5/src/di/util.js +1 -2
  244. package/esm5/src/di.js +1 -2
  245. package/esm5/src/error_handler.js +1 -2
  246. package/esm5/src/errors.js +1 -2
  247. package/esm5/src/event_emitter.js +1 -2
  248. package/esm5/src/i18n/tokens.js +1 -2
  249. package/esm5/src/is_dev_mode.js +1 -2
  250. package/esm5/src/ivy_switch.js +1 -2
  251. package/esm5/src/linker/compiler.js +1 -2
  252. package/esm5/src/linker/component_factory.js +1 -2
  253. package/esm5/src/linker/component_factory_resolver.js +1 -2
  254. package/esm5/src/linker/element_ref.js +1 -2
  255. package/esm5/src/linker/ng_module_factory.js +1 -2
  256. package/esm5/src/linker/ng_module_factory_loader.js +37 -13
  257. package/esm5/src/linker/query_list.js +1 -2
  258. package/esm5/src/linker/system_js_ng_module_factory_loader.js +1 -2
  259. package/esm5/src/linker/template_ref.js +1 -2
  260. package/esm5/src/linker/view_container_ref.js +1 -2
  261. package/esm5/src/linker/view_ref.js +1 -2
  262. package/esm5/src/linker.js +1 -2
  263. package/esm5/src/metadata/di.js +1 -2
  264. package/esm5/src/metadata/directives.js +1 -2
  265. package/esm5/src/metadata/lifecycle_hooks.js +1 -2
  266. package/esm5/src/metadata/ng_module.js +1 -2
  267. package/esm5/src/metadata/resource_loading.js +1 -2
  268. package/esm5/src/metadata/view.js +1 -2
  269. package/esm5/src/metadata.js +1 -2
  270. package/esm5/src/platform_core_providers.js +1 -2
  271. package/esm5/src/profile/profile.js +1 -2
  272. package/esm5/src/profile/wtf_impl.js +1 -2
  273. package/esm5/src/r3_symbols.js +1 -2
  274. package/esm5/src/reflection/platform_reflection_capabilities.js +1 -2
  275. package/esm5/src/reflection/reflection.js +1 -2
  276. package/esm5/src/reflection/reflection_capabilities.js +1 -2
  277. package/esm5/src/reflection/reflector.js +1 -2
  278. package/esm5/src/reflection/types.js +1 -2
  279. package/esm5/src/render/api.js +1 -2
  280. package/esm5/src/render.js +1 -2
  281. package/esm5/src/render3/assert.js +15 -2
  282. package/esm5/src/render3/bindings.js +63 -0
  283. package/esm5/src/render3/component.js +23 -16
  284. package/esm5/src/render3/component_ref.js +43 -36
  285. package/esm5/src/render3/context_discovery.js +68 -77
  286. package/esm5/src/render3/definition.js +30 -24
  287. package/esm5/src/render3/di.js +142 -135
  288. package/esm5/src/render3/di_setup.js +20 -21
  289. package/esm5/src/render3/discovery_utils.js +167 -36
  290. package/esm5/src/render3/empty.js +22 -0
  291. package/esm5/src/render3/errors.js +9 -12
  292. package/esm5/src/render3/features/inherit_definition_feature.js +3 -5
  293. package/esm5/src/render3/features/ng_onchanges_feature.js +11 -10
  294. package/esm5/src/render3/features/providers_feature.js +1 -2
  295. package/esm5/src/render3/fields.js +1 -2
  296. package/esm5/src/render3/global_utils.js +4 -3
  297. package/esm5/src/render3/global_utils_api.js +2 -3
  298. package/esm5/src/render3/hooks.js +14 -16
  299. package/esm5/src/render3/i18n.js +22 -27
  300. package/esm5/src/render3/index.js +5 -6
  301. package/esm5/src/render3/instructions.js +698 -593
  302. package/esm5/src/render3/interfaces/container.js +10 -3
  303. package/esm5/src/render3/interfaces/context.js +1 -2
  304. package/esm5/src/render3/interfaces/definition.js +1 -2
  305. package/esm5/src/render3/interfaces/i18n.js +1 -2
  306. package/esm5/src/render3/interfaces/injector.js +5 -6
  307. package/esm5/src/render3/interfaces/node.js +1 -2
  308. package/esm5/src/render3/interfaces/player.js +1 -2
  309. package/esm5/src/render3/interfaces/projection.js +1 -2
  310. package/esm5/src/render3/interfaces/query.js +1 -2
  311. package/esm5/src/render3/interfaces/renderer.js +1 -2
  312. package/esm5/src/render3/interfaces/sanitization.js +1 -2
  313. package/esm5/src/render3/interfaces/styling.js +1 -2
  314. package/esm5/src/render3/interfaces/view.js +3 -4
  315. package/esm5/src/render3/jit/compiler_facade.js +1 -2
  316. package/esm5/src/render3/jit/compiler_facade_interface.js +1 -2
  317. package/esm5/src/render3/jit/directive.js +19 -10
  318. package/esm5/src/render3/jit/environment.js +4 -2
  319. package/esm5/src/render3/jit/injectable.js +17 -18
  320. package/esm5/src/render3/jit/module.js +207 -13
  321. package/esm5/src/render3/jit/pipe.js +1 -2
  322. package/esm5/src/render3/jit/util.js +1 -2
  323. package/esm5/src/render3/metadata.js +1 -2
  324. package/esm5/src/render3/ng_dev_mode.js +1 -2
  325. package/esm5/src/render3/ng_module_ref.js +29 -11
  326. package/esm5/src/render3/node_assert.js +1 -2
  327. package/esm5/src/render3/node_manipulation.js +54 -50
  328. package/esm5/src/render3/node_selector_matcher.js +28 -9
  329. package/esm5/src/render3/pipe.js +33 -19
  330. package/esm5/src/render3/players.js +7 -9
  331. package/esm5/src/render3/pure_function.js +48 -38
  332. package/esm5/src/render3/query.js +8 -9
  333. package/esm5/src/render3/state.js +50 -135
  334. package/esm5/src/render3/styling/class_and_style_bindings.js +684 -214
  335. package/esm5/src/render3/styling/core_player_handler.js +1 -2
  336. package/esm5/src/render3/styling/player_factory.js +1 -2
  337. package/esm5/src/render3/styling/util.js +39 -22
  338. package/esm5/src/render3/tokens.js +1 -2
  339. package/esm5/src/render3/util.js +49 -37
  340. package/esm5/src/render3/view_engine_compatibility.js +20 -33
  341. package/esm5/src/render3/view_engine_compatibility_prebound.js +1 -2
  342. package/esm5/src/render3/view_ref.js +33 -30
  343. package/esm5/src/sanitization/bypass.js +1 -2
  344. package/esm5/src/sanitization/html_sanitizer.js +1 -2
  345. package/esm5/src/sanitization/inert_body.js +4 -5
  346. package/esm5/src/sanitization/sanitization.js +25 -20
  347. package/esm5/src/sanitization/security.js +1 -2
  348. package/esm5/src/sanitization/style_sanitizer.js +1 -2
  349. package/esm5/src/sanitization/url_sanitizer.js +1 -2
  350. package/esm5/src/testability/testability.js +1 -2
  351. package/esm5/src/type.js +1 -2
  352. package/esm5/src/util/decorators.js +1 -2
  353. package/esm5/src/util/lang.js +1 -2
  354. package/esm5/src/util/ng_reflect.js +1 -2
  355. package/esm5/src/util/noop.js +1 -2
  356. package/esm5/src/util/property.js +1 -2
  357. package/esm5/src/util.js +1 -2
  358. package/esm5/src/version.js +2 -3
  359. package/esm5/src/view/element.js +1 -2
  360. package/esm5/src/view/entrypoint.js +1 -2
  361. package/esm5/src/view/errors.js +1 -2
  362. package/esm5/src/view/index.js +1 -2
  363. package/esm5/src/view/ng_content.js +1 -2
  364. package/esm5/src/view/ng_module.js +1 -2
  365. package/esm5/src/view/provider.js +1 -2
  366. package/esm5/src/view/pure_expression.js +1 -2
  367. package/esm5/src/view/query.js +1 -2
  368. package/esm5/src/view/refs.js +1 -2
  369. package/esm5/src/view/services.js +1 -2
  370. package/esm5/src/view/text.js +1 -2
  371. package/esm5/src/view/types.js +1 -2
  372. package/esm5/src/view/util.js +1 -2
  373. package/esm5/src/view/view.js +1 -2
  374. package/esm5/src/view/view_attach.js +1 -2
  375. package/esm5/src/zone/ng_zone.js +1 -2
  376. package/esm5/src/zone.js +1 -2
  377. package/esm5/testing/index.js +1 -2
  378. package/esm5/testing/public_api.js +1 -2
  379. package/esm5/testing/src/async.js +1 -2
  380. package/esm5/testing/src/async_fallback.js +1 -2
  381. package/esm5/testing/src/async_test_completer.js +1 -2
  382. package/esm5/testing/src/before_each.js +1 -2
  383. package/esm5/testing/src/component_fixture.js +1 -2
  384. package/esm5/testing/src/fake_async.js +1 -2
  385. package/esm5/testing/src/fake_async_fallback.js +1 -2
  386. package/esm5/testing/src/lang_utils.js +1 -2
  387. package/esm5/testing/src/logger.js +1 -2
  388. package/esm5/testing/src/metadata_override.js +1 -2
  389. package/esm5/testing/src/metadata_overrider.js +1 -2
  390. package/esm5/testing/src/ng_zone_mock.js +1 -2
  391. package/esm5/testing/src/private_export_testing.js +1 -2
  392. package/esm5/testing/src/r3_test_bed.js +182 -121
  393. package/esm5/testing/src/resolvers.js +11 -7
  394. package/esm5/testing/src/test_bed.js +1 -2
  395. package/esm5/testing/src/test_bed_common.js +1 -2
  396. package/esm5/testing/src/test_compiler.js +1 -2
  397. package/esm5/testing/src/testing.js +1 -2
  398. package/esm5/testing/src/testing_internal.js +2 -3
  399. package/esm5/testing/testing.js +1 -2
  400. package/fesm2015/core.js +8560 -6153
  401. package/fesm2015/core.js.map +1 -1
  402. package/fesm2015/testing.js +351 -229
  403. package/fesm2015/testing.js.map +1 -1
  404. package/fesm5/core.js +5541 -4482
  405. package/fesm5/core.js.map +1 -1
  406. package/fesm5/testing.js +185 -130
  407. package/fesm5/testing.js.map +1 -1
  408. package/package.json +1 -1
  409. package/src/change_detection/constants.d.ts +2 -2
  410. package/src/core_render3_private_export.d.ts +6 -3
  411. package/src/di/injectable.d.ts +3 -2
  412. package/src/di/r3_injector.d.ts +1 -1
  413. package/src/linker/ng_module_factory_loader.d.ts +5 -1
  414. package/src/render3/assert.d.ts +6 -0
  415. package/src/render3/bindings.d.ts +20 -0
  416. package/src/render3/component.d.ts +3 -3
  417. package/src/render3/component_ref.d.ts +14 -4
  418. package/src/render3/context_discovery.d.ts +9 -9
  419. package/src/render3/definition.d.ts +8 -23
  420. package/src/render3/di.d.ts +19 -17
  421. package/src/render3/discovery_utils.d.ts +66 -8
  422. package/src/render3/empty.d.ts +16 -0
  423. package/src/render3/errors.d.ts +1 -1
  424. package/src/render3/global_utils_api.d.ts +1 -1
  425. package/src/render3/hooks.d.ts +7 -6
  426. package/src/render3/index.d.ts +4 -4
  427. package/src/render3/instructions.d.ts +163 -118
  428. package/src/render3/interfaces/container.d.ts +9 -8
  429. package/src/render3/interfaces/context.d.ts +3 -3
  430. package/src/render3/interfaces/definition.d.ts +2 -12
  431. package/src/render3/interfaces/i18n.d.ts +25 -25
  432. package/src/render3/interfaces/injector.d.ts +8 -9
  433. package/src/render3/interfaces/node.d.ts +56 -23
  434. package/src/render3/interfaces/renderer.d.ts +2 -1
  435. package/src/render3/interfaces/styling.d.ts +392 -117
  436. package/src/render3/interfaces/view.d.ts +49 -35
  437. package/src/render3/jit/compiler_facade_interface.d.ts +10 -3
  438. package/src/render3/jit/module.d.ts +9 -1
  439. package/src/render3/metadata.d.ts +1 -1
  440. package/src/render3/ng_module_ref.d.ts +8 -6
  441. package/src/render3/node_manipulation.d.ts +21 -27
  442. package/src/render3/node_selector_matcher.d.ts +2 -2
  443. package/src/render3/state.d.ts +11 -38
  444. package/src/render3/styling/class_and_style_bindings.d.ts +130 -43
  445. package/src/render3/styling/util.d.ts +9 -4
  446. package/src/render3/util.d.ts +31 -25
  447. package/src/render3/view_engine_compatibility.d.ts +5 -12
  448. package/src/render3/view_engine_compatibility_prebound.d.ts +2 -2
  449. package/src/render3/view_ref.d.ts +2 -2
  450. package/src/sanitization/sanitization.d.ts +3 -2
  451. package/testing/src/r3_test_bed.d.ts +15 -0
  452. package/testing/src/resolvers.d.ts +2 -2
  453. package/testing/testing.metadata.json +1 -1
  454. package/testing.d.ts +5 -0
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import './ng_dev_mode';
9
+ /**
10
+ * This file contains reuseable "empty" symbols that can be used as default return values
11
+ * in different parts of the rendering code. Because the same symbols are returned, this
12
+ * allows for identity checks against these values to be consistently used by the framework
13
+ * code.
14
+ */
15
+ export declare const EMPTY_OBJ: {};
16
+ export declare const EMPTY_ARRAY: any[];
@@ -11,4 +11,4 @@ export declare function throwCyclicDependencyError(token: any): never;
11
11
  /** Called when there are multiple component selectors that match a given node */
12
12
  export declare function throwMultipleComponentError(tNode: TNode): never;
13
13
  /** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */
14
- export declare function throwErrorIfNoChangesMode(creationMode: boolean, checkNoChangesMode: boolean, oldValue: any, currValue: any): never | void;
14
+ export declare function throwErrorIfNoChangesMode(creationMode: boolean, oldValue: any, currValue: any): never | void;
@@ -13,6 +13,6 @@
13
13
  * to generate a d.ts file containing all the published symbols that is then compared to the golden
14
14
  * file in the public_api_guard test.
15
15
  */
16
- export { getComponent, getDirectives, getHostElement, getInjector, getRootComponents, getViewComponent } from './discovery_utils';
16
+ export { getComponent, getContext, getDirectives, getHostElement, getInjector, getListeners, getRootComponents, getViewComponent } from './discovery_utils';
17
17
  export { markDirty } from './instructions';
18
18
  export { getPlayers } from './players';
@@ -5,7 +5,8 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { HookData, LViewData, TView } from './interfaces/view';
8
+ import { TNode } from './interfaces/node';
9
+ import { HookData, LView, TView } from './interfaces/view';
9
10
  /**
10
11
  * If this is the first template pass, any ngOnInit or ngDoCheck hooks will be queued into
11
12
  * TView.initHooks during directiveCreate.
@@ -14,7 +15,7 @@ import { HookData, LViewData, TView } from './interfaces/view';
14
15
  * directive index), then saved in the even indices of the initHooks array. The odd indices
15
16
  * hold the hook functions themselves.
16
17
  *
17
- * @param index The index of the directive in LViewData
18
+ * @param index The index of the directive in LView
18
19
  * @param hooks The static hooks map on the directive def
19
20
  * @param tView The current TView
20
21
  */
@@ -23,22 +24,22 @@ export declare function queueInitHooks(index: number, onInit: (() => void) | nul
23
24
  * Loops through the directives on a node and queues all their hooks except ngOnInit
24
25
  * and ngDoCheck, which are queued separately in directiveCreate.
25
26
  */
26
- export declare function queueLifecycleHooks(flags: number, tView: TView): void;
27
+ export declare function queueLifecycleHooks(tView: TView, tNode: TNode): void;
27
28
  /**
28
29
  * Calls onInit and doCheck calls if they haven't already been called.
29
30
  *
30
31
  * @param currentView The current view
31
32
  */
32
- export declare function executeInitHooks(currentView: LViewData, tView: TView, creationMode: boolean): void;
33
+ export declare function executeInitHooks(currentView: LView, tView: TView, checkNoChangesMode: boolean): void;
33
34
  /**
34
35
  * Iterates over afterViewInit and afterViewChecked functions and calls them.
35
36
  *
36
37
  * @param currentView The current view
37
38
  */
38
- export declare function executeHooks(data: LViewData, allHooks: HookData | null, checkHooks: HookData | null, creationMode: boolean): void;
39
+ export declare function executeHooks(currentView: LView, allHooks: HookData | null, checkHooks: HookData | null, checkNoChangesMode: boolean): void;
39
40
  /**
40
41
  * Calls lifecycle hooks with their contexts, skipping init hooks if it's not
41
- * creation mode.
42
+ * the first LView pass.
42
43
  *
43
44
  * @param currentView The current view
44
45
  * @param arr The array in which the hooks are found
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { LifecycleHooksFeature, renderComponent, whenRendered } from './component';
9
9
  import { defineBase, defineComponent, defineDirective, defineNgModule, definePipe } from './definition';
10
- import { getHostElement, getRenderedText } from './discovery_utils';
10
+ import { getComponent, getHostElement, getRenderedText } from './discovery_utils';
11
11
  import { InheritDefinitionFeature } from './features/inherit_definition_feature';
12
12
  import { NgOnChangesFeature } from './features/ng_onchanges_feature';
13
13
  import { ProvidersFeature } from './features/providers_feature';
@@ -16,8 +16,8 @@ export { ComponentFactory, ComponentFactoryResolver, ComponentRef, injectCompone
16
16
  export { getFactoryOf, getInheritedFactory } from './di';
17
17
  export { RenderFlags } from './interfaces/definition';
18
18
  export { CssSelectorList } from './interfaces/projection';
19
- export { bind, interpolation1, interpolation2, interpolation3, interpolation4, interpolation5, interpolation6, interpolation7, interpolation8, interpolationV, container, containerRefreshStart, containerRefreshEnd, nextContext, element, elementAttribute, elementClassProp, elementEnd, elementProperty, elementStart, elementContainerStart, elementContainerEnd, elementStyling, elementStylingMap, elementStyleProp, elementStylingApply, listener, store, load, namespaceHTML, namespaceMathML, namespaceSVG, projection, projectionDef, text, textBinding, template, reference, embeddedViewStart, embeddedViewEnd, detectChanges, markDirty, tick, directiveInject, injectAttribute, } from './instructions';
20
- export { getCurrentView, restoreView, enableBindings, disableBindings, } from './state';
19
+ export { allocHostVars, bind, interpolation1, interpolation2, interpolation3, interpolation4, interpolation5, interpolation6, interpolation7, interpolation8, interpolationV, container, containerRefreshStart, containerRefreshEnd, nextContext, element, elementAttribute, elementClassProp, elementEnd, elementProperty, componentHostSyntheticProperty, elementStart, elementContainerStart, elementContainerEnd, elementStyling, elementHostAttrs, elementStylingMap, elementStyleProp, elementStylingApply, listener, store, load, namespaceHTML, namespaceMathML, namespaceSVG, projection, projectionDef, text, textBinding, template, reference, embeddedViewStart, embeddedViewEnd, detectChanges, markDirty, tick, directiveInject, injectAttribute, getCurrentView } from './instructions';
20
+ export { restoreView, enableBindings, disableBindings, } from './state';
21
21
  export { i18n, i18nAttributes, i18nExp, i18nStart, i18nEnd, i18nApply, i18nPostprocess } from './i18n';
22
22
  export { NgModuleFactory, NgModuleRef, NgModuleType } from './ng_module_ref';
23
23
  export { AttributeMarker } from './interfaces/node';
@@ -27,5 +27,5 @@ export { QueryList, query, queryRefresh, } from './query';
27
27
  export { registerContentQuery, loadQueryList, } from './instructions';
28
28
  export { pureFunction0, pureFunction1, pureFunction2, pureFunction3, pureFunction4, pureFunction5, pureFunction6, pureFunction7, pureFunction8, pureFunctionV, } from './pure_function';
29
29
  export { templateRefExtractor } from './view_engine_compatibility_prebound';
30
- export { BaseDef, ComponentDef, ComponentDefWithMeta, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefWithMeta, DirectiveType, NgOnChangesFeature, InheritDefinitionFeature, ProvidersFeature, PipeDef, PipeDefWithMeta, LifecycleHooksFeature, defineComponent, defineDirective, defineNgModule, defineBase, definePipe, getHostElement, getRenderedText, renderComponent, whenRendered, };
30
+ export { BaseDef, ComponentDef, ComponentDefWithMeta, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefWithMeta, DirectiveType, NgOnChangesFeature, InheritDefinitionFeature, ProvidersFeature, PipeDef, PipeDefWithMeta, LifecycleHooksFeature, defineComponent, defineDirective, defineNgModule, defineBase, definePipe, getHostElement, getComponent, getRenderedText, renderComponent, whenRendered, };
31
31
  export { NO_CHANGE } from './tokens';
@@ -13,14 +13,14 @@ import { Sanitizer } from '../sanitization/security';
13
13
  import { StyleSanitizeFn } from '../sanitization/style_sanitizer';
14
14
  import { Type } from '../type';
15
15
  import { LContainer } from './interfaces/container';
16
- import { ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDefListOrFactory, InitialStylingFlags, PipeDefListOrFactory, RenderFlags } from './interfaces/definition';
16
+ import { ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDefListOrFactory, PipeDefListOrFactory, RenderFlags } from './interfaces/definition';
17
17
  import { LocalRefExtractor, TAttributes, TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, TProjectionNode, TViewNode } from './interfaces/node';
18
18
  import { PlayerFactory } from './interfaces/player';
19
19
  import { CssSelectorList } from './interfaces/projection';
20
20
  import { LQueries } from './interfaces/query';
21
21
  import { RComment, RElement, RText, Renderer3, RendererFactory3 } from './interfaces/renderer';
22
22
  import { SanitizerFn } from './interfaces/sanitization';
23
- import { LViewData, LViewFlags, RootContext, RootContextFlags, TView } from './interfaces/view';
23
+ import { LView, LViewFlags, OpaqueViewState, RootContext, RootContextFlags, TView } from './interfaces/view';
24
24
  import { NO_CHANGE } from './tokens';
25
25
  /**
26
26
  * Refreshes the view, executing the following steps in that order:
@@ -28,10 +28,10 @@ import { NO_CHANGE } from './tokens';
28
28
  * bindings, refreshes child components.
29
29
  * Note: view hooks are triggered later when leaving the view.
30
30
  */
31
- export declare function refreshDescendantViews(viewData: LViewData, rf: RenderFlags | null): void;
31
+ export declare function refreshDescendantViews(lView: LView): void;
32
32
  /** Sets the host bindings for the current view. */
33
- export declare function setHostBindings(tView: TView, viewData: LViewData): void;
34
- export declare function createLViewData<T>(parentLView: LViewData | null, tView: TView, context: T | null, flags: LViewFlags, rendererFactory?: RendererFactory3 | null, renderer?: Renderer3 | null, sanitizer?: Sanitizer | null, injector?: Injector | null): LViewData;
33
+ export declare function setHostBindings(tView: TView, viewData: LView): void;
34
+ export declare function createLView<T>(parentLView: LView | null, tView: TView, context: T | null, flags: LViewFlags, rendererFactory?: RendererFactory3 | null, renderer?: Renderer3 | null, sanitizer?: Sanitizer | null, injector?: Injector | null): LView;
35
35
  /**
36
36
  * Create and stores the TNode, and hooks it up to the tree.
37
37
  *
@@ -45,15 +45,15 @@ export declare function createLViewData<T>(parentLView: LViewData | null, tView:
45
45
  export declare function createNodeAtIndex(index: number, type: TNodeType.Element, native: RElement | RText | null, name: string | null, attrs: TAttributes | null): TElementNode;
46
46
  export declare function createNodeAtIndex(index: number, type: TNodeType.Container, native: RComment, name: string | null, attrs: TAttributes | null): TContainerNode;
47
47
  export declare function createNodeAtIndex(index: number, type: TNodeType.Projection, native: null, name: null, attrs: TAttributes | null): TProjectionNode;
48
- export declare function createNodeAtIndex(index: number, type: TNodeType.ElementContainer, native: RComment, name: null, attrs: TAttributes | null): TElementContainerNode;
48
+ export declare function createNodeAtIndex(index: number, type: TNodeType.ElementContainer, native: RComment, name: string | null, attrs: TAttributes | null): TElementContainerNode;
49
49
  export declare function createNodeAtIndex(index: number, type: TNodeType.IcuContainer, native: RComment, name: null, attrs: TAttributes | null): TElementContainerNode;
50
- export declare function createViewNode(index: number, view: LViewData): TViewNode;
50
+ export declare function createViewNode(index: number, view: LView): TViewNode;
51
51
  /**
52
52
  * When elements are created dynamically after a view blueprint is created (e.g. through
53
53
  * i18nApply() or ComponentFactory.create), we need to adjust the blueprint for future
54
54
  * template passes.
55
55
  */
56
- export declare function allocExpando(view: LViewData): void;
56
+ export declare function allocExpando(view: LView): void;
57
57
  /**
58
58
  *
59
59
  * @param hostNode Existing node to render into.
@@ -65,13 +65,13 @@ export declare function allocExpando(view: LViewData): void;
65
65
  * @param directives Directive defs that should be used for matching
66
66
  * @param pipes Pipe defs that should be used for matching
67
67
  */
68
- export declare function renderTemplate<T>(hostNode: RElement, templateFn: ComponentTemplate<T>, consts: number, vars: number, context: T, providedRendererFactory: RendererFactory3, hostView: LViewData | null, directives?: DirectiveDefListOrFactory | null, pipes?: PipeDefListOrFactory | null, sanitizer?: Sanitizer | null): LViewData;
68
+ export declare function renderTemplate<T>(hostNode: RElement, templateFn: ComponentTemplate<T>, consts: number, vars: number, context: T, providedRendererFactory: RendererFactory3, hostView: LView | null, directives?: DirectiveDefListOrFactory | null, pipes?: PipeDefListOrFactory | null, sanitizer?: Sanitizer | null): LView;
69
69
  /**
70
70
  * Used for creating the LViewNode of a dynamic embedded view,
71
71
  * either through ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().
72
72
  * Such lViewNode will then be renderer with renderEmbeddedTemplate() (see below).
73
73
  */
74
- export declare function createEmbeddedViewAndNode<T>(tView: TView, context: T, declarationView: LViewData, renderer: Renderer3, queries: LQueries | null, injectorIndex: number): LViewData;
74
+ export declare function createEmbeddedViewAndNode<T>(tView: TView, context: T, declarationView: LView, renderer: Renderer3, queries: LQueries | null, injectorIndex: number): LView;
75
75
  /**
76
76
  * Used for rendering embedded views (e.g. dynamically created views)
77
77
  *
@@ -82,7 +82,7 @@ export declare function createEmbeddedViewAndNode<T>(tView: TView, context: T, d
82
82
  * can't store TViews in the template function itself (as we do for comps). Instead, we store the
83
83
  * TView for dynamically created views on their host TNode, which only has one instance.
84
84
  */
85
- export declare function renderEmbeddedTemplate<T>(viewToRender: LViewData, tView: TView, context: T, rf: RenderFlags): void;
85
+ export declare function renderEmbeddedTemplate<T>(viewToRender: LView, tView: TView, context: T): void;
86
86
  /**
87
87
  * Retrieves a context at the level specified and saves it as the global, contextViewData.
88
88
  * Will get the next level up if level is not specified.
@@ -102,7 +102,8 @@ export declare function namespaceHTML(): void;
102
102
  *
103
103
  * @param index Index of the element in the data array
104
104
  * @param name Name of the DOM Node
105
- * @param attrs Statically bound set of attributes to be written into the DOM element on creation.
105
+ * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM
106
+ * element on creation. Use [AttributeMarker] to denote the meaning of this array.
106
107
  * @param localRefs A set of local reference bindings on the element.
107
108
  */
108
109
  export declare function element(index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void;
@@ -110,7 +111,7 @@ export declare function element(index: number, name: string, attrs?: TAttributes
110
111
  * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.
111
112
  * The instruction must later be followed by `elementContainerEnd()` call.
112
113
  *
113
- * @param index Index of the element in the LViewData array
114
+ * @param index Index of the element in the LView array
114
115
  * @param attrs Set of attributes to be used when matching directives.
115
116
  * @param localRefs A set of local reference bindings on the element.
116
117
  *
@@ -124,9 +125,10 @@ export declare function elementContainerEnd(): void;
124
125
  /**
125
126
  * Create DOM element. The instruction must later be followed by `elementEnd()` call.
126
127
  *
127
- * @param index Index of the element in the LViewData array
128
+ * @param index Index of the element in the LView array
128
129
  * @param name Name of the DOM Node
129
- * @param attrs Statically bound set of attributes to be written into the DOM element on creation.
130
+ * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM
131
+ * element on creation. Use [AttributeMarker] to denote the meaning of this array.
130
132
  * @param localRefs A set of local reference bindings on the element.
131
133
  *
132
134
  * Attributes and localRefs are passed as an array of strings where elements with an even index
@@ -188,7 +190,7 @@ export declare function listener(eventName: string, listenerFn: (e?: any) => any
188
190
  * - Cleanup function
189
191
  * - Index of context we just saved in LView.cleanupInstances
190
192
  */
191
- export declare function storeCleanupWithContext(view: LViewData | null, context: any, cleanupFn: Function): void;
193
+ export declare function storeCleanupWithContext(lView: LView, context: any, cleanupFn: Function): void;
192
194
  /**
193
195
  * Saves the cleanup function itself in LView.cleanupInstances.
194
196
  *
@@ -197,7 +199,7 @@ export declare function storeCleanupWithContext(view: LViewData | null, context:
197
199
  *
198
200
  * On the first template pass, the index of the cleanup function is saved in TView.
199
201
  */
200
- export declare function storeCleanupFn(view: LViewData, cleanupFn: Function): void;
202
+ export declare function storeCleanupFn(view: LView, cleanupFn: Function): void;
201
203
  /** Mark the end of the element. */
202
204
  export declare function elementEnd(): void;
203
205
  /**
@@ -211,7 +213,7 @@ export declare function elementEnd(): void;
211
213
  */
212
214
  export declare function elementAttribute(index: number, name: string, value: any, sanitizer?: SanitizerFn | null): void;
213
215
  /**
214
- * Update a property on an Element.
216
+ * Update a property on an element.
215
217
  *
216
218
  * If the property name also exists as an input property on one of the element's directives,
217
219
  * the component property will be set instead of the element property. This check must
@@ -222,8 +224,32 @@ export declare function elementAttribute(index: number, name: string, value: any
222
224
  * renaming as part of minification.
223
225
  * @param value New value to write.
224
226
  * @param sanitizer An optional function used to sanitize the value.
227
+ * @param nativeOnly Whether or not we should only set native properties and skip input check
228
+ * (this is necessary for host property bindings)
225
229
  */
226
- export declare function elementProperty<T>(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null): void;
230
+ export declare function elementProperty<T>(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void;
231
+ /**
232
+ * Updates a synthetic host binding (e.g. `[@foo]`) on a component.
233
+ *
234
+ * This instruction is for compatibility purposes and is designed to ensure that a
235
+ * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in
236
+ * the component's renderer. Normally all host bindings are evaluated with the parent
237
+ * component's renderer, but, in the case of animation @triggers, they need to be
238
+ * evaluated with the sub components renderer (because that's where the animation
239
+ * triggers are defined).
240
+ *
241
+ * Do not use this instruction as a replacement for `elementProperty`. This instruction
242
+ * only exists to ensure compatibility with the ViewEngine's host binding behavior.
243
+ *
244
+ * @param index The index of the element to update in the data array
245
+ * @param propName Name of property. Because it is going to DOM, this is not subject to
246
+ * renaming as part of minification.
247
+ * @param value New value to write.
248
+ * @param sanitizer An optional function used to sanitize the value.
249
+ * @param nativeOnly Whether or not we should only set native properties and skip input check
250
+ * (this is necessary for host property bindings)
251
+ */
252
+ export declare function componentHostSyntheticProperty<T>(index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null, nativeOnly?: boolean): void;
227
253
  /**
228
254
  * Constructs a TNode object from the arguments.
229
255
  *
@@ -234,108 +260,130 @@ export declare function elementProperty<T>(index: number, propName: string, valu
234
260
  * @param tViews Any TViews attached to this node
235
261
  * @returns the TNode object
236
262
  */
237
- export declare function createTNode(viewData: LViewData, type: TNodeType, adjustedIndex: number, tagName: string | null, attrs: TAttributes | null, tViews: TView[] | null): TNode;
263
+ export declare function createTNode(lView: LView, type: TNodeType, adjustedIndex: number, tagName: string | null, attrs: TAttributes | null, tViews: TView[] | null): TNode;
238
264
  /**
239
- * Add or remove a class in a `classList` on a DOM element.
265
+ * Assign any inline style values to the element during creation mode.
240
266
  *
241
- * This instruction is meant to handle the [class.foo]="exp" case
267
+ * This instruction is meant to be called during creation mode to register all
268
+ * dynamic style and class bindings on the element. Note for static values (no binding)
269
+ * see `elementStart` and `elementHostAttrs`.
270
+ *
271
+ * @param classBindingNames An array containing bindable class names.
272
+ * The `elementClassProp` refers to the class name by index in this array.
273
+ * (i.e. `['foo', 'bar']` means `foo=0` and `bar=1`).
274
+ * @param styleBindingNames An array containing bindable style properties.
275
+ * The `elementStyleProp` refers to the class name by index in this array.
276
+ * (i.e. `['width', 'height']` means `width=0` and `height=1`).
277
+ * @param styleSanitizer An optional sanitizer function that will be used to sanitize any CSS
278
+ * property values that are applied to the element (during rendering).
279
+ * Note that the sanitizer instance itself is tied to the `directive` (if provided).
280
+ * @param directive A directive instance the styling is associated with. If not provided
281
+ * current view's controller instance is assumed.
242
282
  *
243
- * @param index The index of the element to update in the data array
244
- * @param classIndex Index of class to toggle. Because it is going to DOM, this is not subject to
245
- * renaming as part of minification.
246
- * @param value A value indicating if a given class should be added or removed.
247
- * @param directive the ref to the directive that is attempting to change styling.
283
+ * @publicApi
248
284
  */
249
- export declare function elementClassProp(index: number, classIndex: number, value: boolean | PlayerFactory, directive?: {}): void;
285
+ export declare function elementStyling(classBindingNames?: string[] | null, styleBindingNames?: string[] | null, styleSanitizer?: StyleSanitizeFn | null, directive?: {}): void;
250
286
  /**
251
- * Assign any inline style values to the element during creation mode.
287
+ * Assign static styling values to a host element.
252
288
  *
253
- * This instruction is meant to be called during creation mode to apply all styling
254
- * (e.g. `style="..."`) values to the element. This is also where the provided index
255
- * value is allocated for the styling details for its corresponding element (the element
256
- * index is the previous index value from this one).
289
+ * NOTE: This instruction is meant to used from `hostBindings` function only.
257
290
  *
258
- * (Note this function calls `elementStylingApply` immediately when called.)
291
+ * @param directive A directive instance the styling is associated with.
292
+ * @param attrs An array containing class and styling information. The values must be marked with
293
+ * `AttributeMarker`.
259
294
  *
295
+ * ```
296
+ * var attrs = [AttributeMarker.Classes, 'foo', 'bar',
297
+ * AttributeMarker.Styles, 'width', '100px', 'height, '200px']
298
+ * elementHostAttrs(directive, attrs);
299
+ * ```
260
300
  *
261
- * @param index Index value which will be allocated to store styling data for the element.
262
- * (Note that this is not the element index, but rather an index value allocated
263
- * specifically for element styling--the index must be the next index after the element
264
- * index.)
265
- * @param classDeclarations A key/value array of CSS classes that will be registered on the element.
266
- * Each individual style will be used on the element as long as it is not overridden
267
- * by any classes placed on the element by multiple (`[class]`) or singular (`[class.named]`)
268
- * bindings. If a class binding changes its value to a falsy value then the matching initial
269
- * class value that are passed in here will be applied to the element (if matched).
270
- * @param styleDeclarations A key/value array of CSS styles that will be registered on the element.
271
- * Each individual style will be used on the element as long as it is not overridden
272
- * by any styles placed on the element by multiple (`[style]`) or singular (`[style.prop]`)
273
- * bindings. If a style binding changes its value to null then the initial styling
274
- * values that are passed in here will be applied to the element (if matched).
275
- * @param styleSanitizer An optional sanitizer function that will be used (if provided)
276
- * to sanitize the any CSS property values that are applied to the element (during rendering).
277
- * @param directive the ref to the directive that is attempting to change styling.
301
+ * @publicApi
278
302
  */
279
- export declare function elementStyling(classDeclarations?: (string | boolean | InitialStylingFlags)[] | null, styleDeclarations?: (string | boolean | InitialStylingFlags)[] | null, styleSanitizer?: StyleSanitizeFn | null, directive?: {}): void;
303
+ export declare function elementHostAttrs(directive: any, attrs: TAttributes): void;
280
304
  /**
281
- * Apply all styling values to the element which have been queued by any styling instructions.
305
+ * Apply styling binding to the element.
306
+ *
307
+ * This instruction is meant to be run after `elementStyle` and/or `elementStyleProp`.
308
+ * if any styling bindings have changed then the changes are flushed to the element.
282
309
  *
283
- * This instruction is meant to be run once one or more `elementStyle` and/or `elementStyleProp`
284
- * have been issued against the element. This function will also determine if any styles have
285
- * changed and will then skip the operation if there is nothing new to render.
286
310
  *
287
- * Once called then all queued styles will be flushed.
311
+ * @param index Index of the element's with which styling is associated.
312
+ * @param directive Directive instance that is attempting to change styling. (Defaults to the
313
+ * component of the current view).
314
+ components
288
315
  *
289
- * @param index Index of the element's styling storage that will be rendered.
290
- * (Note that this is not the element index, but rather an index value allocated
291
- * specifically for element styling--the index must be the next index after the element
292
- * index.)
293
- * @param directive the ref to the directive that is attempting to change styling.
316
+ * @publicApi
294
317
  */
295
- export declare function elementStylingApply(index: number, directive?: {}): void;
318
+ export declare function elementStylingApply(index: number, directive?: any): void;
296
319
  /**
297
- * Queue a given style to be rendered on an Element.
320
+ * Update a style bindings value on an element.
298
321
  *
299
322
  * If the style value is `null` then it will be removed from the element
300
323
  * (or assigned a different value depending if there are any styles placed
301
324
  * on the element with `elementStyle` or any styles that are present
302
325
  * from when the element was created (with `elementStyling`).
303
326
  *
304
- * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)
327
+ * (Note that the styling element is updated as part of `elementStylingApply`.)
305
328
  *
306
- * @param index Index of the element's styling storage to change in the data array.
307
- * (Note that this is not the element index, but rather an index value allocated
308
- * specifically for element styling--the index must be the next index after the element
309
- * index.)
310
- * @param styleIndex Index of the style property on this element. (Monotonically increasing.)
311
- * @param value New value to write (null to remove).
329
+ * @param index Index of the element's with which styling is associated.
330
+ * @param styleIndex Index of style to update. This index value refers to the
331
+ * index of the style in the style bindings array that was passed into
332
+ * `elementStlyingBindings`.
333
+ * @param value New value to write (null to remove). Note that if a directive also
334
+ * attempts to write to the same binding value then it will only be able to
335
+ * do so if the template binding value is `null` (or doesn't exist at all).
312
336
  * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.
313
337
  * Note that when a suffix is provided then the underlying sanitizer will
314
338
  * be ignored.
315
- * @param directive the ref to the directive that is attempting to change styling.
339
+ * @param directive Directive instance that is attempting to change styling. (Defaults to the
340
+ * component of the current view).
341
+ components
342
+ *
343
+ * @publicApi
344
+ */
345
+ export declare function elementStyleProp(index: number, styleIndex: number, value: string | number | String | PlayerFactory | null, suffix?: string | null, directive?: {}): void;
346
+ /**
347
+ * Add or remove a class via a class binding on a DOM element.
348
+ *
349
+ * This instruction is meant to handle the [class.foo]="exp" case and, therefore,
350
+ * the class itself must already be applied using `elementStyling` within
351
+ * the creation block.
352
+ *
353
+ * @param index Index of the element's with which styling is associated.
354
+ * @param classIndex Index of class to toggle. This index value refers to the
355
+ * index of the class in the class bindings array that was passed into
356
+ * `elementStlyingBindings` (which is meant to be called before this
357
+ * function is).
358
+ * @param value A true/false value which will turn the class on or off.
359
+ * @param directive Directive instance that is attempting to change styling. (Defaults to the
360
+ * component of the current view).
361
+ components
362
+ *
363
+ * @publicApi
316
364
  */
317
- export declare function elementStyleProp(index: number, styleIndex: number, value: string | number | String | PlayerFactory | null, suffix?: string, directive?: {}): void;
365
+ export declare function elementClassProp(index: number, classIndex: number, value: boolean | PlayerFactory, directive?: {}): void;
318
366
  /**
319
- * Queue a key/value map of styles to be rendered on an Element.
367
+ * Update style and/or class bindings using object literal.
320
368
  *
321
- * This instruction is meant to handle the `[style]="exp"` usage. When styles are applied to
322
- * the Element they will then be placed with respect to any styles set with `elementStyleProp`.
323
- * If any styles are set to `null` then they will be removed from the element (unless the same
324
- * style properties have been assigned to the element during creation using `elementStyling`).
369
+ * This instruction is meant apply styling via the `[style]="exp"` and `[class]="exp"` template
370
+ * bindings. When styles are applied to the Element they will then be placed with respect to
371
+ * any styles set with `elementStyleProp`. If any styles are set to `null` then they will be
372
+ * removed from the element.
325
373
  *
326
374
  * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)
327
375
  *
328
- * @param index Index of the element's styling storage to change in the data array.
329
- * (Note that this is not the element index, but rather an index value allocated
330
- * specifically for element styling--the index must be the next index after the element
331
- * index.)
376
+ * @param index Index of the element's with which styling is associated.
332
377
  * @param classes A key/value style map of CSS classes that will be added to the given element.
333
378
  * Any missing classes (that have already been applied to the element beforehand) will be
334
379
  * removed (unset) from the element's list of CSS classes.
335
380
  * @param styles A key/value style map of the styles that will be applied to the given element.
336
381
  * Any missing styles (that have already been applied to the element beforehand) will be
337
382
  * removed (unset) from the element's styling.
338
- * @param directive the ref to the directive that is attempting to change styling.
383
+ * @param directive Directive instance that is attempting to change styling. (Defaults to the
384
+ * component of the current view).
385
+ *
386
+ * @publicApi
339
387
  */
340
388
  export declare function elementStylingMap<T>(index: number, classes: {
341
389
  [key: string]: any;
@@ -360,7 +408,7 @@ export declare function textBinding<T>(index: number, value: T | NO_CHANGE): voi
360
408
  /**
361
409
  * Instantiate a root component.
362
410
  */
363
- export declare function instantiateRootComponent<T>(tView: TView, viewData: LViewData, def: ComponentDef<T>): T;
411
+ export declare function instantiateRootComponent<T>(tView: TView, viewData: LView, def: ComponentDef<T>): T;
364
412
  /**
365
413
  * Generates a new block in TView.expandoInstructions for this node.
366
414
  *
@@ -368,12 +416,6 @@ export declare function instantiateRootComponent<T>(tView: TView, viewData: LVie
368
416
  * it from the hostVar count) and the directive count. See more in VIEW_DATA.md.
369
417
  */
370
418
  export declare function generateExpandoInstructionBlock(tView: TView, tNode: TNode, directiveCount: number): void;
371
- /**
372
- * On the first template pass, we need to reserve space for host binding values
373
- * after directives are matched (so all directives are saved, then bindings).
374
- * Because we are updating the blueprint, we only need to do this once.
375
- */
376
- export declare function prefillHostVars(tView: TView, viewData: LViewData, totalHostVars: number): void;
377
419
  /** Stores index of component's host element so it will be queued for view refresh during CD. */
378
420
  export declare function queueComponentIndexForCheck(previousOrParentTNode: TNode): void;
379
421
  /**
@@ -392,7 +434,7 @@ export declare function initNodeFlags(tNode: TNode, index: number, numberOfDirec
392
434
  * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case
393
435
  * @returns LContainer
394
436
  */
395
- export declare function createLContainer(hostNative: RElement | RComment, hostTNode: TElementNode | TContainerNode | TElementContainerNode, currentView: LViewData, native: RComment, isForViewContainerRef?: boolean): LContainer;
437
+ export declare function createLContainer(hostNative: RElement | RComment, hostTNode: TElementNode | TContainerNode | TElementContainerNode, currentView: LView, native: RComment, isForViewContainerRef?: boolean): LContainer;
396
438
  /**
397
439
  * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.
398
440
  *
@@ -445,12 +487,11 @@ export declare function embeddedViewEnd(): void;
445
487
  /**
446
488
  * Refreshes components by entering the component view and processing its bindings, queries, etc.
447
489
  *
448
- * @param adjustedElementIndex Element index in LViewData[] (adjusted for HEADER_OFFSET)
449
- * @param rf The render flags that should be used to process this template
490
+ * @param adjustedElementIndex Element index in LView[] (adjusted for HEADER_OFFSET)
450
491
  */
451
- export declare function componentRefresh<T>(adjustedElementIndex: number, rf: RenderFlags | null): void;
492
+ export declare function componentRefresh<T>(adjustedElementIndex: number): void;
452
493
  /** Returns a boolean for whether the view is attached */
453
- export declare function viewAttached(view: LViewData): boolean;
494
+ export declare function viewAttached(view: LView): boolean;
454
495
  /**
455
496
  * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.
456
497
  * It takes all the selectors from the entire component's template and decides where
@@ -484,19 +525,19 @@ export declare function projectionDef(selectors?: CssSelectorList[], textSelecto
484
525
  */
485
526
  export declare function projection(nodeIndex: number, selectorIndex?: number, attrs?: string[]): void;
486
527
  /**
487
- * Adds LViewData or LContainer to the end of the current view tree.
528
+ * Adds LView or LContainer to the end of the current view tree.
488
529
  *
489
530
  * This structure will be used to traverse through nested views to remove listeners
490
531
  * and call onDestroy callbacks.
491
532
  *
492
- * @param currentView The view where LViewData or LContainer should be added
493
- * @param adjustedHostIndex Index of the view's host node in LViewData[], adjusted for header
494
- * @param state The LViewData or LContainer to add to the view tree
533
+ * @param lView The view where LView or LContainer should be added
534
+ * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header
535
+ * @param state The LView or LContainer to add to the view tree
495
536
  * @returns The state passed in
496
537
  */
497
- export declare function addToViewTree<T extends LViewData | LContainer>(currentView: LViewData, adjustedHostIndex: number, state: T): T;
538
+ export declare function addToViewTree<T extends LView | LContainer>(lView: LView, adjustedHostIndex: number, state: T): T;
498
539
  /** Marks current view and all ancestors dirty */
499
- export declare function markViewDirty(view: LViewData): void;
540
+ export declare function markViewDirty(lView: LView): void;
500
541
  /**
501
542
  * Used to schedule change detection on the whole application.
502
543
  *
@@ -536,12 +577,13 @@ export declare function tick<T>(component: T): void;
536
577
  * @param component The component which the change detection should be performed on.
537
578
  */
538
579
  export declare function detectChanges<T>(component: T): void;
580
+ export declare function detectChangesInternal<T>(view: LView, context: T): void;
539
581
  /**
540
582
  * Synchronously perform change detection on a root view and its components.
541
583
  *
542
- * @param lViewData The view which the change detection should be performed on.
584
+ * @param lView The view which the change detection should be performed on.
543
585
  */
544
- export declare function detectChangesInRootView(lViewData: LViewData): void;
586
+ export declare function detectChangesInRootView(lView: LView): void;
545
587
  /**
546
588
  * Checks the change detector and its children, and throws if any changes are detected.
547
589
  *
@@ -556,9 +598,11 @@ export declare function checkNoChanges<T>(component: T): void;
556
598
  * This is used in development mode to verify that running change detection doesn't
557
599
  * introduce other changes.
558
600
  *
559
- * @param lViewData The view which the change detection should be checked on.
601
+ * @param lView The view which the change detection should be checked on.
560
602
  */
561
- export declare function checkNoChangesInRootView(lViewData: LViewData): void;
603
+ export declare function checkNoChangesInRootView(lView: LView): void;
604
+ /** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */
605
+ export declare function checkView<T>(hostView: LView, component: T): void;
562
606
  /**
563
607
  * Mark the component as dirty (needing change detection).
564
608
  *
@@ -582,6 +626,12 @@ export declare function markDirty<T>(component: T): void;
582
626
  * @param value Value to diff
583
627
  */
584
628
  export declare function bind<T>(value: T): T | NO_CHANGE;
629
+ /**
630
+ * Allocates the necessary amount of slots for host vars.
631
+ *
632
+ * @param count Amount of vars to be allocated
633
+ */
634
+ export declare function allocHostVars(count: number): void;
585
635
  /**
586
636
  * Create interpolation bindings with a variable number of expressions.
587
637
  *
@@ -631,18 +681,6 @@ export declare function reference<T>(index: number): T;
631
681
  export declare function loadQueryList<T>(queryListIdx: number): QueryList<T>;
632
682
  /** Retrieves a value from current `viewData`. */
633
683
  export declare function load<T>(index: number): T;
634
- /** Gets the current binding value. */
635
- export declare function getBinding(bindingIndex: number): any;
636
- /** Updates binding if changed, then returns whether it was updated. */
637
- export declare function bindingUpdated(bindingIndex: number, value: any): boolean;
638
- /** Updates binding and returns the value. */
639
- export declare function updateBinding(bindingIndex: number, value: any): any;
640
- /** Updates 2 bindings if changed, then returns whether either was updated. */
641
- export declare function bindingUpdated2(bindingIndex: number, exp1: any, exp2: any): boolean;
642
- /** Updates 3 bindings if changed, then returns whether any was updated. */
643
- export declare function bindingUpdated3(bindingIndex: number, exp1: any, exp2: any, exp3: any): boolean;
644
- /** Updates 4 bindings if changed, then returns whether any was updated. */
645
- export declare function bindingUpdated4(bindingIndex: number, exp1: any, exp2: any, exp3: any, exp4: any): boolean;
646
684
  /**
647
685
  * Returns the value associated to the given token from the injectors.
648
686
  *
@@ -676,4 +714,11 @@ export declare function injectAttribute(attrNameToInject: string): string | null
676
714
  */
677
715
  export declare function registerContentQuery<Q>(queryList: QueryList<Q>, currentDirectiveIndex: number): void;
678
716
  export declare const CLEAN_PROMISE: Promise<null>;
679
- export declare function delegateToClassInput(tNode: TNode): number;
717
+ /**
718
+ * Returns the current OpaqueViewState instance.
719
+ *
720
+ * Used in conjunction with the restoreView() instruction to save a snapshot
721
+ * of the current view and restore it when listeners are invoked. This allows
722
+ * walking the declaration view tree in listeners to get vars from parent views.
723
+ */
724
+ export declare function getCurrentView(): OpaqueViewState;