Sotiris Karanasios Sotiris Karanasios - 1 year ago 58
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,


Answer Source

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?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download