Repository navigation
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compiler
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No idea
Description
I get a warning that a directive that I put in the imports field of my component is not used, but actually it is used in the template and removing it from the imports changes/breaks the display.
In the component's template, the directive is used to pass a static string (so, in a templateId="rawvalue" syntax and not [templateId]="valueVariable"), and it is used on a <ng-template> node.
Please provide a link to a minimal reproduction of the bug
https://codeberg.org/Gouvernathor/Apportionment-angular/src/branch/repro
(notice the name of the branch)
Please provide the exception or error you saw
▲ [WARNING] NG8113: TemplateId is not used within the template of Index [plugin angular-compiler]
src/app/+index/index.ts:9:52:
9 │ imports: [StateName, ParliamentarchPrecomputed, TemplateId],
╵ ~~~~~~~~~~
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.2.11
Angular : 21.2.13
Node.js : 26.4.0 (Unsupported)
Package Manager : npm 11.8.0
Operating System : win32 x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.2.11 │ ^21.2.2 │
│ @angular/cli │ 21.2.11 │ ^21.2.2 │
│ @angular/common │ 21.2.13 │ ^21.2.0 │
│ @angular/compiler │ 21.2.13 │ ^21.2.0 │
│ @angular/compiler-cli │ 21.2.13 │ ^21.2.0 │
│ @angular/core │ 21.2.13 │ ^21.2.0 │
│ @angular/forms │ 21.2.13 │ ^21.2.0 │
│ @angular/platform-browser │ 21.2.13 │ ^21.2.0 │
│ @angular/router │ 21.2.13 │ ^21.2.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.1.6 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compiler
Activity
JeanMeche commentedon Aug 29, 2026
JeanMeche commentedon Aug 29, 2026
Actually this is related to the nested use of
ng-templateinside asvgblock.Minimal repro:
And #69640 does not fix that yet.
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
fix(compiler): correctly match directives on `<ng-template>` nested i…
angular-automatic-lock-bot commentedon Nov 1, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.