Skip to content

Instantly share code, notes, and snippets.

@elvinmeza
Created November 21, 2017 16:30
Show Gist options
  • Save elvinmeza/d233f37074e69a13af6cdac6db84fe9b to your computer and use it in GitHub Desktop.
Save elvinmeza/d233f37074e69a13af6cdac6db84fe9b to your computer and use it in GitHub Desktop.
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
@Injectable()
export class RockBand {
private rockBandsUrl = 'api/rockBands';
constructor(private http: HttpClient) {
}
getRockBands(): Observable<RockBand[]> {
return this.http.get<RockBand[]>(this.rockBandsUrl);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment