Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2019 04:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { People, Planet } from '../model/api';
selector: 'app-example-sync',
templateUrl: './example-sync.component.html',
styleUrls: ['./example-sync.component.css']
export class ExampleSyncComponent implements OnInit {
people$: Observable<People>;
planet$: Observable<Planet>;
constructor(private http: HttpClient) {}
ngOnInit() {
this.people$ = this.http.get<People>('');
this.planet$ = this.http.get<Planet>('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment