https://github.com/angular/angular
Revision fe3e4d6865c1e760be0511cfd757b4574a67fa5b authored by Andrew Scott on 21 January 2022, 19:51:40 UTC, committed by Andrew Kushnir on 25 January 2022, 22:15:45 UTC
An `ng-template` with an inline template (i.e. has a structural
directive) would previously not get an `undefined` `tagName` because the
logic assumed the element would be `t.Element` or `t.Content` and read
the tag name from the `name` property. For a `t.Template`, this exists
instead on the `t.tagName`. The final result would be an `tagName` of `undefined`
for the parent `t.Template`, causing failures in the indexer downstream.

This `undefined` value is actually expected in the renderer code, even
though the type does not specify this possibility. This change updates
the type of `tagName` to be `string|null` and explicitly handles the
case where there is a structural directive on an `ng-template`. You can
see how the two are differentiated in the compliance code that was
modified in this commit.

PR Close #44788
1 parent 6cb7c3e
History
Tip revision: fe3e4d6865c1e760be0511cfd757b4574a67fa5b authored by Andrew Scott on 21 January 2022, 19:51:40 UTC
fix(compiler-cli): Handle `ng-template` with structural directive in indexer (#44788)
Tip revision: fe3e4d6
File Mode Size
ISSUE_TEMPLATE
workflows
ISSUE_TEMPLATE.md -rw-r--r-- 170 bytes
PULL_REQUEST_TEMPLATE.md -rw-r--r-- 1.1 KB
angular-robot.yml -rw-r--r-- 6.4 KB

back to top