-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,793
  • 9
  • 34
  • 39
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,622
  • 4
  • 20
  • 32
1

Try this code

<li [attr.data-thumb]="link+imtest.file">
    <img [src]="link+imtest.file" class="testing">
</li>
Vel
  • 9,027
  • 6
  • 34
  • 66
0

Use attribute binding syntax instead

[attr.data-thumb]
Imran
  • 3,031
  • 4
  • 25
  • 41