Last active
January 31, 2018 20:51
-
-
Save frontconnect/d414afd1df65f55260c01ed0be223164 to your computer and use it in GitHub Desktop.
Test Service defined for testing REST calls with HTTPClient library
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
import { HttpClient } from '@angular/common/http'; | |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
@Injectable() | |
export class TestService { | |
private testUrl = '/some/test/url'; | |
constructor(private http: HttpClient) { } | |
public testCall(): Observable<string> { | |
return this.http.get(this.testUrl); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment