Guest User

Untitled

a guest
Feb 21st, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. getUsers():Observable<any>{
  2. return this.http.get('https://jsonplaceholder.typicode.com/posts').map((datos) => datos.json());
  3. }
  4.  
  5. respuesta = [];
  6. ionViewDidLoad() {
  7. this.platform.ready().then(() => {
  8. this.apiServiceProvider.getUsers().subscribe((res) =>{
  9. this.respuesta.push(res);
  10. console.log(res);
  11. });
  12.  
  13. <ion-card *ngIf="!respuesta">
  14. <ul id="todo-list">
  15. <li *ngFor="let item of respuesta" >
  16. {{ item.body }}
  17. </li>
  18. </ul>
  19. </ion-card>
Add Comment
Please, Sign In to add comment