将图像src添加到数组

I'm using this loop for display images (using smarty)

{foreach from=$gallery item=image key=KEY}
    <div class="col-lg-2 col-md-2 col-sm-4 col-xs-6 smallImage">
        <img ng-click="bigImage('/files/galleries/{$image.galleryId}/{$image.name}_full.jpg')" data-width="{$image.width}" data-height="{$image.height}" class="galleryImage" src="/files/galleries/{$image.galleryId}/{$image.name}_full.jpg" /><br />
    </div>
{/foreach}

And what I want to do is add the {$image.name} variable into an array in my angular controller. How do I do this?

Pass your $gallery to Angular by using one of those approaches:

  1. use Ajax get data
  2. ng-init
  3. javascript global variable

And then use ng-repeat

<div class="col-lg-2 col-md-2 col-sm-4 col-xs-6 smallImage" ng-repeat="image in gallery">
    <img ng-click="..." ng-src="...."><br />
</div>

I used Angular ng-repeat rather than smarty.