I use the Angular 2.0 framework and try to create an input component. Also I use Google MDL and it\'s HTML structure required to have labels to input. Angular gives me an e
update
In recent Angular2 versions for
should be mapped to htmlFor
automatically to avoid this kind of problem.
original
You need attribute binding instead of proper binding
<label class="mdl-textfield__label" attr.for="{{input_id}}">{{input_label}}</label>
or
<label class="mdl-textfield__label" [attr.for]="input_id">{{input_label}}</label>
or
<label class="mdl-textfield__label" htmlFor="{{input_id}}">{{input_label}}</label>
htmlFor
is the property that reflects the for
attribute (https://developer.mozilla.org/de/docs/Web/API/HTMLLabelElement)
See also HTML - attributes vs properties