I try to use anchorScroll with collection-repeat.
this is my code.
<ul class=list" id="downloadList" animation="slide-left-right">
<a id="{{pack.packageId}}"
collection-repeat="pack in packs | filter:downloadText
collection-item-width="'100%'"
collection-height="70"
style="width:100%"
class="item item-avatar"
ng-href="#/app/download/{{pack.packageId}}">
<img ng-src="{{...}}" alt="{{pack.packageId}}">
<h2>{{pack.packageId}}</h2>
<h3>{{pack.title[i8n] || pack.title.en}}</h3>
</a>
</ul>
and try to scroll to the id
$location.hash(id);
$ionicScrollDelegate.anchorScroll());
But failed. If i replace collection-repeat with ng-repeat, it works.
Is it impossble to locate the position with collection-repeat?
update:
I use scrollBy and getElementId to find the ID.
But there are some problem.
- It’s too slow!
- $ionicScrollDelegate.scrolBy don’t have callback function. I need a magic setTimeout value to delay it.
Any better solution?