I have a problem, when presenting the data in the view with ionic 2.
** This is the function of my service **
getUsers():Observable<any>{
return this.http.get('https://jsonplaceholder.typicode.com/posts').map((datos) => datos.json());
}
This is my view, start.ts
respuesta = [];
ionViewDidLoad() {
this.platform.ready().then(() => {
this.apiServiceProvider.getUsers().subscribe((res) =>{
this.respuesta.push(res);
console.log(res);
});
This is from my view home.html
<ion-card *ngIf="!respuesta">
<ul id="todo-list">
<li *ngFor="let item of respuesta" >
{{ item.body }}
</li>
</ul>
</ion-card>
In itself, if I print the data by console.
Something missing? What is going wrong? Thanks.