angular-cn/packages/compiler-cli
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
..
integrationtest fix(core): remove createInjector() from public API (#28509) 2019-02-04 16:54:26 -05:00
src feat(ivy): add source mappings to compiled Angular templates (#28055) 2019-02-12 20:58:28 -08:00
test fix(ivy): support injecting ChangeDetectorRef on templates (#27565) 2019-02-13 09:46:53 -08:00
BUILD.bazel build: run offline_compiler_test using bazel (#28191) 2019-01-28 20:07:22 -08:00
browser-rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
index.ts feat(compiler-cli): expose ngtsc as a TscPlugin (#28435) 2019-01-29 16:41:59 -08:00
ngtools2.ts refactor(compiler-cli): expose ngtools api separately (#18978) 2017-08-31 14:37:13 -07:00
package.json feat: add support for typescript 3.2 (#27536) 2018-12-18 13:20:01 -08:00
tsconfig-build.json build: Move non-bazel deps to devDependencies (#26691) 2018-10-30 16:19:13 -04:00
tsconfig.json build(compiler-cli): fix tsconfig.json circularity issue (#22722) 2018-03-15 21:18:07 -07:00