kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

ionic app slow initialization #169

Open casper5822 opened 7 years ago

casper5822 commented 7 years ago

Hello, i tried the directive in my ionic app. I made a simple test with this code:

<ion-content>
 <div vs-repeat>
  <div class="card" ng-repeat="item in list track by $index">
      {{item.name}}
  </div>
</div>
</ion-content>

The list data are downloaded from the server. I tried to download 5000 items and the initialization is very slow (the page stucks for 3 minutes). It seems like the directive renders all the elements. This happens also when i leave the page and after enter again. Maybe i make some mistake?

Thank you for the help.

More information: Ionic v1.3.3, module vs-repeat imported correctly

vahidvdn commented 7 years ago

@casper5822 You must add styles as well as js files. And add class for your element:

<div class="repeater-container" vs-repeat>
  <div class="item-element well" ng-repeat-start="item in posts">
    <span>{{item.text}} start</span>
  </div>
  <div class="item-element well" ng-repeat-end>
    <span>{{item.text}} end</span>
  </div>
</div>

For me it works and render only a few elements, but when I scroll it confuses and just show a few elements. (This happens only in ionic. In simple web app, everything works fine)

Please let me know if you have the same issue after adding styles and classes.