gpt4 book ai didi

angularjs - angular js中图像的URL

转载 作者:太空宇宙 更新时间:2023-11-04 14:33:16 25 4
gpt4 key购买 nike

编辑:直到您不需要在范围内添加 url。另外,要小心 key ,谢谢。

我试图在 HTML5 文档中显示一些图像及其名称,这是索引:

    <div ng-repeat="producto in productos">     
<figure class="floating">
<img ng-src="{{ image }}" alt="Macaque in the trees" class="rcorners3" style='width:100%;' border="0" alt="Null">
<figcaption>{{ name }}</figcaption>
</figure>
</div>

在顶部我有:

    <body ng-app="app"> 


<div class="main" ng-controller="app">

这就是 MainController.js 的样子:

app.controller('app', ['$scope', function ($scope) {
$scope.productos = [{
name : 'Management Guides',
image : url('managemant-guides.jpg')
}, {
name : 'Leaflets',
image : url('managemant-guides.jpg')
}, {
name : 'Production Charts',
image : url('managemant-guides.jpg')
}, {
name : 'Technical Guides',
image : url('managemant-guides.jpg')
}, {
name : 'Poultry News',
image : url('managemant-guides.jpg')
}
];
}]);

我知道我在 ng-src 点失败了,不是

最佳答案

你应该使用:

 ng-src="{{ producto.image }}"

关于angularjs - angular js中图像的URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31537931/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com