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
Raw File
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
.gitignore
.DS_STORE

/dist/
/bazel-out
/integration/bazel/bazel-*
*.log
node_modules

# Include when developing application packages.
pubspec.lock
.c9
.idea/
.devcontainer/*
!.devcontainer/README.md
!.devcontainer/recommended-devcontainer.json
!.devcontainer/recommended-Dockerfile
.settings/
.vscode/launch.json
.vscode/settings.json
.vscode/tasks.json
*.swo
*.swp
modules/.settings
modules/.vscode
.vimrc
.nvimrc

# Don't check in secret files
*secret.js

# Ignore npm/yarn debug log
npm-debug.log
yarn-error.log

# build-analytics
.build-analytics

# rollup-test output
/modules/rollup-test/dist/

# User specific bazel settings
.bazelrc.user

# User specific ng-dev settings
.ng-dev.user*

.notes.md
baseline.json

# Ignore .history for the xyz.local-history VSCode extension
.history

# Husky
.husky/_
back to top