Skip to content

Instantly share code, notes, and snippets.

@ganqqwerty
Last active October 29, 2019 13:04
Show Gist options
  • Save ganqqwerty/89ae82599c9e87bc33f80827b818e84c to your computer and use it in GitHub Desktop.
Save ganqqwerty/89ae82599c9e87bc33f80827b818e84c to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-totoro',
template: `<pre>{{totoroDetails$ | async | json}}</pre>`,
})
export class TotoroComponent implements OnInit {
totoroDetails$: string;
constructor(private http: HttpClient) {
}
ngOnInit() {
this.totoroDetails$ = this.http.get('https://ghibliapi.herokuapp.com/films/58611129-2dbc-4a81-a72f-77ddfc1b1b49').pipe(
map(response => response.description));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment