I'm trying to set a simple ng-repeat but it doesn't work. I included angularJS
, then two angular modules (ngTouch
and ngAnimate
because I need them for other purposes) and I included my Angular scripts files. I set the ng-repeat
on a simple element that contains the src
of an image and href
of a link that should be taken from a JSON
object from the angular
script files. But the ng-repeat
is transformed into a HTML
comment.
index.html:
<div class="container-mini" data-ng-controller="graphicsController as portfolioGraphics">
<div class="content coming-soon lang"></div>
Flyers, posters, personal art, etc <br />
<a data-ng-repeat="graphic in graphics" class="fancybox-thumb" rel="fancybox-thumb" data-ng-href="img/graphics/{{graphic.href}}" title="my title">
<img data-ng-src="img/graphics/thumbs/{{graphic.src}}" alt="my alt" />
</a>
<a class="fancybox-thumb" rel="fancybox-thumb" data-ng-href="img/graphics/{{graphic.href}}" title="my title">
<img data-ng-src="img/graphics/thumbs/{{graphic.src}}" alt="my alt" />
</a>
</div>
script.js:
app.controller('GraphicsController', function() {
this.items = graphics;
});
var graphics = [
{
href: "brand-delices-carte.jpg",
src: "brand-delices-carte.jpg",
},
{
href: "brand-delices-flyer.jpg",
src: "brand-delices-flyer.jpg",
},
{
href: "brand-delices-carte.jpg",
src: "brand-delices-carte.jpg",
}
];
Thanks =)
Edit : the link after my ngRepeat
link is just for testing purposes (if it would work inside a normal link without ngRepeat
)