Collection-repeat bug with the first item


#1

first here is how i’m using the directive :

<ion-item 
      collection-repeat="quest in questions"
      collection-item-width="'100%'"
      collection-item-height="getItemHeight(quest)"
      ng-href="#/app/messages/{{quest.id}}"
      ng-style="{'height' : '40px'}"
      class="item item-thumbnail-left question-row">
      <h2>some data</h2> 
      <ion-delete-button class="ion-ios7-trash" 
            ng-click="onItemDelete(quest)">
      </ion-delete-button>
    </ion-item>

and inside my controller i have this :

$scope.getItemHeight = function(item) {
	return 100;
};

the render is fine the list is shown with no trouble at all but my problem is that the first item in the JSON array doesn’t appear on the list, and at the very bottom of the list i have an empty item who doesn’t return any id in quest.id

I’m not sure why is this happening, because i was using the exact same controller and functions to get my items from the server and push them to and ng-repeat without any problem before


#2

I am facing exactly the same issue. Why quest[0] is not in the list and in the end an additional object is added with no contents.

Definitely must be some bug.

In the mean while look at this: Collection repeat for array with objects


#3

I had the same problem with 1.0.0-beta.11 (released 2014-08-06)
My workaround was to switch to:
http://code.ionicframework.com/nightly/js/ionic.bundle.js
for now…
Thx, Kjetil