Skip to content

Instantly share code, notes, and snippets.

@nanotroy
Created August 29, 2019 19:37
Show Gist options
  • Save nanotroy/f6a00d2983877fc5d91d5546f0a3bfed to your computer and use it in GitHub Desktop.
Save nanotroy/f6a00d2983877fc5d91d5546f0a3bfed to your computer and use it in GitHub Desktop.
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class EchoService {
constructor(private httpClient: HttpClient) {}
public makeCall(): Observable<any> {
return this.httpClient.get<any>('https://jsonplaceholder.typicode.com/posts/1');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment