简体   繁体   中英

How add image Jhipster Angular

i have problem to see image in jhipster.

I put the image in the component folder and in the folder src/main/webapp/content/images but i don't see the image on the browser i see only the alt tag agenda.

I use <img src="src\main\webapp\content\images\agenda.jpg" alt="agenda" width="200px"/> for link in homecomponent.html but it does not work

i use angular 14 and jhipster

The root of your webapp is mapped to src/main/webapp folder this is why the image source should be:

<img src="/content/images/agenda.jpg" alt="agenda" width="200px"/>

Gaël's answer is very informative, and it helped me. I will say that in my case, I had to remove the first slash from the image source path, like so:

<img src="content/images/agenda.jpg" alt="agenda" width="200px"/>

I'm on Angular 1.5.8.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM