I'm trying to displaying images dynamically but unfortunately I've been unsuccessful.
Here's my current html code:
<article class="panel panel-default">
<div class="panel-body">
{{ content.file }}
</div>
<img [src]="content.file" class="img-thumbnail" alt="Can't Display Image" width="304" height="236">
<footer class="panel-footer">
<div class="author">
{{ content.username }}
</div>
<div class="config" *ngIf="belongsToUser()">
<a (click)="onEdit()">Edit</a>
<a (click)="onDelete()">Delete</a>
</div>
</footer>
</article>
Here's what I get when I use [src]=content.file
However, I double checked that content.file has the correct relative path to the image as evident by my console.
When I hardcode the link using: <img src="../../../uploads/file-1491707047047.jpg" class="img-thumbnail" alt="Can't Display Image" width="304" height="236">
instead, I get the image to display (which I literally copied from the console content.file
field).
Any idea what could be causing the problem? Thanks!