Sotiris Karanasios Sotiris Karanasios - 2 months ago 7x
AngularJS Question

angular-meteor $scope=collection.subscribe does not bind/refresh correctly

meteor, meteor & angular gurus.

I am really new to angular-meteor and facing the following problem. I perform a search using

$scope.Contacts = $meteor.collection(Contacts,false).subscribe('searchString', $scope.searchString);


$scope.Contacts = $scope.$meteorCollection(Contacts,false).subscribe('searchString', $scope.searchString);

and the
does not refresh. It seems like its holds the old collection (speculation). I can see the data being returned by the mongo server and they look fine.If I iterate through the collection using $meteor.foreach you can see that the data are there.

But once the first search result is assigned to
it wont refresh any more. I am having the feeling that
keeps its own "collection" and only append new rows/docs coming from

Any help would be greatly appreciated.

Thanks All,



It's kind of weird. From my understanding, subscribe is linking the data pipline, collections is the representative of the data.

$scope.contacts = $scope.$meteorCollection(function (){
  Contacts.find({someField: $scope.searchString})

You might want something like this?