Angular 2 meteor component doesn't recieve data on page reload (if route has a canActivate)

77 Views Asked by At

I'm working on a Meteor app with Angular 2 and I've run into an issue where my components won't recieve data from a subscribed collection when the page is first reloaded, if the route for the page includes a canActivate guard (in this case it's a simple is-logged-in condition).

For now I'm going to work around it (by not using guards) but what's the probable cause? I'm quite new to Meteor so any assistance is welcome.

For reference my component is super simple and looks like this:

@Component({
  selector: 'hobbit-list',
  template: template.default,
})
export class HobbitListComponent implements OnInit {
  hobbits : Observable<Hobbit[]>;

  constructor() {
  }

  ngOnInit() : void {
    this.hobbits = Hobbits.find({}).zone();
    MeteorObservable.subscribe('hobbits').subscribe();
  }
}
0

There are 0 best solutions below