0
I have the following problem.
apelidoCidade(){
let cidade = this.storage.get('apelidocidade').then(res => console.log(res));
return cidade;
}
getbanner(){
let url = 'http://localhost/'+ this.apelidoCidade() +'/index.php?component=json&action=bannerinicio';
let data: Observable<any> = this.http.get(url);
data.subscribe(result => {
this.banners = result;
});
}
It returns me the city on the log console. But give me the following error on the console
:8100/#/home:1 Access to Xmlhttprequest at 'http://localhost/[Object%20Promise]/index.php? Component=json&action=bannerinicio' from origin 'http://localhost:8100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested Resource.
How can I solve this problem?