【发布时间】:2018-12-29 15:24:36
【问题描述】:
我正在尝试从 Angular 应用程序拨打电话,但我收到以下错误:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
这是我的代码:
constructor(private http: Http) {
}
getNearbyRestaurants(lat: number, lng: number){
return this.http.get(this.API_URL+this.API_KEY+`&location=${lat},${lng}`).pipe(
map(result => result)
);
}
}
有人知道如何解决这个问题吗?谢谢
【问题讨论】:
标签: rest api google-maps google-maps-api-3 google-places-api