angular - display ngFor with json object return from service -


this service: https://api.myjson.com/bins/quv59

im trying display in html

*ngfor="let item of bookslist; let = index" 

my ts file

ngoninit() {   this.booksdataservice.getbooks().subscribe(   function(response) {      this.bookslist = response.books;   }, );} 

thanks in advance

  <li *ngfor="let item of bookslist; let = index">     {{ item.author }}    </li> 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -