FundersClub/fire

Try using observables instead of snapshots in management components

Closed this issue · 2 comments

All these blobs:

let data = this.route.parent.snapshot.data as { repository: Repository };
this.repository = this.repositoryService.getByUrl(data.repository.url);

Might be able to do this instead:

this.route.parent.data.subscribe((data: { repository: Repository }) => {
  this.repository = data.repository;
});

Reading https://blog.thoughtram.io/angular/2016/10/10/resolving-route-data-in-angular-2.html leads me to believe that snapshot.data is the way to go actually

Yup, agreed.