-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: extended diagnostics
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler-cli
Is this a regression?
No
Description
When another directive is present on an element with a missing structural directive, the diagnostic ignores it e.g.
@Component({
selector: 'app-root',
template: `
<div
*foo="bar"
[routerLink]="[]"
>
{{ bar }}
</div>
`,
imports: [RouterLink],
})
export class App {
bar = 'bar';
}
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
No typecheck error was reported when it should have been
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 20.3.3
Node: 20.19.1
Package Manager: npm 10.8.2
OS: linux x64
Angular: 20.3.3
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, router
Package Version
------------------------------------
@angular-devkit/architect 0.2003.3
@angular-devkit/core 20.3.3
@angular-devkit/schematics 20.3.3
@schematics/angular 20.3.3
rxjs 7.8.2
typescript 5.9.2
zone.js
Anything else?
The root cause of the issue is here:
Lines 68 to 70 in a7ba2f5
| if (symbol?.directives.length) { | |
| return []; | |
| } |
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: extended diagnostics