import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { Observable } from 'rxjs/Observable' ; @ Injectable ( ) export class BeerService { constructor ( private http ) { } getAll ( ) { return this . http . get ( 'http://localhost:8080/good-beers' ) ; } }