0

i'm tring to fect from webservice an API in json. I'm using this code in my service provider:

getAll() {
return this.authHttp.get(this.cfg.apiUrl + this.cfg.books)
  .toPromise()
  .then(rs => {
    return Array.of(rs.json());
  });

}

and from the module:

  this.booksService.getAll().then(books => this.books = books);

but when i try to iterate book of books i trown this error:

NgFor only supports binding to Iterables such as Arrays

someone can help me to figure out?

wwhitewalter
  • 47
  • 1
  • 10

0 Answers0