Using interpolation to set a property works with this code:
This work for me.
<span *ngFor="let car of Car; let i = index;" >
<img src="car/{{car.id}}">
</span>
but it does not work using property binding
like this:
<span *ngFor="let car of Car; let i = index;" >
<img [src]="car/car.id">
</span>
What should I do?
You can use the following syntax for property binding:
[src]="'car/' + car.id"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With