我觉得我缺少明显的东西在这里,但我不能JSON数据呈现到页面中,唯一能出把JSON格式的数据,而不仅仅是特定键(例如,名字:Abbey Malt)。从JSON数据显示在AngularJS
这是我的控制器:
app.controller('beerController', function($scope, $http, $modal) {
$http.get("http://api.brewerydb.com/v2/fermentables", {
params: {
key: 'xxx'
}
})
.then(function(response) {
$scope.response = response.data.name;
console.log(response);
});
};
和HTML:
<div ng-controller="beerController">
<div class="container">
<h3>Latest Releases ({{currentPage}} pages)</h3>
<div class="row">
<div ng-repeat="items in response">
<li>{{data.name}}</li>
</div>
</div>
</div>
</div>
我太亲近了!谢谢! – user3438917