编辑: TIL你不需要在范围中添加url。另外,要小心钥匙,谢谢。以角js图像的URL
我想表现出一个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')
}
];
}]);
我tihnk我未能在NG-SRC点,不
谢谢你,我得到一个白色的页面aplying您的解决方案后,说URL没有定义,所以我修改了控制器的阵列也是如此。感谢您的帮助。 – xxxxxxxxxxxxx