@developerrky wrote:
Hi All,
home.ts
public getFuelCities() {
let URL = "assets/data/locations.json";
// let URL = "http://fuelpriceindia.herokuapp.com/cities.json"this._http.get(URL)
.map(res => res.json())
.subscribe(data => {
this.fuelcities = data.cities;
console.log(JSON.stringify(data.cities));
});
}home.html
Choose City
{{cityName}}
The dropdown has its data when I call json locally using let URL = "assets/data/locations.json";
But it doesn't work when I call the same data from external url
let URL = "http://fuelpriceindia.herokuapp.com/cities.json"I tried settting this url in proxy too:
"proxies": [
{
"path": "/api",
"proxyUrl": "http://fuelpriceindia.herokuapp.com"
}
]But nothing happend, could you please assist me on this. this is urgent for me.
Regards,
Rajesh
Posts: 2
Participants: 1