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
aio-builds-setup
content
scripts
src
tests
tools
.browserslistrc -rw-r--r-- 600 bytes
.eslintrc.json -rw-r--r-- 3.0 KB
.gitignore -rw-r--r-- 664 bytes
.npmrc -rw-r--r-- 21 bytes
README.md -rw-r--r-- 7.7 KB
angular.json -rw-r--r-- 6.8 KB
firebase.json -rw-r--r-- 16.5 KB
karma.conf.js -rw-r--r-- 2.4 KB
ngsw-config.template.json -rw-r--r-- 1.8 KB
package.json -rw-r--r-- 8.4 KB
security-exemptions.json -rw-r--r-- 302 bytes
tsconfig.app.json -rw-r--r-- 357 bytes
tsconfig.json -rw-r--r-- 1.4 KB
tsconfig.spec.json -rw-r--r-- 297 bytes
tsconfig.worker.json -rw-r--r-- 230 bytes
yarn.lock -rw-r--r-- 559.7 KB

README.md

back to top