【发布时间】:2018-04-05 18:50:15
【问题描述】:
我正在尝试显示我的 wordpress 网站上的所有帖子。目前有2个帖子,可以在json文件中看到: View
export class HomePage {
url: string = ‘http://feederhorgasz.000webhostapp.com/wp-json/wp/v2/posts?_embed?filter[orderby]=date&order=asc1’;
items: any;
constructor(public navParams: NavParams,public navCtrl: NavController, private http:Http) {
console.log('Passed params', navParams.data);
}
ionViewDidEnter() {
this.http.get( this.url )
.map(res => res.json())
.subscribe(data =>
{
this.items = data;
console.log(“átadott wp api”,data);
});
}
但是,当我尝试从 json 中读取数据时,它只列出了一个对象。 (我可以在日志中看到)
【问题讨论】:
标签: angular ionic-framework wordpress-rest-api