angular-cn/packages/compiler-cli/test/ngtsc
Alex Rickabaugh 13a0d527f6 fix(ivy): correctly write cross-file references (#25080)
There is a bug in the existing handling for cross-file references.
Suppose there are two files, module.ts and component.ts.

component.ts declares two components, one of which uses the other.
In the Ivy model, this means the component will get a directives:
reference to the other in its defineComponent call.

That reference is generated by looking at the declared components
of the module (in module.ts). However, the way ngtsc tracks this
reference, it ends up comparing the identifier of the component
in module.ts with the component.ts file, detecting they're not in
the same file, and generating a relative import.

This commit changes ngtsc to track all identifiers of a reference,
including the one by which it is declared. This allows toExpression()
to correctly decide that a local reference is okay in component.ts.

PR Close #25080
2018-07-26 16:38:09 -07:00
..
fake_core feat(ivy): resolve forwardRef() for queries (#25080) 2018-07-26 16:38:09 -07:00
BUILD.bazel test: switch to ts_web_test_suite (#23859) 2018-05-15 11:40:56 -07:00
ngtsc_spec.ts fix(ivy): correctly write cross-file references (#25080) 2018-07-26 16:38:09 -07:00