Angular service not working with http.get observable
问题 I am trying to retrieve json file from the server using http.get and subscribe to the observable from a component. However, it's returning an error, not the data. Can you please tell me where I'm going wrong: import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import { Observable } from 'rxjs'; @Injectable() export class MoviesService { constructor(private http: Http) { } getMovies() : Observable<any> { let url = API_URL; return this.http.get(url); } } and here's