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

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

sathishkumar
  • 1,780
  • 4
  • 20
  • 31

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
  • 623,577
  • 216
  • 2,003
  • 1,567