-2

Hi I Want to add JSON data to the Custom HTML Attribute. I Tried Below Format but it Throws Error Element not a Attribute Property of LI.

Here is the screenshot i want to pass data.

http://prntscr.com/hwt4rf

please help me to solve the issue.

zgue
  • 3,635
  • 9
  • 34
  • 36
Santoshraju V
  • 330
  • 1
  • 13
  • 5
    please show your code in this question. do not screenshot – Imran Jan 06 '18 at 13:42
  • Possible duplicate of [Angular 2 data attributes](https://stackoverflow.com/questions/34542619/angular-2-data-attributes) – Imran Jan 06 '18 at 13:54

3 Answers3

2
<li [attr.data-thumb]="link + imtest.file">

Next time please paste code.

Laker
  • 1,194
  • 1
  • 16
  • 30
1

Try this code

<li [attr.data-thumb]="link+imtest.file">
    <img [src]="link+imtest.file" class="testing">
</li>
Vel
  • 8,656
  • 5
  • 30
  • 63
0

Use attribute binding syntax instead

[attr.data-thumb]
Imran
  • 2,876
  • 4
  • 24
  • 39