Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection.find().zone() not updating zone when server is making changes in collection #100

Open
ansaries opened this issue Aug 10, 2017 · 0 comments

Comments

@ansaries
Copy link

ansaries commented Aug 10, 2017

Not Working code:

// things: Observable<THING[]> // type of things is array of THING in class definition.
// in template <div *ngFor="let thing of things | async">
           
MeteorObservable.autorun().zone().subscribe(() => {
         this.things = Things
          .find({ someIdOfSubDocument: changedProp.currentValue._id })
           .zone();
           });
});           

Only possible solution I found is below:


//things: THING[]; // type of things is array of THING in class definition.
// in template <div *ngFor="let thing of things">
 MeteorObservable.autorun().zone().subscribe(() => {
      Things
         .find({ someIdOfSubDocument: changedProp.currentValue._id })
          .zone()
          .subscribe((quotes) => {
              this.ngZone.run(() => {
                  this.things = quotes;
                });
            });
});              

Why the things: Observable<THING[]> is not updating the view upon changes from the server, however, it is updating only on the new records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant