@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
posts:any;
constructor(public navCtrl: NavController, public http: Http) {
this.navCtrl=navCtrl;
this.http.get('API link').map(res => res.json()).subscribe(
response => {
this.posts = response.data.resource;
console.log(this.posts);
},
err => {
console.log("Oops!");
});
}
show(){
this.navCtrl.push(Nextpage,{
param1: 'Recent Activities'});
}
}

我是离子2的新手,在使用GET方法请求API时遇到跨域错误,我如何允许跨域:true在离子2.附加错误屏幕截图。请建议。