i try display number of images in array can't figure why not working , makes me crazy !
<ion-item ng-click="openmodal(value.$id)" ng-repeat="value in items | orderby: '-$id' track $index " class="item item-avatar" style="text-align:left"> <img ng-if="value['image'].image" ng-src="data:image/jpeg;base64,{{value['image'].image}}"> <img ng-if="!value['image'].image" ng-src="img/shelter.png"> <h2>{{value.nom}} </h2> <p>{{value.adresse}}</p> <p>{{items[0].images.length }} photographie(s)</p> </ion-item>
how can display length of "images" object please ? missing ?
edit : {"-ko5d2zxmy9wzd9vp64s":true} photographie(s)
displaying when put
<p>{{value.images }} photographie(s)</p>
why not use
$scope.images_length = object.keys(items[0].images).length; function myctrl($scope) { $scope.items = {}; $scope.items = [{"images": {"item1": "1", "item2": "2"}}]; $scope.images_length = object.keys($scope.items[0].images).length }
and in view:
<div ng-app=""> <div ng-controller="myctrl"> {{images_length}} </div> </div>
a fiddle: http://fiddle.jshell.net/htt3x5lc/
Comments
Post a Comment