This is the array
["236.jpg","239.jpg","294.jpg","748.jpg","157.jpg","446.jpg","871.jpg","778.jpg"]
I want to access
"236.jpg"
. The code right below which I am using to fetch the top array.Now how can I fetch the first item using below code ?
<tr ng-repeat="x in p">
<td>
{{ x.images }}
</td>
</tr>
Please help me to find out the sollution.
For more here is the full code
{"info":[{"id":"11","name":"brown","description":"fasdfasd","size":"fasdf","color":"5a72fb","created_at":"2015-09-08 22:33:33","updated_at":"2015-09-08 22:33:33","images":"[\"236.jpg\",\"239.jpg\",\"294.jpg\",\"748.jpg\",\"157.jpg\",\"446.jpg\",\"871.jpg\",\"778.jpg\"]"},{"id":"13","name":"fasdf","description":"asdfghjkl","size":"fasdf","color":"5a72fb","created_at":"2015-09-09 11:48:31","updated_at":"2015-09-09 11:48:31","images":"[\"910.jpg\",\"504.jpg\",\"784.jpg\"]"}]}
angular.module('myApp', []).controller('myCtrl', function($scope, $http){
$http.get('test').success(function (data){
$scope.p = angular.fromJson(data);
console.log(angular.fromJson(data));
});
});
<tbody ng-controller="myCtrl">
<tr ng-repeat="x in p">
<td ng-if="x.images ">
{{ x.images | limitTo:$index }}
</td>
<td>{{ x.size }}</td>
</tr>
</tbody>
Now please help me with full code. Thank you.
ng-if="$first"insideng-repeat