Please sign in to comment.
fix(ivy): don't produce template diagnostics when scope is invalid (#…
…34460) Previously, ngtsc would perform scope analysis (which directives/pipes are available inside a component's template) and template type-checking of that template as separate steps. If a component's scope was somehow invalid (e.g. its NgModule imported something which wasn't another NgModule), the component was treated as not having a scope. This meant that during template type-checking, errors would be produced for any invalid expressions/usage of other components that should have been in the scope. This commit changes ngtsc to skip template type-checking of a component if its scope is erroneous (as opposed to not present in the first place). Thus, users aren't overwhelmed with diagnostic errors for the template and are only informed of the root cause of the problem: an invalid NgModule scope. Fixes #33849 PR Close #34460
- Loading branch information
Showing with 135 additions and 23 deletions.
- +11 −1 packages/compiler-cli/src/ngtsc/annotations/src/component.ts
- +4 −3 packages/compiler-cli/src/ngtsc/annotations/src/ng_module.ts
- +2 −2 packages/compiler-cli/src/ngtsc/scope/src/component_scope.ts
- +29 −9 packages/compiler-cli/src/ngtsc/scope/src/local.ts
- +8 −8 packages/compiler-cli/src/ngtsc/scope/test/local_spec.ts
- +81 −0 packages/compiler-cli/test/ngtsc/scope_spec.ts