6
<div data-value="{{tagName}}">{{tagName}}</div>

Getting "data-value is not a valid attribute" of div error.

sathishkumar
  • 1,700
  • 4
  • 19
  • 30

1 Answers1

15

By default Angular2 binds to properties for performance reasons. To explicitly bind to attributes use one of these options

attr.data-value="{{tagName}}"

or

[attr.data-value]="tagName"
Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506