簡體   English   中英

如何使用Angular材質添加圖像?

[英]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屬性即可。

〜是一個剃須刀/asp.net,它可以解決根URL服務器端。 它無法在html代碼中使用。

只需使用“ /Images/profile.svg”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM