-1
我想写本地图像的路径到项目中,它似乎向我显示一个未定义的图像。 路径导航到文件夹角
,你可以看到我在app.component.html 我要让
src="img/profile.png"
,但在浏览器中我得到这个错误
profile.png Failed to load resource: the server responded with a status of 404 (Not Found)
做我错了与路径?
ADIR嗨, 从你的屏幕抓取SRC =“IMG/profile.png”路径不正确。因此请尝试使用路径src =“img/portfolio/profile.png”。我希望这是你的解决方案 –
不,这个profile.png没有进入投资组合,它进入img –
@MalathyVenkatesan其实我不认为它是 - 如果你仔细看看那个文件夹没有扩展。设置src时,我相信它是相对于'index.html'中的' ',你能检查吗?您可能还想尝试将其置于资产文件夹中,作为[此问题的最佳答案](https://stackoverflow.com/questions/40230473/how-to-serve-up-images-in-angular2)暗示 –
0mpurdy