标签: angular
我用于访问根目录映像的代码
Preview image of my code
我的文件夹结构
preview of my angular app folder structure
Error
答案 0 :(得分:0)
想象一下在ts文件中有一个这样的变量:
public myImage = "something.png";
在html中,以尝试使用的方式加载图像,只需执行以下操作即可:
<img [src]="'./assets/' + myImage">