When the avatar is loaded from the backend and tries to display a picture view in angular. Angular is perceived as an image type text/html. Thus, there is a mistake:
GET http://localhost:4200/photos/original/missing.png 404 (Not Found)
I can not understand what the problem is.
html:
<div class="card-avatar" *ngIf="authService.currentUserData">
<ng-container *ngFor="let photo of filteredPhotos">
<a>
<img [src]="photo.photo" name="photo">
</a>
</ng-container>
</div>
ts:
filteredPhotos =[];
private loadPhotos() {
let filteredPhotos;
if (this.servPhoto) {
this.servPhoto.getPhotos().subscribe(photo => {
if(!this.authService.currentUserData) { return; }
this.photos = photo;
this.filteredPhotos = this.photos.filter((photo) => photo.users_id == this.authService.currentUserData.id);
});
}
}
photo.model.ts:
export class Photo{
constructor(
public users_id: number,
public photo: Blob
) { }
}