angular/packages/compiler/src/render3
JoostK 2afc40608d fix(ivy): support injecting ChangeDetectorRef on templates (#27565)
Previously, using a pipe in an input binding on an ng-template would
evaluate the pipe in the context of node that was processed before the
template. This caused the retrieval of e.g. ChangeDetectorRef to be
incorrect, resulting in one of the following bugs depending on the
template's structure:

1. If the template was at the root of a view, the previously processed
node would be the component's host node outside of the current view.
Accessing that node in the context of the current view results in a crash.
2. For templates not at the root, the ChangeDetectorRef injected into the
pipe would correspond with the previously processed node. If that node
hosts a component, the ChangeDetectorRef would not correspond with the
view that the ng-template is part of.

The solution to the above problem is two-fold:

1. Template compilation is adjusted such that the template instruction
is emitted before any instructions produced by input bindings, such as
pipes. This ensures that pipes are evaluated in the context of the
template's container node.
2. A ChangeDetectorRef can be requested for container nodes.

Fixes #28587

PR Close #27565
2019-02-13 09:46:53 -08:00
..
view fix(ivy): support injecting ChangeDetectorRef on templates (#27565) 2019-02-13 09:46:53 -08:00
r3_ast.ts fix(compiler): ensure that event handlers have the correct source spans (#28055) 2019-02-12 20:58:28 -08:00
r3_factory.ts feat(ivy): render flags support in host bindings function (FW-649) (#27204) 2018-11-21 15:33:47 -08:00
r3_identifiers.ts fix(ivy): Content Queries inheritance fix (#28324) 2019-01-28 19:59:00 -08:00
r3_jit.ts refactor(compiler): wrap the jit evaluation in an injectable class (#28055) 2019-02-12 20:58:27 -08:00
r3_module_compiler.ts fix(ivy): don't generate code for blank NgModule fields (#28387) 2019-01-28 19:50:44 -08:00
r3_module_factory_compiler.ts feat(ivy): add an IVY local the compiler which avoids analyzeModule (#23441) 2018-04-19 16:32:09 -07:00
r3_pipe_compiler.ts feat(ivy): render flags support in host bindings function (FW-649) (#27204) 2018-11-21 15:33:47 -08:00
r3_template_transform.ts fix(compiler): ensure that event handlers have the correct source spans (#28055) 2019-02-12 20:58:28 -08:00
r3_types.ts refactor(ivy): remove the backpatch compiler (#23441) 2018-04-19 16:32:09 -07:00
util.ts fix(ivy): ensure @animation host bindings/listeners work properly (#27896) 2019-01-04 14:12:29 -08:00