-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Add extended diagnostic to warn when an attribute is not interpreted as a binding #46137
Copy link
Copy link
Closed
Closed
Copy link
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: extended diagnosticscore: binding & interpolationIssue related to property/attribute binding or text interpolationIssue related to property/attribute binding or text interpolationfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: in backlogFeature request for which voting has completed and is now in the backlogFeature request for which voting has completed and is now in the backloghotlist: error messagesstate: has PR
Milestone
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: extended diagnosticscore: binding & interpolationIssue related to property/attribute binding or text interpolationIssue related to property/attribute binding or text interpolationfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfeature: in backlogFeature request for which voting has completed and is now in the backlogFeature request for which voting has completed and is now in the backloghotlist: error messagesstate: has PR
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Angular does not properly bind an attribute when using
attr.foosyntax if there is no interpolation present in the value.For example, this does not work:
<div attr.foo="bar"></div> <!-- erroneously keeps the attribute as "attr.foo" -->This DOES work:
<div attr.foo="{{myProp}}"></div>This also works:
<div [attr.foo]="'bar'"></div>Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/angular-ivy-ybks1w?file=src%2Fapp%2Fapp.component.html,src%2Fapp%2Fapp.module.ts
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version)