I have below html code , its working fine for multiple array values , but for the first time array has single values , that time its not working .
My html code :
<div ng-repeat="datas in data"">
<div class="add-pic-box1 col-md-3" ng-repeat="img in datas.Url">
<!-- <h1>{{datas.id}}</h1> -->
<img class="thumb" ng-model="add_new_ads_mdl.img_add" imgid = "{{img._id}}" src="{{img.url}}" />
<span><i class="fa fa-times" ng-click="close_img(data.url._id)"></i></span>
</div>
</div>
This is my angular code which i try
$scope.data = response;
the response has only one array object at first time , at first time only its not working.
First time i got this array :
[
Mainid: "589d8761ccd6d1231e5c3882",
Url:
{
{
"url": 'images/product_images/file-1486718817763.jpeg',
"_id": 589d8761ccd6d1231e5c3883
}
}
]
Its Not Working
Second time i got this array
[
Mainid: "589d8761ccd6d1231e5c3882",
Url:
{
{
"url": 'images/product_images/file-1486718817763.jpeg',
"_id": 589d8761ccd6d1231e5c3883
},
{
"url":"images/product_images/file-1486731092357.png",
"_id":"589db754375cdc4e8351f0be"
}
}
]
Its working fine
$scope.data = response.data;, show you ajax code..