Created
May 16, 2018 04:27
-
-
Save tkssharma/1da1c9baa86586cb791483b1b062328a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/app/ping/ping.component.ts | |
import { HttpClient } from '@angular/common/http'; | |
// ... | |
export class AppComponent { | |
constructor(public http: HttpClient) {} | |
public ping() { | |
this.http.get('https://example.com/api/things') | |
.subscribe( | |
data => console.log(data), | |
err => console.log(err) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment