update
In Angular2 final [for]="xxx"
should work fine. They added an alias from for
to htmlFor
.
original
Angular by default uses property binding but label
doesn't have a property for
. To tell Angular explicitly to use attribute binding, use instead:
[attr.for]="someField"
or
attr.for="{{someField}}"
instead.
These also work because htmlFor
is the property for
is reflected to.
[htmlFor]="someField"
htmlFor="{{someField}}"
In Angular2 RC.6 an alias was added so these should now work as well:
[for]="someField"
or
for="{{someField}}"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…