angular-cn/packages/core/test/acceptance
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
..
BUILD.bazel test(ivy): move some local ref tests to use TestBed infrastructure. (#28534) 2019-02-05 23:31:08 -05:00
change_detection_spec.ts fix(ivy): support checkNoChanges on embedded views (#28644) 2019-02-11 14:52:32 -08:00
content_spec.ts fix(ivy): extended next pointer lookup while traversing tNode tree (#28533) 2019-02-07 12:37:13 -08:00
di_spec.ts fix(ivy): support injecting ChangeDetectorRef on templates (#27565) 2019-02-13 09:46:53 -08:00
exports_spec.ts feat(ivy): allow non-unique #localRefs to be defined in a template (#28627) 2019-02-11 14:51:31 -08:00
inherit_definition_feature_spec.ts fix(ivy): ngOnChanges should be inherited from super class (#28563) 2019-02-11 16:22:31 -08:00
pipe_spec.ts fix(ivy): compile pipe in context of ternary operator (#28635) 2019-02-11 14:52:13 -08:00
query_spec.ts feat(ivy): allow non-unique #localRefs to be defined in a template (#28627) 2019-02-11 14:51:31 -08:00