diff --git a/frontend/src/app/directives/image-fallback.directive.ts b/frontend/src/app/directives/image-fallback.directive.ts index f1c32f4c..788edf06 100644 --- a/frontend/src/app/directives/image-fallback.directive.ts +++ b/frontend/src/app/directives/image-fallback.directive.ts @@ -1,6 +1,6 @@ import {Directive, ElementRef, HostListener, Input} from '@angular/core'; -const DEFAULT_IMAGE_FALLBACK_PATH: string = '/assets/images/no-image.svg'; +const DEFAULT_IMAGE_FALLBACK_PATH: string = 'assets/images/no-image.svg'; @Directive({ selector: 'img[imageFallback]' @@ -14,7 +14,7 @@ export class ImageFallbackDirective { loadFallbackOnError() { // Check to see if we have already tried to load the fallback image. // Avoids endless loop if for some reason fallback image is missing. Just accept the broken image. - if (this.path(this.elementRef.nativeElement.src) == this.path(this.fallbackSrc())) { + if (this.path(this.elementRef.nativeElement.src).endsWith(this.path(this.fallbackSrc()))) { return; }