Collection repeat not working


#1

I am testing “collection repeat” in an ionic 2 project, no errors and no data displayed. Below is an example of the code i am using.

Example:

JS

this.items = [1,2,3,4,5,6];

HTML

  < ion-item collection-repeat="item in items">
   {{item}}
  < /ion-item>

#2

Hey there, so thats ionic v1 syntax.

V2 does not have collection repeat at the moment, but it’s slated to land in future releases!


#3

How can i see my ionic version


#4

Thanks, that explains why it’s not working.


#5
  <ion-content has-header="true" padding="true" scroll="true">
      <div class="bar bar-header item-input-inset">
          <label class="item-input-wrapper">
              <i class="icon ion-ios-search placeholder-icon"></i>
              <input type="search" placeholder="Rechercher Actualité" ng-model="item.$">
          </label>
          <button class="button button-clear">
              Actualiser
          </button>
      </div>

    <div class="list">
     <a collection-repeat="item in items | orderBy :'-actu_id' | filter:item:strict" class="item item-thumbnail-left"
         ng-href="#/getActualiteId/{{item.actu_id}}">
        <img ng-src="http://www.douanes.ci/admin/images/actualite/{{item.actu_id}}.jpg">
        <h2>{{ item.actu_titre }}</h2>
        <p>{{ item.actu_resume }}</p>
        <p>Edité le {{ item.actu_date | date:'fullDate'}}</p>
     </a>
    </div>
  </ion-content>

</ion-view>

#6

this what i have put in my code