Skip to content

Instantly share code, notes, and snippets.

@timjonesdev
Created August 21, 2019 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timjonesdev/5d2149be4d023292bb86de5196e238f0 to your computer and use it in GitHub Desktop.
Save timjonesdev/5d2149be4d023292bb86de5196e238f0 to your computer and use it in GitHub Desktop.
The constructor for the TeamService
private teamWatchSource = new BehaviorSubject(new TeamModel());
_teamWatchSource: Observable<TeamModel> = this.teamWatchSource.asObservable();
constructor(private http: HttpClient, private zone: NgZone) {
this.getTeamsStream().subscribe(data => {
this.teamWatchSource.next(new TeamModel().deserialize(data));
}, error => console.log('Error: ' + error),
() => console.log('done loading team stream'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment