0
Ich versuche, eine JSON-Antwort angezeigt werden, aber kann nicht scheinen, etwas anzuzeigen:Ionic 2: Kann nicht angezeigt werden JSON-Antwort in Sicht
Antwort:
woo.service. ts:
getProducts() : Observable<any> {
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
return this._http.get(this._url+'products?'+'consumer_key='+this._ck+'&consumer_secret='+this._cs, {
headers : headers
}).map(res => res.json().items);
}
woo.ts:
ngOnInit() {
this._wooService.getProducts()
.subscribe(
response => this.response = response,
error => console.log(error));
this.isLoading = false;
}
Und schließlich die woo.html:
<ion-card-header class="cardHead" text-center>
<h2 class="cardHeaderText">{{obj.products.title}}</h2>
<p>Prix: {{obj.price_html}}</p>
</ion-card-header>
<ion-card-content>
<img src="{{obj.images.src}}">
<p class="cardBodyText">{{obj.description}}</p>
<p>Tags: {{obj.tags}}</p>
<p>Catégories: {{obj.categories}}</p>
</ion-card-content>
jemand eine Idee, warum ich nicht mit * ngFor = "# obj der Antwort" zugreifen kann?