Angular 2图像未显示 [英] Angular 2 Image not showing
本文介绍了Angular 2图像未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我有一个非常基本的问题。
So I have a very basic issue.
我的Angular 2应用程序中没有显示图像。
Images are not showing in my Angular 2 application.
这是我定义图像的方式:
This is how I define an image:
<img alt="logo" [src]="'./images/logo.png'">
我是否应该安装一个包以使图像有效?
Is there a package I'm supposed to install to make images work?
顺便说一句我是Angular的新手,你可能猜到了!
BTW I'm new to Angular as you can probably guess!
推荐答案
财产绑定( '[]'):将视图元素的属性设置为模板表达式的值。
Property binding ('[]') : To set a property of a view element to the value of a template expression.
<img alt="logo" src="'./images/logo.png'">
工作正常
这篇关于Angular 2图像未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文