【发布时间】:2020-06-29 10:59:41
【问题描述】:
我正在尝试显示存储在 /public/img/"image_file" 项目目录系统中的图像。
/home/adrian/Escritorio/proyectos/mean-social-network/frontend/src/app/public/img/beach2.jpg
我需要从下一个组件 HTML 文件中显示它:index.component.html
感谢阅读。
【问题讨论】:
我正在尝试显示存储在 /public/img/"image_file" 项目目录系统中的图像。
/home/adrian/Escritorio/proyectos/mean-social-network/frontend/src/app/public/img/beach2.jpg
我需要从下一个组件 HTML 文件中显示它:index.component.html
感谢阅读。
【问题讨论】:
实际上,您应该将 assets 文件夹与 app 文件夹放在同一层 并且您可以在组件和 HTML 部分中编写 URL,如下所示:
<img src="/assets/*.svg">
background-image: url('/assets/*.svg');
【讨论】: