我已经在视图中显示了JSON对象。如何显示一个对象的其他详细信息?
var news= angular.module('news',[]);
news.controller('labController', [
'$scope', '$http',
function ($scope, $http) {
$scope.model={};
$scope.movies = [];
//var url = 'https://api.themoviedb.org/3/movie/{movie_id}?api_key=ea12c869f716552bef3493abf72c3617&l&language=en-US'
var url = 'https://api.themoviedb.org/3/movie/popular?api_key=ea12c869f716552bef3493abf72c3617&language=en-US&page=1';
$http.get(url)
.then(function(success){
$scope.movies = success.data.results;
$scope.show = false;
console.log(success.data.results);
},function(error){
console.log(error);
$scope.show = false;
});
function loadDetail(name) {
var url = 'https://api.themoviedb.org/3/movie/'+name+'?api_key=ea12c869f716552bef3493abf72c3617&language=en-US&page=1&append_to_response=videos,images'
$http.get(url)
.then(function (response) {
$scope.model.detail = response.data.results;
//console.log(response.data.results);
}, function (response) {
$scope.model.detail = { error: true, message: 'Error: ' + response.data.message };
});
console.log('cy');
}
}]);