私は単純な1ページのアプリケーションを構築するためにwordpress rest apiとangular2を使用しています。私は、ツールセットでカスタムポストタイプを作成しました。すべて正常に動作しており、データが正常に戻ってくるのがわかります。Angular2 httpはカスタムポストタイプ用の空の結果を得ます。Wordpressツールセット
http://tncorp.biffapps.com/wp-json/wp/v2/downloads/?filter[product]=Pico
レスポンスボディが空である、私の角のアプリケーションでデータを要求しようとします。
応答 _body : "[]" ヘッダ : ヘッダ OK : 真 状況 : STATUSTEXT
これはhappingている理由誰でも知っていますか? HTTP GETのため
コード:
getProductDownloads($id): Observable<any> {
this.ProductsDownloads = this.http.get(this.wpurl + 'downloads/?filter[product]='+$id)
.map(res => {
console.log('GET DOWNLOAD',res)
return this.ProductsDownloads = this.extractData(res)
})
.catch(this.handleError);
return this.ProductsDownloads;
}
apiの例は空の結果を返します。 – Erevald