angular-cn/packages/compiler-cli
JoostK a42057d0f8 fix(ivy): support abstract directives in template type checking (#33131)
Recently it was made possible to have a directive without selector,
which are referred to as abstract directives. Such directives should not
be registered in an NgModule, but can still contain decorators for
inputs, outputs, queries, etc. The information from these decorators and
the `@Directive()` decorator itself needs to be registered with the
central `MetadataRegistry` so that other areas of the compiler can
request information about a given directive, an example of which is the
template type checker that needs to know about the inputs and outputs of
directives.

Prior to this change, however, abstract directives would only register
themselves with the `MetadataRegistry` as being an abstract directive,
without all of its other metadata like inputs and outputs. This meant
that the template type checker was unable to resolve the inputs and
outputs of these abstract directives, therefore failing to check them
correctly. The typical error would be that some property does not exist
on a DOM element, whereas said property should have been bound to the
abstract directive's input.

This commit fixes the problem by always registering the metadata of a
directive or component with the `MetadataRegistry`. Tests have been
added to ensure abstract directives are handled correctly in the
template type checker, together with tests to verify the form of
abstract directives in declaration files.

Fixes #30080

PR Close #33131
2019-10-24 12:44:30 -07:00
..
integrationtest build: remove vendored Babel typings (#33226) 2019-10-17 18:45:52 -04:00
ngcc feat(ngcc): enable private NgModule re-exports in ngcc on request (#33177) 2019-10-22 13:14:31 -04:00
src fix(ivy): support abstract directives in template type checking (#33131) 2019-10-24 12:44:30 -07:00
test fix(ivy): support abstract directives in template type checking (#33131) 2019-10-24 12:44:30 -07:00
BUILD.bazel build: fix build failures with worker mode cache and @types/events (#31325) 2019-07-01 14:16:43 -07:00
index.ts refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
ngtools2.ts refactor(compiler-cli): expose ngtools api separately (#18978) 2017-08-31 14:37:13 -07:00
package.json feat: typescript 3.6 support (#32946) 2019-10-18 13:15:16 -04:00
tsconfig-build.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00
tsconfig.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00