为什么我的图像显示为文件 Logo ?链接如下
This is how my image shows up when I add it
这是我的图像 JS (AngularJS)
{
name: 'Screw',
price: 1,
description: 'A small item drilled into objects',
specs: '1 centimeter',
images: [
{
full: "1024px-Phillips_screw.jpg"
}
]
}
这是我用于添加图像的 HTML
<img ng-src="{{product.images[0].full}}"/>
最佳答案
为什么不使用 ng-src directive ? 即。
<div ng-init="myVar='pic_angular.jpg'">
<h1>Angular</h1>
<img ng-src="{{myVar}}">
</div>
关于javascript - 使用 AngularJS 将图像添加到网页中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44976065/