0

enter image description here enter image description here

Please help me if Im missing any configuration in Angular 14.

from <img [src]="assets/images/sidebarNav"> tried using ./, ../

not working for me.

I used How to load image (and other assets) in Angular an project?

Valeriia
  • 586
  • 2
  • 4
  • 21
  • I tried all those, the reason I found is that after upgrading from angular 8 to angular 14. I removed --deploy-url from ng serve. So my images are not loading. Can anyone help how to add deploy url or basehref in angular 14 – Linda Sebastian Jul 24 '23 at 12:10
  • `` See that the src is under single quotes – Eliseo Jul 25 '23 at 06:38

1 Answers1

0

Square brackets ([]) represent the one-way property binding from the component logic (data) to the view (target element).

If you write the source-path to the image in the view-page (html), you doesn't need property binding.

But you are mixing two things here. Either you remove the squared brackets <img src="/assets/images/sidebarNav"> or you need property binding like <img [src]="itemImageUrl"> and set the variable itemImageUrl = 'assets/images/sidebarNav'; in the component file.

But that didn't work on Angular 8 either, so this has nothing to do with your upgrading to version 14.

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34