0

I am working on an Angular App that gets some data from a web server as JSON and shows that in a list using ng-repeat. Now, dynamically, I want to add more data to that array which is used by ng-repeat. I use another function and get more data and append that to the array using

$scope.MyArrayName.push.apply($scope.MyArrayName, newDataArray)

But after that the filter stops working. The filter is as following.

<a class="item item-thumbnail-left item-text-wrap" href="#/main/postDetail/{{post.id}}" ng-repeat="post in MyArrayName | filter: {title:searchText}">

where searchText is an input of type text with ng-model="searchText".

Please note that the filter works just perfect before adding new data to the array. But stops afterwards.

Any help is highly appreciated.

4
  • 1
    please re-produce this issue in plunker/jsfiddle. Commented Sep 18, 2015 at 13:03
  • It is an Ionic App so here is the playground link play.ionic.io/app/eaf6faa82671. Please try out the search after scrolling to the bottom to load new items. Commented Sep 18, 2015 at 13:12
  • its working properly, the problem is scrollBar, when you scroll done and search by title, its display result in top of the screen, scroll done and search any item and then scroll up you find result. Commented Sep 18, 2015 at 13:28
  • Oh, okay. Thank you very much. Is there any way I can scroll to top as user types? Commented Sep 18, 2015 at 13:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.