如何使用 Angular material 添加图像?
How to add image with Angular material?
我试过类似的东西
<img ng-src="~/Images/profile.svg" style="height:130px ; width:180px" class="md-card-image" alt="~/Frontend/images/question-circular-button.svg">
http://localhost/WebApp/~/Images/profile.svg 加载资源失败:服务器响应状态为 404(未找到)`
图像在该文件夹中..有人可以帮我吗?
如果您的源不是变量,请不要使用 ng-src。只需使用常规 html src 属性。
~ 是一个 razor/asp.net 东西来解析 root url 服务器端。它不适用于 html 代码。
只需使用“/Images/profile.svg”即可。
我试过类似的东西
<img ng-src="~/Images/profile.svg" style="height:130px ; width:180px" class="md-card-image" alt="~/Frontend/images/question-circular-button.svg">
http://localhost/WebApp/~/Images/profile.svg 加载资源失败:服务器响应状态为 404(未找到)`
图像在该文件夹中..有人可以帮我吗?
如果您的源不是变量,请不要使用 ng-src。只需使用常规 html src 属性。
~ 是一个 razor/asp.net 东西来解析 root url 服务器端。它不适用于 html 代码。
只需使用“/Images/profile.svg”即可。