You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new template-accessibility-label-for rule seems to not recognize associated id/for attributes that contain interpolated values such as item-{{index}} that would typically be used when a component generates input controls inside of an ngFor loop.
Context and configuration
"template-accessibility-label-for": true,
Code & Expected behavior
<ng-container*ngFor="let item of itemList; let i = index"><labelfor="item-{{i}}">My label #{{i}</label><inputtype="text" id="item-{{i}}" [(ngModel)]="item.name"/>
</ng-container>
The above code will generate unique ID's that associate the control with the label within a loop, yet it produces the error
ERROR: 19:12 template-accessibility-label-for A form label must be associated with a control
Environment
Version 5.0.0
OS: Windows 10
Node.js version 11.4.0
Package manager (yarn/npm) version NPM 6.9.0
Angular version 7.2.12
tslint version 5.15.0
The text was updated successfully, but these errors were encountered:
Describe the bug
The new
template-accessibility-label-for
rule seems to not recognize associated id/for attributes that contain interpolated values such asitem-{{index}}
that would typically be used when a component generates input controls inside of anngFor
loop.Context and configuration
Code & Expected behavior
The above code will generate unique ID's that associate the control with the label within a loop, yet it produces the error
Environment
The text was updated successfully, but these errors were encountered: