Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

<!DOCTYPE html> <html> <body> <div ng-app=\"myApp\" ng-controller=\"customersCtr

ID: 3670569 • Letter: #

Question

<!DOCTYPE html>
<html>
<body>

<div ng-app="myApp" ng-controller="customersCtrl">

<ul>
<li ng-repeat="x in books">
{{ x.title + ', ' + x.author }}
</li>
</ul>

</div>

<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://api.nytimes.com/svc/books/v3/lists/.json?api-key=37775f104c1d0455b95606647354d2ae:10:74362200")
.then(function (response) {
alert("RESPONSE=" + response.data.results.book[0].author);
    $scope.books = response.data.results.book;
});
});
</script>

</body>
</html>

This is the only code I have so far. I am supposed to make a list of best non fiction and fiction books in a form of a table. It is supposed to populate with the API and the API key. I am just not understanding how I am supposed to do this.

Where to get the API information: http://developer.nytimes.com/docs You wil need to get an API key (Read the documentation) .You wil need to figure out how to parse the JSON response.

Explanation / Answer

'use strict'; // Declare app level module which depends on views, and components angular.module('myApp', [ 'ngRoute', 'myApp.view1', 'myApp.view2' ]). config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({redirectTo: '/view1'}); }]); var genres = [ 'fable', 'fantasy', 'fiction', 'folklore', 'horror', 'humor', 'legend', 'metafiction', 'mystery', 'mythology', 'non-fiction', 'poetry' ]; var books = [ { title: 'A Game of Thrones: A Song of Ice and Fire', author: 'George R.R. Martin', isbn: '0553593714', review: 'The most inventive and entertaining fantasy saga of our time—warrants one hell of an introduction. I loved this book!', rating: 4, genres: { 'non-fiction': true, fantasy: true } },{ title: 'HTML for Babies', author: 'John C Vanden-Heuvel Sr', isbn: '0615487661', review: "It's never too early to be standards compliant! I taught my little one mark-up in under one hour!", rating: 5, genres: { fiction: true } },{ title: 'A is for Array', author: 'Brandon J Hansen', isbn: '1489522212', review: 'A is for Array is the ABC book for future programmers. Filled with fun illustrations and simple real-world examples, my children loved seeing my world intertwined with theirs!', rating: 4, genres: { fiction: true } },{ title: 'The Dragon Reborn', author: 'Robert Jordan', isbn: '0812513711', review: 'The Wheel weaves as the Wheel wills, and we are only the thread of the Pattern. Moiraine', rating: 4, genres: { 'non-fiction': true, fantasy: true } } ];

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote