Subscribe Syntax

constructor(http: HttpClient) {
  http
    .get('https://jsonplaceholder.typicode.com/posts')
    .subscribe((response) => {
      console.log(response));
    });
}
Was this page helpful?