I'm trying to retrieve data from Google books API - https://www.googleapis.com/books/v1/volumes
Here's the plnkr link- https://plnkr.co/edit/K4f7CVIeurAUMRzQYMb0?p=preview
I enter the ISBN number(say: 1234) in the search text, and update the bookList with the response items that I received from google.
I'm trying to iterate over these books using ng-repeat but it's not updating.
I need to click on search twice to see the result in ng-repeat.
I'm confused why isn't it updating the content dynamically.
See the plnkr link. https://plnkr.co/edit/K4f7CVIeurAUMRzQYMb0?p=preview
Enter 1234 in the search text and click search, won't update in the html.
Click search again, it updates the html with the last response.
Thanks.
$http.get(url).then(function(response) { first.books = response.data; }, function(error){console.log(error)}. This way as the scope is evaluated and after the http promise is resolved your repeater will update with the result. Then your li should be<li ng-repeat="book in first.books">